X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=otf-robot-test-head%2Fhelm%2Fotf-robot-test-head%2Ftemplates%2Fdeployment.yaml;fp=otf-robot-test-head%2Fhelm%2Fotf-robot-test-head%2Ftemplates%2Fdeployment.yaml;h=70d6e4ce3c7b09c878592bdf21701b484ec8407d;hp=0000000000000000000000000000000000000000;hb=f49bd1efeaaddd4891c1f329b18d8cfb28b3e75b;hpb=5d8b2580c97e466f9c5a6c78693c24277d94244c diff --git a/otf-robot-test-head/helm/otf-robot-test-head/templates/deployment.yaml b/otf-robot-test-head/helm/otf-robot-test-head/templates/deployment.yaml new file mode 100644 index 0000000..70d6e4c --- /dev/null +++ b/otf-robot-test-head/helm/otf-robot-test-head/templates/deployment.yaml @@ -0,0 +1,151 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Values.appName}} + namespace: {{.Values.namespace}} + labels: + app: {{ .Values.appName}} + version: {{.Values.version}} +spec: + revisionHistoryLimit: 1 + minReadySeconds: 10 + strategy: + # indicate which strategy we want for rolling update + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + replicas: {{ .Values.replicas}} + selector: + matchLabels: + app: {{ .Values.appName}} + version: {{.Values.version}} + template: + metadata: + labels: + app: {{ .Values.appName}} + version: {{.Values.version}} + spec: + serviceAccount: default + volumes: + - name: {{ .Values.appName}}-cert-volume + secret: + secretName: {{.Values.sharedCert}} + optional: true + items: + - key: PEM_CERT + path: otf.pem + - key: PEM_KEY + path: privateKey.pem + {{ if or (eq .Values.env "st") (eq .Values.env "prod-dr")}} + {{else}} + - name: logging-pvc + persistentVolumeClaim: + {{if eq .Values.env "prod"}} + claimName: {{ .Values.pvc.prod | quote }} + {{ else }} + claimName: {{ .Values.pvc.dev | quote }} + {{ end }} + {{end}} + containers: + - name: {{ .Values.appName}} + image: {{ .Values.image}} + imagePullPolicy: Always + ports: + - name: http + containerPort: 5000 + nodePort: {{.Values.nodePort}} + protocol: TCP + env: + - name: NAMESPACE + value: {{.Values.namespace}} + - name: APP_NAME + value: {{ .Values.appName}} + - name: APP_VERSION + value: {{.Values.version}} + - name: OTF_MONGO_HOSTS + {{ if or (eq .Values.env "prod") (eq .Values.env "prod-dr")}} + value: {{ .Values.mongo.prod.OTF_MONGO_HOSTS | quote}} + {{ else if eq .Values.env "st" }} + value: {{ .Values.mongo.st.OTF_MONGO_HOSTS | quote}} + {{ else }} + value: {{ .Values.mongo.dev.OTF_MONGO_HOSTS | quote}} + {{ end }} + - name: OTF_MONGO_DATABASE + {{ if or (eq .Values.env "prod") (eq .Values.env "prod-dr")}} + value: {{ .Values.mongo.prod.OTF_MONGO_DBOTF | quote }} + {{ else if eq .Values.env "st" }} + value: {{ .Values.mongo.st.OTF_MONGO_DBOTF | quote }} + {{ else }} + value: {{ .Values.mongo.dev.OTF_MONGO_DBOTF | quote }} + {{ end }} + - name: OTF_MONGO_REPLICASET + {{ if or (eq .Values.env "prod") (eq .Values.env "prod-dr")}} + value: {{ .Values.mongo.prod.OTF_MONGO_REPLICASET | quote }} + {{ else if eq .Values.env "st" }} + value: {{ .Values.mongo.st.OTF_MONGO_REPLICASET | quote }} + {{ else }} + value: {{ .Values.mongo.dev.OTF_MONGO_REPLICASET | quote }} + {{ end }} + - name: OTF_MONGO_USERNAME + valueFrom: + secretKeyRef: + name: {{ .Values.appName}} + key: mongo_username + optional: true + - name: OTF_MONGO_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.appName}} + key: mongo_password + optional: true + - name: APP_SETTINGS + value: {{ .Values.robot.APP_SETTINGS | quote }} + {{ if eq .Values.env "st"}} + resources: + limits: + memory: "2Gi" + cpu: "1" + requests: + memory: "1Gi" + cpu: "500m" + {{else}} + resources: + limits: + memory: "4Gi" + cpu: "2" + requests: + memory: "1Gi" + cpu: "1" + {{end}} + volumeMounts: + - name: {{.Values.appName}}-cert-volume + mountPath: /opt/cert + {{ if or (eq .Values.env "st") (eq .Values.env "prod-dr")}} + {{else}} + - name: logging-pvc + mountPath: "/otf/logs" + {{end}} + livenessProbe: + httpGet: + path: {{.Values.health}} + port: http + scheme: HTTPS + httpHeaders: + - name: X-Custom-Header + value: Alive + initialDelaySeconds: 30 + timeoutSeconds: 30 + periodSeconds: 30 + readinessProbe: + httpGet: + path: {{.Values.health}} + port: http + scheme: HTTPS + httpHeaders: + - name: X-Custom-Header + value: Ready + initialDelaySeconds: 30 + timeoutSeconds: 30 + periodSeconds: 30 + restartPolicy: Always