First version of service exposure
[nonrtric.git] / service-exposure / charts / rapp-invoker / 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-invoker.fullname" . }}
26   labels:
27     {{- include "rapp-invoker.labels" . | nindent 4 }}
28 spec:
29   {{- if not .Values.autoscaling.enabled }}
30   replicas: {{ .Values.replicaCount }}
31   {{- end }}
32   selector:
33     matchLabels:
34       {{- include "rapp-invoker.selectorLabels" . | nindent 6 }}
35   template:
36     metadata:
37       {{- with .Values.podAnnotations }}
38       annotations:
39         {{- toYaml . | nindent 8 }}
40       {{- end }}
41       labels:
42         {{- include "rapp-invoker.selectorLabels" . | nindent 8 }}
43     spec:
44       {{- with .Values.imagePullSecrets }}
45       imagePullSecrets:
46         {{- toYaml . | nindent 8 }}
47       {{- end }}
48       serviceAccountName: {{ include "rapp-invoker.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           command: ["/app/rapps-rapp-invoker"]
58           args: [
59                   "-securityEnabled", "{{ .Values.rapp.securityEnabled }}",
60                   "-role",  "{{ with index .Values.rapp.roles 0 }}{{ .role }}{{ end }}",
61                   "-rapp", "{{ with index .Values.rapp.apps 0 }}{{ .prefix }}{{ end }}",
62                   "-methods", "{{- range .Values.rapp.apps }}{{ join "," .methods }}{{- end }}"
63                 ]
64           ports:
65             - name: http
66               containerPort: 9000
67               protocol: TCP
68           livenessProbe:
69             httpGet:
70               path: /health
71               port: 9000 
72             initialDelaySeconds: 5 
73             periodSeconds: 60
74           readinessProbe:
75               exec:
76                 command: ["stat", "init.txt"]
77           resources:
78             {{- toYaml .Values.resources | nindent 12 }}
79       {{- with .Values.nodeSelector }}
80       nodeSelector:
81         {{- toYaml . | nindent 8 }}
82       {{- end }}
83       {{- with .Values.affinity }}
84       affinity:
85         {{- toYaml . | nindent 8 }}
86       {{- end }}
87       {{- with .Values.tolerations }}
88       tolerations:
89         {{- toYaml . | nindent 8 }}
90       {{- end }}