Add new tests to validate O1
[it/dep.git] / smo-install / oran_oom / du-simulator / templates / deployment.yaml
1 # Copyright © 2021-2022 AT&T Intellectual Property
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 {{- range $i, $du := .Values.dus }}
16 ---
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata:
20   name: {{ $du.name }}
21   labels:
22     sim-name: {{ $du.name }}
23     release: {{ $.Release.Name }}
24     chart: {{ $.Chart.Name }}
25 spec:
26   replicas: 1
27   selector:
28     matchLabels:
29       sim-name: {{ $du.name }}
30   template:
31     metadata:
32       labels:
33         sim-name: {{ $du.name }}
34         release: {{ $.Release.Name }}
35         chart: {{ $.Chart.Name }}
36       annotations:
37         checksum/config: {{ print $du | sha256sum }}
38     spec:    
39       hostname: "{{ $du.name }}"
40       containers:
41         - name: {{ $.Chart.Name }}
42           image: "{{ $.Values.image.repository }}/{{ $.Values.image.name}}:{{ $.Values.image.tag }}"
43           imagePullPolicy: {{ $.Values.image.pullPolicy }}
44           tty: true
45           stdin: true
46           envFrom:
47             - configMapRef:
48                 name: {{ $du.name }}-configmapenv
49           volumeMounts:
50             - name: {{ $du.name }}-config-volume
51               subPath: config.json
52               mountPath: /opt/dev/ntsim-ng/config/config.json
53             - name: {{ $du.name }}-config-volume
54               subPath: o-ran-sc-du-hello-world-running.xml
55               mountPath: /opt/dev/deploy/data/o-ran-sc-du-hello-world-running.xml
56             - name: {{ $du.name }}-config-volume
57               subPath: o-ran-sc-du-hello-world-operational.xml
58               mountPath: /opt/dev/deploy/data/o-ran-sc-du-hello-world-operational.xml
59           securityContext:
60             capabilities:
61               add:
62                 - SYS_ADMIN
63                 - SYS_PTRACE
64       volumes: 
65         - name: {{ $du.name }}-config-volume
66           configMap:
67             name: {{ $du.name }}-configmap
68             items:
69               - key: config.json
70                 path: config.json
71               - key: o-ran-sc-du-hello-world-running.xml
72                 path: o-ran-sc-du-hello-world-running.xml
73               - key: o-ran-sc-du-hello-world-operational.xml
74                 path: o-ran-sc-du-hello-world-operational.xml
75
76 {{- end }}