blob: 2e366b851ef0f70a4c0e966997212275a980f048 [file] [log] [blame]
Hyunsun Mooned19c092019-07-10 15:24:45 -06001{{/*
2Copyright 2019-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17{{- $releaseName := .Release.Name }}
18{{- $namespace := .Release.Namespace }}
19{{- $name := .Values.conf.ue.name }}
20---
21apiVersion: v1
22kind: ServiceAccount
23metadata:
24 name: {{ $releaseName }}-{{ $name }}
25 namespace: {{ $namespace }}
26---
27kind: Role
28apiVersion: rbac.authorization.k8s.io/v1
29metadata:
30 name: {{ $releaseName }}-{{ $name }}
31 namespace: {{ $namespace }}
32rules:
33 - apiGroups:
34 - ""
35 - extensions
36 - batch
37 - apps
38 verbs:
39 - get
40 - list
41 resources:
42 - daemonsets
43 - jobs
44 - pods
45 - services
46 - endpoints
47---
48kind: RoleBinding
49apiVersion: rbac.authorization.k8s.io/v1
50metadata:
51 name: {{ $releaseName }}-{{ $name }}
52 namespace: {{ $namespace }}
53roleRef:
54 apiGroup: rbac.authorization.k8s.io
55 kind: Role
56 name: {{ $releaseName }}-{{ $name }}
57subjects:
58 - kind: ServiceAccount
59 name: {{ $releaseName }}-{{ $name }}
60---
61apiVersion: apps/v1
62kind: StatefulSet
63metadata:
64 name: {{ $name }}
65 namespace: {{ $namespace }}
66 labels:
67 app: oai-ue
68spec:
69 replicas: 1
70 selector:
71 matchLabels:
72 app: oai-ue
73 serviceName: {{ $name | quote }}
74 template:
75 metadata:
76 labels:
77 app: oai-ue
78 spec:
79 serviceAccountName: {{ $releaseName }}-{{ $name }}
80 hostNetwork: true
81 initContainers:
82 - name: ue-dep-check
83 image: {{ .Values.images.tags.dep_check | quote }}
84 imagePullPolicy: {{ .Values.images.pullPolicy }}
85 securityContext:
86 allowPrivilegeEscalation: false
87 readOnlyRootFilesystem: false
88 runAsUser: 0
89 env:
90 - name: POD_NAME
91 valueFrom:
92 fieldRef:
93 apiVersion: v1
94 fieldPath: metadata.name
95 - name: NAMESPACE
96 valueFrom:
97 fieldRef:
98 apiVersion: v1
99 fieldPath: metadata.namespace
100 - name: PATH
101 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
102 - name: COMMAND
103 value: "echo done"
104 - name: DEPENDENCY_POD_JSON
105 value: '[{"labels": {"app": "oai-enb"}, "requireSameNode": true}]'
106 command:
107 - kubernetes-entrypoint
108 volumeMounts:
109 []
110 - name: ue-gen-usim
111 image: {{ .Values.images.tags.ue | quote }}
112 imagePullPolicy: {{ .Values.images.pullPolicy }}
113 command:
114 - /opt/oaisim/ue/scripts/ue-gen-usim.sh
115 volumeMounts:
116 - name: script
117 mountPath: /opt/oaisim/ue/scripts/ue-gen-usim.sh
118 subPath: ue-gen-usim.sh
119 - name: config
120 mountPath: /opt/oaisim/ue/config
121 - name: pod-share
122 mountPath: /etc/oaisim/ue
123 - name: ue-init
124 image: {{ .Values.images.tags.ue | quote }}
125 imagePullPolicy: {{ .Values.images.pullPolicy }}
126 securityContext:
127 privileged: true
128 command:
129 - /opt/oaisim/ue/scripts/ue-init.sh
130 volumeMounts:
131 - name: script
132 mountPath: /opt/oaisim/ue/scripts/ue-init.sh
133 subPath: ue-init.sh
134 containers:
135 - name: {{ $name }}
136 image: {{ .Values.images.tags.ue | quote }}
137 imagePullPolicy: {{ .Values.images.pullPolicy }}
138 securityContext:
139 privileged: true
140 command:
141 - /opt/oaisim/ue/scripts/ue-run.sh
142 - start
143 lifecycle:
144 preStop:
145 exec:
146 command:
147 - /opt/oaisim/enb/scripts/ue-run.sh
148 - stop
149 env:
150 - name: UE_LOCAL_IP
151 valueFrom:
152 fieldRef:
153 fieldPath: status.podIP
154 volumeMounts:
155 - name: script
156 mountPath: /opt/oaisim/ue/scripts/ue-run.sh
157 subPath: ue-run.sh
158 - name: config
159 mountPath: /opt/oaisim/ue/config
160 - name: pod-share
161 mountPath: /etc/oaisim/ue
162 volumes:
163 - name: config
164 configMap:
165 name: {{ $name }}
166 defaultMode: 420
167 - name: script
168 configMap:
169 name: {{ $name }}
170 defaultMode: 493
171 - name: pod-share
172 emptyDir: {}