blob: b96a809020b806c6ea37af94af27ca19c7dc2e1c [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
27 selector:
28 matchLabels:
Hyunsun Moon10152302019-10-24 20:23:35 -050029{{ tuple "enb" . | include "oaisim.metadata_labels" | indent 6 }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060030 template:
31 metadata:
32 labels:
Hyunsun Moon10152302019-10-24 20:23:35 -050033{{ tuple "enb" . | include "oaisim.metadata_labels" | indent 8 }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060034 spec:
Hyunsun Moon43eadcc2019-08-20 16:16:08 -060035 {{- if .Values.nodeSelectors.enabled }}
36 nodeSelector:
37 {{ .Values.nodeSelectors.enb.label }}: {{ .Values.nodeSelectors.enb.value }}
38 {{- end }}
Hyunsun Moon10152302019-10-24 20:23:35 -050039 serviceAccountName: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -060040 hostNetwork: true
41 initContainers:
42 - name: enb-dep-check
43 image: {{ .Values.images.tags.dep_check | quote }}
44 imagePullPolicy: {{ .Values.images.pullPolicy }}
45 securityContext:
46 allowPrivilegeEscalation: false
47 readOnlyRootFilesystem: false
48 runAsUser: 0
49 env:
50 - name: POD_NAME
51 valueFrom:
52 fieldRef:
53 apiVersion: v1
54 fieldPath: metadata.name
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 apiVersion: v1
59 fieldPath: metadata.namespace
60 - name: PATH
61 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
62 - name: COMMAND
63 value: "echo done"
64 - name: DEPENDENCY_POD_JSON
65 value: '[{"labels": {"app": "mme"}, "requireSameNode": false}]'
66 command:
67 - kubernetes-entrypoint
68 volumeMounts:
69 []
70 - name: enb-init
71 image: {{ .Values.images.tags.enb | quote }}
72 imagePullPolicy: {{ .Values.images.pullPolicy }}
73 securityContext:
74 capabilities:
75 add:
76 - NET_ADMIN
77 command:
78 - /opt/oaisim/enb/scripts/enb-init.sh
79 env:
80 - name: ENB_LOCAL_IP
81 valueFrom:
82 fieldRef:
83 fieldPath: status.podIP
84 volumeMounts:
85 - name: script
86 mountPath: /opt/oaisim/enb/scripts/enb-init.sh
87 subPath: enb-init.sh
88 - name: config
89 mountPath: /opt/oaisim/enb/config
90 - name: pod-share
91 mountPath: /etc/oaisim/enb
92 containers:
Hyunsun Moon10152302019-10-24 20:23:35 -050093 - name: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -060094 image: {{ .Values.images.tags.enb | quote }}
95 imagePullPolicy: {{ .Values.images.pullPolicy }}
96 securityContext:
97 privileged: true
98 command:
99 - /opt/oaisim/enb/scripts/enb-run.sh
100 - start
101 lifecycle:
102 preStop:
103 exec:
104 command:
105 - /opt/oaisim/enb/scripts/enb-run.sh
106 - stop
107 env:
108 - name: ENB_LOCAL_IP
109 valueFrom:
110 fieldRef:
111 fieldPath: status.podIP
112 volumeMounts:
113 - name: script
114 mountPath: /opt/oaisim/enb/scripts/enb-run.sh
115 subPath: enb-run.sh
116 - name: pod-share
117 mountPath: /etc/oaisim/enb
118 volumes:
119 - name: config
120 configMap:
Hyunsun Moon10152302019-10-24 20:23:35 -0500121 name: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -0600122 defaultMode: 420
123 - name: script
124 configMap:
Hyunsun Moon10152302019-10-24 20:23:35 -0500125 name: enb
Hyunsun Mooned19c092019-07-10 15:24:45 -0600126 defaultMode: 493
127 - name: pod-share
128 emptyDir: {}