updated docker/helm files for svc,ping,robot,ssh, and o1
[it/otf.git] / otf-ssh-test-head / helm / otf-ssh-test-head / templates / deployment.yaml
1 apiVersion: extensions/v1beta1\r
2 kind: Deployment\r
3 metadata:\r
4   name: {{ .Values.appName}}\r
5   namespace: {{.Values.namespace}}\r
6   labels:\r
7     app: {{ .Values.appName}}\r
8     version: {{.Values.version}}\r
9 spec:\r
10   revisionHistoryLimit: 1\r
11   minReadySeconds: 10\r
12   strategy:\r
13   # indicate which strategy we want for rolling update\r
14     type: RollingUpdate\r
15     rollingUpdate:\r
16       maxSurge: 0\r
17       maxUnavailable: 1\r
18   replicas: {{ .Values.replicas}}\r
19   selector:\r
20     matchLabels:\r
21       app: {{ .Values.appName}}\r
22       version: {{.Values.version}}\r
23   template:\r
24     metadata:\r
25       labels:\r
26         app: {{ .Values.appName}}\r
27         version: {{.Values.version}}\r
28     spec:\r
29       {{ if .Values.pullSecret }}\r
30       imagePullSecrets:\r
31         - name: {{ .Values.pullSecret }}\r
32       {{ end }}\r
33       serviceAccount: default\r
34       volumes:\r
35       - name: {{ .Values.appName}}-cert-volume\r
36         secret:\r
37           secretName: {{.Values.sharedCert}}\r
38           optional: true\r
39           items:\r
40           - key: PEM_CERT\r
41             path: otf.pem\r
42           - key: PEM_KEY\r
43             path: privateKey.pem\r
44       - name: {{ .Values.appName}}-ssh-volume\r
45         secret:\r
46           secretName: {{.Values.appName}}\r
47           optional: true\r
48           items:\r
49           - key: id_private_key\r
50             path: id_otf.key\r
51       {{ if or (eq .Values.env "st") (eq .Values.env "prod-dr")}}\r
52       {{else}}\r
53       - name: logging-pvc\r
54         # persistentVolumeClaim:\r
55         #   {{if eq .Values.env "prod"}}\r
56         #   claimName: {{ .Values.pvc.prod | quote }}\r
57         #   {{ else }}\r
58         #   claimName: {{ .Values.pvc.dev | quote }}\r
59         #   {{ end }}\r
60       {{end}}\r
61       containers:\r
62       - name: {{ .Values.appName}}\r
63         image: {{ .Values.image}}\r
64         imagePullPolicy: Always\r
65         ports:\r
66         - name: http\r
67           containerPort: 5000\r
68           # nodePort: {{.Values.nodePort}}\r
69           protocol: TCP\r
70         {{ if eq .Values.env "st"}}\r
71         resources:\r
72           limits: \r
73             memory: "2Gi"\r
74             cpu: "1"\r
75           requests:\r
76             memory: "1Gi"\r
77             cpu: "500m"\r
78         {{else}}   \r
79         resources:\r
80           limits:\r
81             memory: "4Gi"\r
82             cpu: "2"\r
83           requests:\r
84             memory: "1Gi"\r
85             cpu: "1"\r
86         {{end}}\r
87         env:\r
88         - name: NAMESPACE\r
89           value: {{.Values.namespace}}\r
90         - name: APP_NAME\r
91           value: {{ .Values.appName}}\r
92         - name: APP_VERSION\r
93           value: {{.Values.version}}\r
94         - name: id_private_key_passphrase\r
95           valueFrom:\r
96             secretKeyRef:\r
97               name: {{ .Values.appName}}\r
98               key: id_private_key_passphrase\r
99               optional: true\r
100         volumeMounts:\r
101         - name: {{.Values.appName}}-cert-volume\r
102           mountPath: /opt/cert\r
103         - name: {{.Values.appName}}-ssh-volume\r
104           mountPath: /ssh      \r
105         {{ if or (eq .Values.env "st") (eq .Values.env "prod-dr")}}\r
106         {{else}}\r
107         - name: logging-pvc\r
108           mountPath: "/otf/logs"\r
109         {{end}}  \r
110         livenessProbe:\r
111           httpGet:\r
112             path: {{.Values.health}}\r
113             port: http\r
114             scheme: HTTP\r
115             httpHeaders:\r
116               - name: X-Custom-Header\r
117                 value: Alive\r
118           initialDelaySeconds: 30\r
119           timeoutSeconds: 30\r
120           periodSeconds: 30\r
121         readinessProbe:\r
122           httpGet:\r
123             path: {{.Values.health}}\r
124             port: http\r
125             scheme: HTTP\r
126             httpHeaders:\r
127               - name: X-Custom-Header\r
128                 value: Ready\r
129           initialDelaySeconds: 30\r
130           timeoutSeconds: 30\r
131           periodSeconds: 30\r
132       restartPolicy: Always\r