blob: 9faadca3c88978e186c5fd3c83d152a77bc14a00 [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
27 selector:
28 matchLabels:
29{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 6 }}
30 template:
31 metadata:
32 labels:
33{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 8 }}
34 spec:
35 {{- if .Values.nodeSelectors.enabled }}
36 nodeSelector:
37 {{ .Values.nodeSelectors.spgwc.label }}: {{ .Values.nodeSelectors.spgwc.value }}
38 {{- end }}
39 serviceAccountName: spgwc
40 initContainers:
41 - name: spgwc-dep-check
42 image: {{ .Values.images.tags.depCheck | quote }}
43 imagePullPolicy: {{ .Values.images.pullPolicy }}
44 securityContext:
45 allowPrivilegeEscalation: false
46 readOnlyRootFilesystem: false
47 runAsUser: 0
48 env:
49 - name: POD_NAME
50 valueFrom:
51 fieldRef:
52 apiVersion: v1
53 fieldPath: metadata.name
54 - name: NAMESPACE
55 valueFrom:
56 fieldRef:
57 apiVersion: v1
58 fieldPath: metadata.namespace
59 - name: PATH
60 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
61 - name: COMMAND
62 value: "echo done"
63 - name: DEPENDENCY_POD_JSON
64 value: '[{"labels": {"app": "mme"}, "requireSameNode": false}]'
65 containers:
66 - name: spgwc
67 image: {{ .Values.images.tags.spgwc }}
68 imagePullPolicy: {{ .Values.images.pullPolicy }}
69 stdin: true
70 tty: true
71 command: ["/opt/cp/scripts/spgwc-run.sh"]
72 env:
73 - name: MEM_LIMIT
74 valueFrom:
75 resourceFieldRef:
76 containerName: spgwc
77 resource: limits.memory
78 divisor: 1Mi
79 - name: POD_IP
80 valueFrom:
81 fieldRef:
82 fieldPath: status.podIP
83 - name: MME_ADDR
84 valueFrom:
85 configMapKeyRef:
86 name: mme-ip
87 key: IP
88 {{- if .Values.resources.enabled }}
89 resources:
90{{ toYaml .Values.resources.spgwc | indent 10 }}
91 {{- end }}
92 volumeMounts:
93 - name: cp-script
94 mountPath: /opt/cp/scripts/spgwc-run.sh
95 subPath: spgwc-run.sh
96 - name: cp-config
97 mountPath: /etc/cp/config
98 volumes:
99 - name: cp-script
100 configMap:
101 name: spgwc
102 defaultMode: 493
103 - name: cp-config
104 configMap:
105 name: spgwc
106 defaultMode: 420