Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canary Deployment feature of Istio #116 #117

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions deployments/destination-rules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: ui-app
spec:
  host: ui-app
  subsets:
  - name: v1
    labels:
      version: v1
  - name: v2
    labels:
      version: v2
29 changes: 29 additions & 0 deletions deployments/gateway-istio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: captivate-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"

---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: api-gateway
spec:
hosts:
- api-gateway
gateways:
- captivate-gateway
http:
- route:
- destination:
host: api-gateway
Comment on lines +17 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed if we don't want to define traffic rules for this service

30 changes: 29 additions & 1 deletion deployments/ui-vm.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ui-deployment
name: ui-deployment-v1
labels:
version: v1
spec:
replicas: 1
selector:
Expand All @@ -11,10 +13,36 @@ spec:
metadata:
labels:
app: ui-app
version: v1
spec:
containers:
- name: ui
image: adiselv/captivate.ui:0.0.2
imagePullPolicy: Always
ports:
- containerPort: 3000

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ui-deployment-v2
labels:
version: v2
spec:
replicas: 1
selector:
matchLabels:
app: ui-app
template:
metadata:
labels:
app: ui-app
version: v2
spec:
containers:
- name: ui
image: shubhangis91/captivate-ui-v2:v2.0
imagePullPolicy: Always
ports:
- containerPort: 3000
30 changes: 29 additions & 1 deletion deployments/ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ui-deployment
name: ui-deployment-v1
labels:
version: v1
spec:
replicas: 1
selector:
Expand All @@ -25,6 +27,7 @@ spec:
metadata:
labels:
app: ui-app
version: v1
spec:
containers:
- name: ui
Expand All @@ -33,3 +36,28 @@ spec:
ports:
- containerPort: 3000

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: ui-deployment-v2
labels:
version: v2
spec:
replicas: 1
selector:
matchLabels:
app: ui-app
template:
metadata:
labels:
app: ui-app
version: v2
spec:
containers:
- name: ui
image: shubhangis91/captivate-ui-v2:v2.0
imagePullPolicy: Always
ports:
- containerPort: 3000
48 changes: 48 additions & 0 deletions deployments/virtual-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ui-service
spec:
  hosts: ui-app
  gateways: api-gateway
  http:
  - route:
    - destination:
        host: ui-app
        subset: v1
     weight: 80
    - destination:
        host: ui-app
        subset: v2
     weight: 20
---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: session-management
spec:
  hosts:
  - session-management
  gateways:
  - captivate-gateway
  http:
  - route:
    - destination:
        host: session-management

---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: user-management
spec:
  hosts:
  - user-management
  gateways:
  - captivate-gateway
  http:
  - route:
    - destination:
        host: user-management
Comment on lines +20 to +48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know why we need these ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed if we don't want to define traffic rules for these services