blob: 885d8730a28d64e19763dc60754882007277ed5e [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{/*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002# Copyright 2019-present Open Networking Foundation
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003
Jeremy Ronquillo6046ce32020-06-18 11:06:29 -07004# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
Jeremy Ronquillo223db002020-06-05 10:28:22 -07005*/}}
6
Hyunsun Moon83ff7352020-07-09 11:03:52 -07007{{- if .Values.config.spgwc.deploy }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -07008{{ tuple "spgwc" . | include "omec-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: StatefulSet
12metadata:
13 name: spgwc
14 labels:
15{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 serviceName: spgwc-headless
19 selector:
20 matchLabels:
21{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 8 }}
26 spec:
27 {{- if .Values.nodeSelectors.enabled }}
28 nodeSelector:
29 {{ .Values.nodeSelectors.spgwc.label }}: {{ .Values.nodeSelectors.spgwc.value }}
30 {{- end }}
31 serviceAccountName: spgwc
32 initContainers:
33 - name: spgwc-dep-check
34 image: {{ .Values.images.tags.depCheck | quote }}
35 imagePullPolicy: {{ .Values.images.pullPolicy }}
36 securityContext:
37 allowPrivilegeEscalation: false
38 readOnlyRootFilesystem: false
39 runAsUser: 0
40 env:
41 - name: POD_NAME
42 valueFrom:
43 fieldRef:
44 apiVersion: v1
45 fieldPath: metadata.name
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
51 - name: PATH
52 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
53 - name: COMMAND
54 value: "echo done"
55 - name: DEPENDENCY_POD_JSON
56 value: '[{"labels": {"app": "mme"}, "requireSameNode": false}]'
57 {{- if .Values.config.coreDump.enabled }}
58{{ tuple "spgwc" . | include "omec-control-plane.coredump_init" | indent 6 }}
59 {{- end }}
60 containers:
61 - name: spgwc
62 image: {{ .Values.images.tags.spgwc }}
63 imagePullPolicy: {{ .Values.images.pullPolicy }}
64 {{- if .Values.config.coreDump.enabled }}
65 securityContext:
66 privileged: true
67 runAsUser: 0
68 {{- end }}
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 {{- if .Values.resources.enabled }}
84 resources:
85{{ toYaml .Values.resources.spgwc | indent 10 }}
86 {{- end }}
87 volumeMounts:
88 - name: cp-script
89 mountPath: /opt/cp/scripts/spgwc-run.sh
90 subPath: spgwc-run.sh
91 - name: cp-config
92 mountPath: /etc/cp/config
93 {{- if .Values.config.coreDump.enabled }}
94 - name: coredump
95 mountPath: /tmp/coredump
96 {{- end }}
97 volumes:
98 - name: cp-script
99 configMap:
100 name: spgwc
101 defaultMode: 493
102 - name: cp-config
103 configMap:
104 name: spgwc
105 defaultMode: 420
106 {{- if .Values.config.coreDump.enabled }}
107 - name: host-rootfs
108 hostPath:
109 path: /
110 - name: coredump
111 hostPath:
112 path: {{ .Values.config.coreDump.path }}
113 {{- end }}
Hyunsun Moon83ff7352020-07-09 11:03:52 -0700114{{- end }}