forked from ContainerSolutions/k8s-deployment-strategies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-a-v2.yaml
75 lines (74 loc) · 1.49 KB
/
app-a-v2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
apiVersion: v1
kind: Namespace
metadata:
name: ns-bluegreen
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: ns-bluegreen
name: deployment-my-app-a-v2
labels:
app: my-app
spec:
replicas: 2
selector:
matchLabels:
app: my-app-a
version: v2.0.0
template:
metadata:
labels:
app: my-app-a
version: v2.0.0
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9101"
prometheus.io/path: "/metrics"
prometheus.io/scheme: "http"
spec:
terminationGracePeriodSeconds: 100
containers:
- name: my-app-a
image: containersol/k8s-deployment-strategies
ports:
- name: http
containerPort: 8080
- name: probe
containerPort: 8086
env:
- name: VERSION
value: v2.0.0
livenessProbe:
httpGet:
path: /live
port: probe
initialDelaySeconds: 5
periodSeconds: 5
readinessProbe:
httpGet:
path: /ready
port: probe
periodSeconds: 5
lifecycle:
preStop:
exec:
command: ["sleep","90"]
---
apiVersion: v1
kind: Service
metadata:
namespace: ns-bluegreen
name: svc-my-app-a-v2
labels:
app: my-app
spec:
ports:
- name: http
port: 80
targetPort: http
# Note here that we match both the app and the version
selector:
app: my-app-a
version: v2.0.0