-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblue-green-app.yaml
92 lines (92 loc) · 1.63 KB
/
blue-green-app.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
apiVersion: v1
kind: Namespace
metadata:
name: blue-green-ns
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: green-app
namespace: blue-green-ns
labels:
app: green-app
spec:
selector:
matchLabels:
app: green-app
replicas: 2
template:
metadata:
labels:
app: green-app
spec:
containers:
- name: green-container
image: public.ecr.aws/e1x6y8e1/green:latest
ports:
- containerPort: 80
resources:
limits:
memory: "100Mi"
cpu: "200m"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: blue-app
namespace: blue-green-ns
labels:
app: blue-app
spec:
selector:
matchLabels:
app: blue-app
replicas: 2
template:
metadata:
labels:
app: blue-app
spec:
containers:
- name: blue-container
image: public.ecr.aws/e1x6y8e1/blue:latest
ports:
- containerPort: 80
resources:
limits:
memory: "100Mi"
cpu: "200m"
---
apiVersion: v1
kind: Service
metadata:
namespace: blue-green-ns
name: green-app-service
labels:
app: green-app
annotations:
alb.ingress.kubernetes.io/healthcheck-path: /green/index.html
spec:
type: NodePort
selector:
app: green-app
ports:
- port: 80
targetPort: 80
---
apiVersion: v1
kind: Service
metadata:
namespace: blue-green-ns
name: blue-app-service
labels:
app: blue-app
annotations:
alb.ingress.kubernetes.io/healthcheck-path: /blue/index.html
spec:
type: NodePort
selector:
app: blue-app
ports:
- port: 80
targetPort: 80