blob: ebc0cd01ac8fdd3c55999ecf4be5d24ae60a5950 [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}]'
66 containers:
67 - name: spgwc
68 image: {{ .Values.images.tags.spgwc }}
69 imagePullPolicy: {{ .Values.images.pullPolicy }}
70 stdin: true
71 tty: true
72 command: ["/opt/cp/scripts/spgwc-run.sh"]
73 env:
74 - name: MEM_LIMIT
75 valueFrom:
76 resourceFieldRef:
77 containerName: spgwc
78 resource: limits.memory
79 divisor: 1Mi
80 - name: POD_IP
81 valueFrom:
82 fieldRef:
83 fieldPath: status.podIP
84 - name: MME_ADDR
85 valueFrom:
86 configMapKeyRef:
87 name: mme-ip
88 key: IP
89 {{- if .Values.resources.enabled }}
90 resources:
91{{ toYaml .Values.resources.spgwc | indent 10 }}
92 {{- end }}
93 volumeMounts:
94 - name: cp-script
95 mountPath: /opt/cp/scripts/spgwc-run.sh
96 subPath: spgwc-run.sh
97 - name: cp-config
98 mountPath: /etc/cp/config
99 volumes:
100 - name: cp-script
101 configMap:
102 name: spgwc
103 defaultMode: 493
104 - name: cp-config
105 configMap:
106 name: spgwc
107 defaultMode: 420