blob: 90775c04ae684a047a1d49f9c6d4a43f727f0a11 [file] [log] [blame]
Hyunsun Moon16d70922019-08-25 04:57:25 -05001{{/*
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{{ tuple "spgwc" . | include "omec-control-plane.service_account" }}
18---
19apiVersion: apps/v1
20kind: StatefulSet
21metadata:
22 name: spgwc
23 labels:
24{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
25spec:
26 replicas: 1
Hyunsun Moon834c28f2019-12-05 18:26:22 -080027 serviceName: spgwc-headless
Hyunsun Moon16d70922019-08-25 04:57:25 -050028 selector:
29 matchLabels:
30{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 6 }}
31 template:
32 metadata:
33 labels:
34{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 8 }}
35 spec:
36 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.spgwc.label }}: {{ .Values.nodeSelectors.spgwc.value }}
39 {{- end }}
40 serviceAccountName: spgwc
41 initContainers:
42 - name: spgwc-dep-check
43 image: {{ .Values.images.tags.depCheck | 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}]'
Hyunsun Moonec0b44d2020-01-10 15:50:53 -070066 {{- if .Values.config.coreDump.enabled }}
67{{ tuple "spgwc" . | include "omec-control-plane.coredump_init" | indent 6 }}
68 {{- end }}
Hyunsun Moon16d70922019-08-25 04:57:25 -050069 containers:
70 - name: spgwc
71 image: {{ .Values.images.tags.spgwc }}
72 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -070073 {{- if .Values.config.coreDump.enabled }}
74 securityContext:
75 privileged: true
76 runAsUser: 0
77 {{- end }}
Hyunsun Moon16d70922019-08-25 04:57:25 -050078 stdin: true
79 tty: true
80 command: ["/opt/cp/scripts/spgwc-run.sh"]
81 env:
82 - name: MEM_LIMIT
83 valueFrom:
84 resourceFieldRef:
85 containerName: spgwc
86 resource: limits.memory
87 divisor: 1Mi
88 - name: POD_IP
89 valueFrom:
90 fieldRef:
91 fieldPath: status.podIP
92 - name: MME_ADDR
93 valueFrom:
94 configMapKeyRef:
95 name: mme-ip
96 key: IP
97 {{- if .Values.resources.enabled }}
98 resources:
99{{ toYaml .Values.resources.spgwc | indent 10 }}
100 {{- end }}
101 volumeMounts:
102 - name: cp-script
103 mountPath: /opt/cp/scripts/spgwc-run.sh
104 subPath: spgwc-run.sh
105 - name: cp-config
106 mountPath: /etc/cp/config
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700107 {{- if .Values.config.coreDump.enabled }}
108 - name: coredump
109 mountPath: /tmp/coredump
110 {{- end }}
Hyunsun Moon16d70922019-08-25 04:57:25 -0500111 volumes:
112 - name: cp-script
113 configMap:
114 name: spgwc
115 defaultMode: 493
116 - name: cp-config
117 configMap:
118 name: spgwc
119 defaultMode: 420
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700120 {{- if .Values.config.coreDump.enabled }}
121 - name: host-rootfs
122 hostPath:
123 path: /
124 - name: coredump
125 hostPath:
126 path: {{ .Values.config.coreDump.path }}
127 {{- end }}