Istio canary deployments

This commit is contained in:
Stefan Prodan
2018-04-11 15:27:41 +01:00
parent e4c765160a
commit d4882b4212
8 changed files with 284 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: podinfo-canary
labels:
app: podinfo
release: canary
spec:
replicas: 2
selector:
matchLabels:
app: podinfo
release: canary
template:
metadata:
labels:
app: podinfo
release: canary
annotations:
prometheus.io/scrape: 'true'
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:0.2.2
imagePullPolicy: Always
command:
- ./podinfo
- -port=9898
- -debug=true
ports:
- name: http
containerPort: 9898
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: 9898
initialDelaySeconds: 1
periodSeconds: 5
failureThreshold: 1
livenessProbe:
httpGet:
path: /healthz
port: 9898
initialDelaySeconds: 1
periodSeconds: 10
failureThreshold: 2
resources:
requests:
memory: "32Mi"
cpu: "10m"
+22
View File
@@ -0,0 +1,22 @@
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
name: podinfo-canary
namespace: default
spec:
precedence: 2
match:
request:
headers:
x-user:
regex: .*insider.*
# exact: insider
destination:
name: podinfo
route:
- labels:
release: canary
weight: 50
- labels:
release: canaryb
weight: 50
+52
View File
@@ -0,0 +1,52 @@
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: podinfo-canaryb
labels:
app: podinfo
release: canaryb
spec:
replicas: 2
selector:
matchLabels:
app: podinfo
release: canaryb
template:
metadata:
labels:
app: podinfo
release: canaryb
annotations:
prometheus.io/scrape: 'true'
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:0.2.0
imagePullPolicy: Always
command:
- ./podinfo
- -port=9898
- -debug=true
ports:
- name: http
containerPort: 9898
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: 9898
initialDelaySeconds: 1
periodSeconds: 5
failureThreshold: 1
livenessProbe:
httpGet:
path: /healthz
port: 9898
initialDelaySeconds: 1
periodSeconds: 10
failureThreshold: 2
resources:
requests:
memory: "32Mi"
cpu: "10m"
+52
View File
@@ -0,0 +1,52 @@
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: podinfo-ga
labels:
app: podinfo
release: ga
spec:
replicas: 2
selector:
matchLabels:
app: podinfo
release: ga
template:
metadata:
labels:
app: podinfo
release: ga
annotations:
prometheus.io/scrape: 'true'
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:0.2.1
imagePullPolicy: Always
command:
- ./podinfo
- -port=9898
- -debug=true
ports:
- name: http
containerPort: 9898
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: 9898
initialDelaySeconds: 1
periodSeconds: 5
failureThreshold: 1
livenessProbe:
httpGet:
path: /healthz
port: 9898
initialDelaySeconds: 1
periodSeconds: 10
failureThreshold: 2
resources:
requests:
memory: "32Mi"
cpu: "10m"
+18
View File
@@ -0,0 +1,18 @@
---
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
name: podinfo-ga
namespace: default
spec:
match:
request:
headers:
x-user:
regex: .*
destination:
name: podinfo
route:
- labels:
release: ga
weight: 100
+57
View File
@@ -0,0 +1,57 @@
#---
#apiVersion: networking.istio.io/v1alpha3
#kind: Gateway
#metadata:
# name: podinfo-gateway
#spec:
# selector:
# app: podinfo
# servers:
# - port:
# number: 9898
# name: http
# hosts:
# - podinfo.test
#---
#apiVersion: networking.istio.io/v1alpha3
#kind: VirtualService
#metadata:
# name: podinfo
#spec:
# hosts:
# - podinfo
# http:
# - match:
# - headers:
# x-user:
# exact: insider
# route:
# - destination:
# name: podinfo-canary
# subset: canary
# - route:
# - destination:
# name: podinfo-ga
# subset: ga
#---
#apiVersion: networking.istio.io/v1alpha3
#kind: DestinationRule
#metadata:
# name: podinfo-ga
#spec:
# name: podinfo-ga
# subsets:
# - name: ga
# labels:
# release: ga
#---
#apiVersion: networking.istio.io/v1alpha3
#kind: DestinationRule
#metadata:
# name: podinfo-canary
#spec:
# name: podinfo-canary
# subsets:
# - name: canary
# labels:
# release: canary
+15
View File
@@ -0,0 +1,15 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: podinfo
annotations:
kubernetes.io/ingress.class: istio
spec:
rules:
- host: podinfo.test
http:
paths:
- path: /.*
backend:
serviceName: podinfo
servicePort: 9898
+16
View File
@@ -0,0 +1,16 @@
---
apiVersion: v1
kind: Service
metadata:
name: podinfo
labels:
app: podinfo
spec:
type: NodePort
ports:
- name: http
port: 9898
targetPort: http
protocol: TCP
selector:
app: podinfo