Add initial codes
[it/test.git] / test_scripts / subscription / test-subscription-helmchart-1.0.3 / templates / deployment.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17
18
19 apiVersion: apps/v1
20 kind: Deployment
21 metadata:
22   name: adm-ctrl-xapp 
23   labels:
24     app: adm-ctrl-xapp
25     app.kubernetes.io/name: adm-ctrl-xapp 
26     app.kubernetes.io/instance: {{ .Release.Name }}
27     #app.kubernetes.io/managed-by: {{ .Release.Service }}
28     #helm.sh/chart: {{ include "adm-ctrl-xapp.chart" . }}
29 spec:
30   replicas: {{ .Values.replicaCount }}
31   selector:
32     matchLabels:
33        app: adm-ctrl-xapp
34   #    app.kubernetes.io/name: {{ include "adm-ctrl-xapp.name" . }}
35   #    app.kubernetes.io/instance: {{ .Release.Name }}
36   template:
37     metadata:
38       labels:
39         app: adm-ctrl-xapp
40         #app.kubernetes.io/name: {{ include "adm-ctrl-xapp.name" . }}
41         #app.kubernetes.io/instance: {{ .Release.Name }}
42     spec:
43       hostname: adm-ctrl-xapp
44       imagePullSecrets:
45         - name: {{ .Values.imageCredentials.name }}
46       containers:
47         - name: sub-client
48           image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
49           imagePullPolicy: {{ .Values.image.pullPolicy }}
50           restartPolicy: Never
51           ports:
52             - name: xapp-port
53               containerPort: {{ .Values.service.xapp_port}}
54               protocol: TCP
55             - name: rmr-port
56               containerPort: {{ .Values.service.rmr_port}}
57               protocol: TCP
58
59           resources:
60             {{- toYaml .Values.resources | nindent 12 }}
61           #command: ["{{ .Values.xapp.env.run_command }}"]
62           #args: ["-p", "{{ .Values.service.xapp_port}}", "-g", "{{ .Values.xapp.env.gNodeB}}" , "-r", "{{ .Values.xapp.env.start_request_id }}", "-x", "{{ .Values.xapp.env.requests }}", "-t", "{{ .Values.xapp.env.interval }}"]
63           command: [ "/bin/bash", "-c", "--" ]
64           args: [ "while true; do sleep 30; done;" ]
65           env:
66             - name: "RMR_RTG_SVC"
67               value: "127.0.0.1:9995"
68             - name: "THREADS"
69               value: "{{ .Values.xapp.env.threads}}"
70             - name: "RMR_SEED_RT"
71               value: {{ printf "%s/%s" .Values.xapp.env.route_path .Values.xapp.env.route_file }}
72             - name: "DELETE_MODE"
73               value: "{{ .Values.xapp.env.deleteMode}}"
74             - name: "RAN_FUNCTION_ID"
75               value: "{{ .Values.xapp.env.ranFunctionId}}"
76             - name: "ACTION_ID"
77               value: "{{ .Values.xapp.env.actionId }}"
78             - name: "ACTION_TYPE"
79               value: "{{ .Values.xapp.env.actionType }}"
80             - name: "TRIGGER_DEF"
81               value: "{{ .Values.xapp.env.triggerDef }}"
82
83           volumeMounts:
84               - name : rmr-route-info
85                 mountPath: {{ .Values.xapp.env.route_path }} 
86
87       volumes:
88            - name: rmr-route-info 
89              configMap:
90                  name: rmr-configmap-xapp
91                  items:
92                      - key : {{ .Values.xapp.env.route_file }} 
93                        path: {{ .Values.xapp.env.route_file }}
94             
95       {{- with .Values.nodeSelector }}
96       nodeSelector:
97         {{- toYaml . | nindent 8 }}
98       {{- end }}
99     {{- with .Values.affinity }}
100       affinity:
101         {{- toYaml . | nindent 8 }}
102     {{- end }}
103     {{- with .Values.tolerations }}
104       tolerations:
105         {{- toYaml . | nindent 8 }}
106     {{- end }}