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