Add jenkins charts
[it/dep.git] / smo-install / tests_oom / ru-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, $ru := .Values.rus }}
16 ---
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata:
20   name: {{ $ru.name }}
21   labels:
22     sim-name: {{ $ru.name }}
23     release: {{ $.Release.Name }}
24     chart: {{ $.Chart.Name }}
25 spec:
26   replicas: 1
27   selector:
28     matchLabels:
29       sim-name: {{ $ru.name }}
30   template:
31     metadata:
32       labels:
33         sim-name: {{ $ru.name }}
34         release: {{ $.Release.Name }}
35         chart: {{ $.Chart.Name }}
36       annotations:
37         checksum/config: {{ print $ru | sha256sum }}
38     spec:
39       hostname: "{{ $ru.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: {{ $ru.name }}-configmapenv
49           volumeMounts:
50             - name: {{ $ru.name }}-config-volume
51               subPath: config.json
52               mountPath: /opt/dev/ntsim-ng/config/config.json
53             - name: {{ $ru.name }}-config-volume
54               subPath: ietf-hardware-operational.json
55               mountPath: /opt/dev/deploy/data/ietf-hardware-operational.json
56             - name: {{ $ru.name }}-config-volume
57               subPath: ietf-hardware-running.json
58               mountPath: /opt/dev/deploy/data/ietf-hardware-running.json
59             - name: {{ $ru.name }}-config-volume
60               subPath: ietf-interfaces-operational.xml
61               mountPath: /opt/dev/deploy/data/ietf-interfaces-operational.xml
62             - name: {{ $ru.name }}-config-volume
63               subPath: ietf-interfaces-running.xml
64               mountPath: /opt/dev/deploy/data/ietf-interfaces-running.xml
65           securityContext:
66             capabilities:
67               add:
68                 - SYS_ADMIN
69                 - SYS_PTRACE
70       volumes:
71         - name: {{ $ru.name }}-config-volume
72           configMap:
73             name: {{ $ru.name }}-configmap
74             items:
75               - key: config.json
76                 path: config.json
77               - key: ietf-hardware-operational.json
78                 path: ietf-hardware-operational.json
79               - key: ietf-hardware-running.json
80                 path: ietf-hardware-running.json
81               - key: ietf-interfaces-operational.xml
82                 path: ietf-interfaces-operational.xml
83               - key: ietf-interfaces-running.xml
84                 path: ietf-interfaces-running.xml
85
86
87 {{- end }}