blob: c9106857a8a3aa58cf20076ec88c97fe0158b112 [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
Hyunsun Moon10152302019-10-24 20:23:35 -050017{{ tuple "enb" . | include "oaisim.service_account" }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060018---
19apiVersion: apps/v1
20kind: StatefulSet
21metadata:
Hyunsun Moon10152302019-10-24 20:23:35 -050022 name: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -060023 labels:
Hyunsun Moon10152302019-10-24 20:23:35 -050024{{ tuple "enb" . | include "oaisim.metadata_labels" | indent 4 }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060025spec:
26 replicas: 1
Scott Bakeracbd36c2020-09-29 23:35:08 -070027 serviceName: oaisim-enb
Hyunsun Mooned19c092019-07-10 15:24:45 -060028 selector:
29 matchLabels:
Hyunsun Moon10152302019-10-24 20:23:35 -050030{{ tuple "enb" . | include "oaisim.metadata_labels" | indent 6 }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060031 template:
32 metadata:
33 labels:
Hyunsun Moon10152302019-10-24 20:23:35 -050034{{ tuple "enb" . | include "oaisim.metadata_labels" | indent 8 }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060035 spec:
Hyunsun Moon43eadcc2019-08-20 16:16:08 -060036 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.enb.label }}: {{ .Values.nodeSelectors.enb.value }}
39 {{- end }}
Hyunsun Moon10152302019-10-24 20:23:35 -050040 serviceAccountName: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -060041 hostNetwork: true
42 initContainers:
43 - name: enb-dep-check
44 image: {{ .Values.images.tags.dep_check | quote }}
45 imagePullPolicy: {{ .Values.images.pullPolicy }}
46 securityContext:
47 allowPrivilegeEscalation: false
48 readOnlyRootFilesystem: false
49 runAsUser: 0
50 env:
51 - name: POD_NAME
52 valueFrom:
53 fieldRef:
54 apiVersion: v1
55 fieldPath: metadata.name
56 - name: NAMESPACE
57 valueFrom:
58 fieldRef:
59 apiVersion: v1
60 fieldPath: metadata.namespace
61 - name: PATH
62 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
63 - name: COMMAND
64 value: "echo done"
65 - name: DEPENDENCY_POD_JSON
66 value: '[{"labels": {"app": "mme"}, "requireSameNode": false}]'
67 command:
68 - kubernetes-entrypoint
69 volumeMounts:
70 []
71 - name: enb-init
72 image: {{ .Values.images.tags.enb | quote }}
73 imagePullPolicy: {{ .Values.images.pullPolicy }}
74 securityContext:
75 capabilities:
76 add:
77 - NET_ADMIN
78 command:
79 - /opt/oaisim/enb/scripts/enb-init.sh
80 env:
81 - name: ENB_LOCAL_IP
82 valueFrom:
83 fieldRef:
84 fieldPath: status.podIP
85 volumeMounts:
86 - name: script
87 mountPath: /opt/oaisim/enb/scripts/enb-init.sh
88 subPath: enb-init.sh
89 - name: config
90 mountPath: /opt/oaisim/enb/config
91 - name: pod-share
92 mountPath: /etc/oaisim/enb
93 containers:
Hyunsun Moon10152302019-10-24 20:23:35 -050094 - name: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -060095 image: {{ .Values.images.tags.enb | quote }}
96 imagePullPolicy: {{ .Values.images.pullPolicy }}
97 securityContext:
98 privileged: true
99 command:
100 - /opt/oaisim/enb/scripts/enb-run.sh
101 - start
102 lifecycle:
103 preStop:
104 exec:
105 command:
106 - /opt/oaisim/enb/scripts/enb-run.sh
107 - stop
108 env:
109 - name: ENB_LOCAL_IP
110 valueFrom:
111 fieldRef:
112 fieldPath: status.podIP
113 volumeMounts:
114 - name: script
115 mountPath: /opt/oaisim/enb/scripts/enb-run.sh
116 subPath: enb-run.sh
117 - name: pod-share
118 mountPath: /etc/oaisim/enb
119 volumes:
120 - name: config
121 configMap:
Hyunsun Moon10152302019-10-24 20:23:35 -0500122 name: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -0600123 defaultMode: 420
124 - name: script
125 configMap:
Hyunsun Moon10152302019-10-24 20:23:35 -0500126 name: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -0600127 defaultMode: 493
128 - name: pod-share
129 emptyDir: {}