-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeployment.yaml
165 lines (164 loc) · 3.81 KB
/
deployment.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
# order-pizza service in exercise namespace
apiVersion: v1
kind: Service
metadata:
labels:
app: order-pizza-svc
name: order-pizza-svc
namespace: exercise
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: order-pizza
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: order-pizza
name: order-pizza
namespace: exercise
spec:
replicas: 2
selector:
matchLabels:
app: order-pizza
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 25%
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
labels:
app: order-pizza
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: cloud.google.com/gke-nodepool
operator: In
values:
- app-pool
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- order-pizza
topologyKey: kubernetes.io/hostname
containers:
- env:
- name: AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: wadexu007/exercise-pizza:1.0.6
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 5
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 40
timeoutSeconds: 3
name: app
ports:
- containerPort: 8080
name: http
readinessProbe:
failureThreshold: 5
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 20
timeoutSeconds: 3
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 200m
memory: 256Mi
securityContext:
allowPrivilegeEscalation: false
volumeMounts:
- name: config-volume
mountPath: /app/conf/config.json
subPath: config.json
# - mountPath: /data
# name: gcp-filestore-test
volumes:
- name: config-volume
configMap:
name: order-pizza-exercise-config
# - name: gcp-filestore-test
# persistentVolumeClaim:
# claimName: gcp-filestore-test-claim
# readOnly: false
tolerations:
- effect: NoSchedule
key: app
operator: Equal
value: "true"
terminationGracePeriodSeconds: 20
---
# # pv
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: gcp-filestore-test
# spec:
# capacity:
# storage: 10Gi
# accessModes:
# - ReadWriteMany
# nfs:
# path: /u01
# server: 10.127.2.106
# ---
# # pvc
# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: gcp-filestore-test-claim
# namespace: exercise
# spec:
# # Specify "" as the storageClassName so it matches the PersistentVolume's StorageClass.
# # A nil storageClassName value uses the default StorageClass. For details, see
# # https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
# accessModes:
# - ReadWriteMany
# storageClassName: ""
# volumeName: gcp-filestore-test
# resources:
# requests:
# storage: 10Gi
---
apiVersion: v1
kind: ConfigMap
data:
config.json: |-
{
"FILE_PATH": "/data/test/",
"LOG_LEVEL": "INFO",
"DB_HOST": "127.0.0.1",
"DB_NAME": "test"
}
metadata:
name: order-pizza-exercise-config
namespace: exercise