Add canary test workloads

This commit is contained in:
Stefan Prodan
2018-09-21 19:24:35 +03:00
parent 4384ae869f
commit 19e7ae2fef
6 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: podinfo-canary
namespace: test
labels:
app: podinfo-canary
spec:
replicas: 3
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
app: podinfo-canary
template:
metadata:
annotations:
prometheus.io/scrape: "true"
labels:
app: podinfo-canary
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:1.2.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9898
name: http
protocol: TCP
command:
- ./podinfo
- --port=9898
- --level=info
- --random-delay=false
- --random-error=false
env:
- name: PODINFO_UI_COLOR
value: green
livenessProbe:
exec:
command:
- podcli
- check
- http
- localhost:9898/healthz
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
exec:
command:
- podcli
- check
- http
- localhost:9898/readyz
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
requests:
cpu: 1m
memory: 16Mi
volumeMounts:
- mountPath: /data
name: data
volumes:
- emptyDir: {}
name: data

View File

@@ -0,0 +1,75 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: podinfo
namespace: test
annotations:
apps.weave.works/progressive: "true"
labels:
app: podinfo
spec:
replicas: 2
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
app: podinfo
template:
metadata:
annotations:
prometheus.io/scrape: "true"
labels:
app: podinfo
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:1.1.1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9898
name: http
protocol: TCP
command:
- ./podinfo
- --port=9898
- --level=info
- --random-delay=false
- --random-error=false
env:
- name: PODINFO_UI_COLOR
value: blue
livenessProbe:
exec:
command:
- podcli
- check
- http
- localhost:9898/healthz
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
exec:
command:
- podcli
- check
- http
- localhost:9898/readyz
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
requests:
cpu: 1m
memory: 16Mi
volumeMounts:
- mountPath: /data
name: data
volumes:
- emptyDir: {}
name: data

View File

@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: test
labels:
istio-injection: enabled

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: podinfo-canary
namespace: test
labels:
app: podinfo-canary
spec:
type: ClusterIP
selector:
app: podinfo-canary
ports:
- name: http
port: 9898
protocol: TCP
targetPort: http

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: podinfo
namespace: test
labels:
app: podinfo
spec:
type: ClusterIP
selector:
app: podinfo
ports:
- name: http
port: 9898
protocol: TCP
targetPort: http

View File

@@ -0,0 +1,29 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
annotations:
apps.weave.works/canary-revision: ""
apps.weave.works/canary-status: ""
labels:
app: podinfo
name: podinfo
namespace: test
spec:
gateways:
- public-gateway.istio-system.svc.cluster.local
hosts:
- app.istio.weavedx.com
- podinfo
http:
- route:
- destination:
host: podinfo
port:
number: 9898
weight: 100
- destination:
host: podinfo-canary
port:
number: 9898
weight: 0
timeout: 30s