ec08ac39be9d4013a7a71b31375d605715eeb35a
[it/otf.git] / a1-sdnc-vth / helm / a1-sdnc-vth / 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       serviceAccount: default\r
30       volumes:\r
31       - name: {{ .Values.appName}}-cert-volume\r
32         secret:\r
33           secretName: {{.Values.sharedCert}}\r
34           optional: true\r
35           items:\r
36           - key: PEM_CERT\r
37             path: otf.pem\r
38           - key: PEM_KEY\r
39             path: privateKey.pem\r
40 #      {{ if or (eq .Values.env "st") (eq .Values.env "prod-dr")}} TODO UNCOMMENT WHEN PUSHING TO ORAN\r
41 #      {{else}}\r
42 #      - name: logging-pvc\r
43 #        persistentVolumeClaim:\r
44 #          {{if eq .Values.env "prod"}}\r
45 #          claimName: {{ .Values.pvc.prod | quote }}\r
46 #          {{ else }}\r
47 #          claimName: {{ .Values.pvc.dev | quote }}\r
48 #          {{ end }}\r
49 #      {{end}}\r
50       containers:\r
51       - name: {{ .Values.appName}}\r
52         image: {{ .Values.image}}\r
53         imagePullPolicy: Always\r
54         ports:\r
55         - name: http\r
56           containerPort: 6001\r
57           nodePort: {{.Values.nodePort}}\r
58           protocol: TCP\r
59 #        {{ if eq .Values.env "st"}} TODO UNCOMMENT FOR ORAN?\r
60 #        resources:\r
61 #          limits:\r
62 #            memory: "512Mi"\r
63 #            cpu: "500m"\r
64 #          requests:\r
65 #            memory: "256Mi"\r
66 #            cpu: "100m"\r
67 #        {{else}}\r
68 #        resources:\r
69 #          limits:\r
70 #            memory: "1Gi"\r
71 #            cpu: "1"\r
72 #          requests:\r
73 #            memory: "1Gi"\r
74 #            cpu: "1"\r
75 #        {{end}}\r
76         env:\r
77         - name: NAMESPACE\r
78           value: {{.Values.namespace}}\r
79         - name: APP_NAME\r
80           value: {{ .Values.appName}}\r
81         - name: APP_VERSION\r
82           value: {{.Values.version}}\r
83         - name: USE_CRED\r
84           value: {{.Values.auth.enabled | quote }}\r
85         - name: USER\r
86           valueFrom:\r
87             secretKeyRef:\r
88               name: {{ .Values.appName}}\r
89               key: api_user\r
90               optional: true\r
91         - name: PW\r
92           valueFrom:\r
93             secretKeyRef:\r
94               name: {{ .Values.appName}}\r
95               key: api_pass\r
96               optional: true\r
97         - name: USE_PROXY\r
98           value: {{.Values.proxy.enabled | quote }}\r
99         - name: HTTPS\r
100           value: {{.Values.proxy.https | quote }}\r
101         - name: HTTP\r
102           value: {{.Values.proxy.http | quote }}\r
103         - name: API_URL\r
104           value: {{.Values.api.base_url}}\r
105         - name: API_PORT\r
106           value: {{.Values.api.port | quote }}\r
107         volumeMounts:\r
108         - name: {{.Values.appName}}-cert-volume\r
109           mountPath: /opt/cert\r
110 #        {{ if or (eq .Values.env "st") (eq .Values.env "prod-dr")}}\r
111 #        {{else}}\r
112 #        - name: logging-pvc\r
113 #          mountPath: "/otf/logs"\r
114 #        {{end}}\r
115         livenessProbe:\r
116           httpGet:\r
117             path: {{.Values.health}}\r
118             port: http\r
119             scheme: HTTP\r
120             httpHeaders:\r
121               - name: X-Custom-Header\r
122                 value: Alive\r
123           initialDelaySeconds: 30\r
124           timeoutSeconds: 30\r
125           periodSeconds: 30\r
126         readinessProbe:\r
127           httpGet:\r
128             path: {{.Values.health}}\r
129             port: http\r
130             scheme: HTTP\r
131             httpHeaders:\r
132               - name: X-Custom-Header\r
133                 value: Ready\r
134           initialDelaySeconds: 30\r
135           timeoutSeconds: 30\r
136           periodSeconds: 30\r
137       restartPolicy: Always\r