-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Bubble Example with Istio and Istio+ArgoRollouts
- Loading branch information
1 parent
1586d84
commit fbdd9c5
Showing
16 changed files
with
240 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
bubbles/bubbles-backend/src/main/argorollouts/Service-canary.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: bubble-backend-canary | ||
labels: | ||
app: bubblebackend | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
selector: | ||
app: bubblebackend |
12 changes: 12 additions & 0 deletions
12
bubbles/bubbles-backend/src/main/argorollouts/Service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: bubble-backend | ||
labels: | ||
app: bubblebackend | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
selector: | ||
app: bubblebackend |
55 changes: 55 additions & 0 deletions
55
bubbles/bubbles-backend/src/main/argorollouts/rollout-v2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: bubblebackend | ||
labels: | ||
app: bubblebackend | ||
spec: | ||
strategy: | ||
canary: | ||
steps: | ||
- setWeight: 20 | ||
- pause: | ||
duration: "1m" | ||
- setWeight: 50 | ||
- pause: | ||
duration: "2m" | ||
canaryService: bubble-backend-canary | ||
stableService: bubble-backend | ||
trafficRouting: | ||
istio: | ||
virtualService: | ||
name: bubble-backend | ||
routes: | ||
- primary | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: bubblebackend | ||
version: v1 | ||
template: | ||
metadata: | ||
labels: | ||
app: bubblebackend | ||
version: v1 | ||
annotations: | ||
sidecar.istio.io/inject: "true" | ||
spec: | ||
containers: | ||
- name: bubblebackend | ||
image: quay.io/rhdevelopers/bubble-backend:v1.0 | ||
env: | ||
- name: BUBBLE_COLOR | ||
value: blue | ||
imagePullPolicy: Always | ||
ports: | ||
- name: web | ||
containerPort: 8080 | ||
resources: | ||
requests: | ||
memory: "64Mi" | ||
cpu: "100m" | ||
limits: | ||
memory: "128Mi" | ||
cpu: "140m" |
52 changes: 52 additions & 0 deletions
52
bubbles/bubbles-backend/src/main/argorollouts/rollout.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: bubblebackend | ||
labels: | ||
app: bubblebackend | ||
spec: | ||
strategy: | ||
canary: | ||
steps: | ||
- setWeight: 20 | ||
- pause: | ||
duration: "1m" | ||
- setWeight: 50 | ||
- pause: | ||
duration: "2m" | ||
canaryService: bubble-backend-canary | ||
stableService: bubble-backend | ||
trafficRouting: | ||
istio: | ||
virtualService: | ||
name: bubble-backend | ||
routes: | ||
- primary | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: bubblebackend | ||
version: v1 | ||
template: | ||
metadata: | ||
labels: | ||
app: bubblebackend | ||
version: v1 | ||
annotations: | ||
sidecar.istio.io/inject: "true" | ||
spec: | ||
containers: | ||
- name: bubblebackend | ||
image: quay.io/rhdevelopers/bubble-backend:v1.0 | ||
imagePullPolicy: Always | ||
ports: | ||
- name: web | ||
containerPort: 8080 | ||
resources: | ||
requests: | ||
memory: "64Mi" | ||
cpu: "100m" | ||
limits: | ||
memory: "128Mi" | ||
cpu: "140m" |
16 changes: 16 additions & 0 deletions
16
...bubbles-backend/src/main/argorollouts/virtual-service-bubble-backend-v1_and_v2_100_0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: bubble-backend | ||
spec: | ||
hosts: | ||
- bubble-backend | ||
http: | ||
- route: | ||
- destination: | ||
host: bubble-backend | ||
weight: 100 | ||
- destination: | ||
host: bubble-backend-canary | ||
weight: 0 | ||
name: primary |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
kubectl delete -f ../../bubbles-backend/src/main/argorollouts/rollout.yaml | ||
|
||
kubectl delete -f ../../bubbles-backend/src/main/argorollouts/Service.yaml | ||
kubectl delete -f ../../bubbles-backend/src/main/argorollouts/Service-canary.yaml | ||
kubectl delete -f ../../bubbles-backend/src/main/argorollouts/virtual-service-bubble-backend-v1_and_v2_100_0.yaml | ||
|
||
|
||
kubectl delete -f ../../bubbles-frontend/src/main/istio/Gateway.yaml | ||
|
||
kubectl delete -f ../../bubbles-frontend/src/main/kubernetes/Deployment.yaml | ||
kubectl delete -f ../../bubbles-frontend/src/main/kubernetes/Service.yaml | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
echo "###### Deploying FrontEnd ######" | ||
|
||
kubectl apply -f ../../bubbles-frontend/src/main/kubernetes/Deployment.yaml | ||
kubectl apply -f ../../bubbles-frontend/src/main/kubernetes/Service.yaml | ||
|
||
kubectl wait --for=condition=available --timeout=600s deployment/bubblefrontend | ||
|
||
kubectl apply -f ../../bubbles-frontend/src/main/istio/Gateway.yaml | ||
|
||
echo "###### Deploying BackEnd V1 ######" | ||
|
||
kubectl apply -f ../../bubbles-backend/src/main/argorollouts/Service.yaml | ||
kubectl apply -f ../../bubbles-backend/src/main/argorollouts/Service-canary.yaml | ||
kubectl apply -f ../../bubbles-backend/src/main/argorollouts/virtual-service-bubble-backend-v1_and_v2_100_0.yaml | ||
|
||
kubectl apply -f ../../bubbles-backend/src/main/argorollouts/rollout.yaml | ||
|
||
kubectl get routes -n istio-system | ||
|
||
echo "/bubble/index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
kubectl create namespace argo-rollouts | ||
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/download/v1.1.0/install.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
kubectl apply -f ../../bubbles-backend/src/main/argorollouts/rollout-v2.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
kubectl delete -f ../../bubbles-backend/src/main/istio/destination-rule-bubble-backend-v1-v2.yaml | ||
kubectl delete -f ../../bubbles-backend/src/main/istio/virtual-service-bubble-backend-v1_and_v2_100_0.yaml | ||
|
||
kubectl delete -f ../../bubbles-backend/src/main/kubernetes/Deployment.yaml | ||
kubectl delete -f ../../bubbles-backend/src/main/kubernetes/Deployment-v2.yaml | ||
kubectl delete -f ../../bubbles-backend/src/main/kubernetes/Service.yaml | ||
|
||
kubectl delete -f ../../bubbles-frontend/src/main/kubernetes/Deployment.yaml | ||
kubectl delete -f ../../bubbles-frontend/src/main/kubernetes/Service.yaml | ||
|
||
kubectl delete -f ../../bubbles-frontend/src/main/istio/Gateway.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
echo "###### Deploying FrontEnd ######" | ||
|
||
kubectl apply -f ../../bubbles-frontend/src/main/kubernetes/Deployment.yaml | ||
kubectl apply -f ../../bubbles-frontend/src/main/kubernetes/Service.yaml | ||
|
||
kubectl wait --for=condition=available --timeout=600s deployment/bubblefrontend | ||
|
||
kubectl apply -f ../../bubbles-frontend/src/main/istio/Gateway.yaml | ||
|
||
echo "###### Deploying BackEnd ######" | ||
|
||
kubectl apply -f ../../bubbles-backend/src/main/kubernetes/Deployment.yaml | ||
kubectl apply -f ../../bubbles-backend/src/main/kubernetes/Deployment-v2.yaml | ||
kubectl apply -f ../../bubbles-backend/src/main/kubernetes/Service.yaml | ||
|
||
kubectl wait --for=condition=available --timeout=600s deployment/bubblebackend | ||
kubectl wait --for=condition=available --timeout=600s deployment/bubblebackend-v2 | ||
|
||
echo "###### Redirecting Traffic to V1 ######" | ||
|
||
kubectl apply -f ../../bubbles-backend/src/main/istio/destination-rule-bubble-backend-v1-v2.yaml | ||
kubectl apply -f ../../bubbles-backend/src/main/istio/virtual-service-bubble-backend-v1_and_v2_100_0.yaml | ||
|
||
kubectl get routes -n istio-system | ||
|
||
echo "/bubble/index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
echo "###### Redirecting Traffic to V2 ######" | ||
|
||
kubectl apply -f ../../bubbles-backend/src/main/istio/virtual-service-bubble-backend-v1_and_v2_0_100.yaml |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters