blob: cd094ee21569fd6e8c403418de6b553652a2eae1 [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
Hyunsun Moon16d70922019-08-25 04:57:25 -050092 {{- if .Values.resources.enabled }}
93 resources:
94{{ toYaml .Values.resources.spgwc | indent 10 }}
95 {{- end }}
96 volumeMounts:
97 - name: cp-script
98 mountPath: /opt/cp/scripts/spgwc-run.sh
99 subPath: spgwc-run.sh
100 - name: cp-config
101 mountPath: /etc/cp/config
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700102 {{- if .Values.config.coreDump.enabled }}
103 - name: coredump
104 mountPath: /tmp/coredump
105 {{- end }}
Hyunsun Moon16d70922019-08-25 04:57:25 -0500106 volumes:
107 - name: cp-script
108 configMap:
109 name: spgwc
110 defaultMode: 493
111 - name: cp-config
112 configMap:
113 name: spgwc
114 defaultMode: 420
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700115 {{- if .Values.config.coreDump.enabled }}
116 - name: host-rootfs
117 hostPath:
118 path: /
119 - name: coredump
120 hostPath:
121 path: {{ .Values.config.coreDump.path }}
122 {{- end }}