Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / oof / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications Copyright © 2018 AT&T,VMware
4 # Modifications Copyright (C) 2020 Wipro Limited.
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 */}}
18
19 apiVersion: apps/v1
20 kind: Deployment
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
22 spec:
23   selector: {{- include "common.selectors" . | nindent 4 }}
24   replicas: {{ .Values.replicaCount }}
25   template:
26     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
27     spec:
28       initContainers:
29       {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
30       containers:
31         - name: {{ include "common.name" . }}
32           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
33           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
34           command:
35           - /bin/sh
36           args:
37           - "-c"
38           - |
39             python osdfapp.py
40           ports:
41           - containerPort: {{ .Values.service.internalPort }}
42             name: http
43           # disable liveness probe when breakpoints set in debugger
44           # so K8s doesn't restart unresponsive container
45           {{- if .Values.liveness.enabled }}
46           livenessProbe:
47             tcpSocket:
48               port: {{ .Values.service.internalPort }}
49             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
50             periodSeconds: {{ .Values.liveness.periodSeconds }}
51           {{ end -}}
52           readinessProbe:
53             tcpSocket:
54               port: {{ .Values.service.internalPort }}
55             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
56             periodSeconds: {{ .Values.readiness.periodSeconds }}
57           env:
58           volumeMounts:
59           - mountPath: /opt/osdf/config/osdf_config.yaml
60             name: {{ include "common.fullname" . }}-config
61             subPath: osdf_config.yaml
62           - mountPath: /opt/osdf/config/common_config.yaml
63             name: {{ include "common.fullname" . }}-config
64             subPath: common_config.yaml
65           - mountPath: /opt/osdf/config/log.yml
66             name: {{ include "common.fullname" . }}-config
67             subPath: log.yml
68           - mountPath: /opt/osdf/config/slicing_config.yaml
69             name: {{ include "common.fullname" . }}-config
70             subPath: slicing_config.yaml
71           resources: {{ include "common.resources" . | nindent 12 }}
72         {{- if .Values.nodeSelector }}
73         nodeSelector:
74 {{ toYaml .Values.nodeSelector | indent 10 }}
75         {{- end -}}
76         {{- if .Values.affinity }}
77         affinity:
78 {{ toYaml .Values.affinity | indent 10 }}
79         {{- end }}
80       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
81       volumes:
82         - name: {{ include "common.fullname" . }}-config
83           configMap:
84             name: {{ include "common.fullname" . }}-configmap
85             items:
86             - key: osdf_config.yaml
87               path: osdf_config.yaml
88             - key: common_config.yaml
89               path: common_config.yaml
90             - key: log.yml
91               path: log.yml
92             - key: slicing_config.yaml
93               path: slicing_config.yaml
94       {{- include "common.imagePullSecrets" . | nindent 6 }}