Update port and targetPort in webhook-translator
[osm/devops.git] / installers / helm / osm / templates / webhook_translator / webhook-translator-deployment.yaml
1 {{- if not .Values.global.oldServiceAssurance -}}
2 {{- if .Values.webhookTranslator.enabled -}}
3 #######################################################################################
4 # Copyright ETSI Contributors and Others.
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
15 # implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #######################################################################################
19 apiVersion: apps/v1
20 kind: Deployment
21 metadata:
22   name: webhook-translator
23   labels:
24     {{- include "osm.labels" . | nindent 4 }}
25 spec:
26   replicas: {{ .Values.webhookTranslator.replicaCount | default .Values.global.replicaCount }}
27   selector:
28     matchLabels:
29       app.kubernetes.io/component: webhook-translator
30       {{- include "osm.selectorLabels" . | nindent 6 }}
31   template:
32     metadata:
33       {{- with .Values.global.podAnnotations }}
34       annotations:
35         {{- toYaml . | nindent 8 }}
36       {{- end }}
37       labels:
38         app.kubernetes.io/component: webhook-translator
39         {{- include "osm.selectorLabels" . | nindent 8 }}
40     spec:
41       {{- with .Values.global.imagePullSecrets }}
42       imagePullSecrets:
43         {{- toYaml . | nindent 8 }}
44       {{- end }}
45       serviceAccountName: {{ include "osm.serviceAccountName" . }}
46       securityContext:
47         {{- toYaml .Values.global.podSecurityContext | nindent 8 }}
48       containers:
49         - name: webhook-translator
50           securityContext:
51             readOnlyRootFilesystem: true
52             allowPrivilegeEscalation: false
53             runAsNonRoot: true
54             {{- toYaml .Values.global.securityContext | nindent 12 }}
55           image: {{ include "osm.webhookTranslator.image" . }}
56           imagePullPolicy: {{ .Values.global.image.pullPolicy }}
57           ports:
58             - containerPort: 80
59               protocol: TCP
60           resources:
61             limits:
62               memory: 1024Mi
63             requests:
64               memory: 128Mi
65           envFrom:
66             - configMapRef:
67                 name: {{ include "osm.fullname" . }}-webhook-configmap
68             - secretRef:
69                 name: {{ include "osm.fullname" . }}-webhook-secret
70       {{- with .Values.global.nodeSelector }}
71       nodeSelector:
72         {{- toYaml . | nindent 8 }}
73       {{- end }}
74       {{- with .Values.global.affinity }}
75       affinity:
76         {{- toYaml . | nindent 8 }}
77       {{- end }}
78       {{- with .Values.global.tolerations }}
79       tolerations:
80         {{- toYaml . | nindent 8 }}
81       {{- end }}
82 {{- end }}
83 {{- end }}