diff --git a/deployments/destination-rules.yaml b/deployments/destination-rules.yaml new file mode 100644 index 0000000..18d1db7 --- /dev/null +++ b/deployments/destination-rules.yaml @@ -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 \ No newline at end of file diff --git a/deployments/gateway-istio.yaml b/deployments/gateway-istio.yaml new file mode 100644 index 0000000..38b1251 --- /dev/null +++ b/deployments/gateway-istio.yaml @@ -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 \ No newline at end of file diff --git a/deployments/ui-vm.yaml b/deployments/ui-vm.yaml index a240c7a..c41f077 100644 --- a/deployments/ui-vm.yaml +++ b/deployments/ui-vm.yaml @@ -1,7 +1,9 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: ui-deployment + name: ui-deployment-v1 + labels: + version: v1 spec: replicas: 1 selector: @@ -11,6 +13,7 @@ spec: metadata: labels: app: ui-app + version: v1 spec: containers: - name: ui @@ -18,3 +21,28 @@ spec: 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 \ No newline at end of file diff --git a/deployments/ui.yaml b/deployments/ui.yaml index 934ca7b..7a97c3b 100644 --- a/deployments/ui.yaml +++ b/deployments/ui.yaml @@ -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: @@ -25,6 +27,7 @@ spec: metadata: labels: app: ui-app + version: v1 spec: containers: - name: ui @@ -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 diff --git a/deployments/virtual-services.yaml b/deployments/virtual-services.yaml new file mode 100644 index 0000000..adba9dd --- /dev/null +++ b/deployments/virtual-services.yaml @@ -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 \ No newline at end of file diff --git a/docs/kiali.PNG b/docs/kiali.PNG new file mode 100644 index 0000000..366d08b Binary files /dev/null and b/docs/kiali.PNG differ