First version of service exposure
[nonrtric.git] / service-exposure / charts / rapp-provider / templates / deployment.yaml
1 {{/*
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2022 Nordix Foundation.
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 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20 #
21 */}}
22 apiVersion: apps/v1
23 kind: Deployment
24 metadata:
25   name: {{ include "rapp-provider.fullname" . }}
26   labels:
27     {{- include "rapp-provider.labels" . | nindent 4 }}
28 spec:
29   {{- if not .Values.autoscaling.enabled }}
30   replicas: {{ .Values.replicaCount }}
31   {{- end }}
32   selector:
33     matchLabels:
34       {{- include "rapp-provider.selectorLabels" . | nindent 6 }}
35   template:
36     metadata:
37       {{- with .Values.podAnnotations }}
38       annotations:
39         {{- toYaml . | nindent 8 }}
40       {{- end }}
41       labels:
42         {{- include "rapp-provider.selectorLabels" . | nindent 8 }}
43     spec:
44       {{- with .Values.imagePullSecrets }}
45       imagePullSecrets:
46         {{- toYaml . | nindent 8 }}
47       {{- end }}
48       serviceAccountName: {{ include "rapp-provider.serviceAccountName" . }}
49       securityContext:
50         {{- toYaml .Values.podSecurityContext | nindent 8 }}
51       containers:
52         - name: {{ .Chart.Name }}
53           securityContext:
54             {{- toYaml .Values.securityContext | nindent 12 }}
55           image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
56           imagePullPolicy: {{ .Values.image.pullPolicy }}
57           ports:
58             - name: http
59               containerPort: 9000 
60               protocol: TCP
61           livenessProbe:
62             httpGet:
63               path: /
64               port: http
65           readinessProbe:
66             httpGet:
67               path: /
68               port: http
69           resources:
70             {{- toYaml .Values.resources | nindent 12 }}
71       {{- with .Values.nodeSelector }}
72       nodeSelector:
73         {{- toYaml . | nindent 8 }}
74       {{- end }}
75       {{- with .Values.affinity }}
76       affinity:
77         {{- toYaml . | nindent 8 }}
78       {{- end }}
79       {{- with .Values.tolerations }}
80       tolerations:
81         {{- toYaml . | nindent 8 }}
82       {{- end }}