blob: 64f28ca1051229f241a9950bd83c975e9d707ac9 [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:
Hyunsun Moon55535832020-07-22 18:55:24 -070033 {{- if .Values.config.mme.deploy }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070034 - name: spgwc-dep-check
35 image: {{ .Values.images.tags.depCheck | quote }}
36 imagePullPolicy: {{ .Values.images.pullPolicy }}
37 securityContext:
38 allowPrivilegeEscalation: false
39 readOnlyRootFilesystem: false
40 runAsUser: 0
41 env:
42 - name: POD_NAME
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.name
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
52 - name: PATH
53 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
54 - name: COMMAND
55 value: "echo done"
56 - name: DEPENDENCY_POD_JSON
57 value: '[{"labels": {"app": "mme"}, "requireSameNode": false}]'
Hyunsun Moon55535832020-07-22 18:55:24 -070058 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070059 {{- if .Values.config.coreDump.enabled }}
60{{ tuple "spgwc" . | include "omec-control-plane.coredump_init" | indent 6 }}
61 {{- end }}
62 containers:
63 - name: spgwc
64 image: {{ .Values.images.tags.spgwc }}
65 imagePullPolicy: {{ .Values.images.pullPolicy }}
66 {{- if .Values.config.coreDump.enabled }}
67 securityContext:
68 privileged: true
69 runAsUser: 0
70 {{- end }}
71 stdin: true
72 tty: true
73 command: ["/opt/cp/scripts/spgwc-run.sh"]
74 env:
75 - name: MEM_LIMIT
76 valueFrom:
77 resourceFieldRef:
78 containerName: spgwc
79 resource: limits.memory
80 divisor: 1Mi
81 - name: POD_IP
82 valueFrom:
83 fieldRef:
84 fieldPath: status.podIP
85 {{- if .Values.resources.enabled }}
86 resources:
87{{ toYaml .Values.resources.spgwc | indent 10 }}
88 {{- end }}
89 volumeMounts:
90 - name: cp-script
91 mountPath: /opt/cp/scripts/spgwc-run.sh
92 subPath: spgwc-run.sh
93 - name: cp-config
94 mountPath: /etc/cp/config
95 {{- if .Values.config.coreDump.enabled }}
96 - name: coredump
97 mountPath: /tmp/coredump
98 {{- end }}
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
108 {{- if .Values.config.coreDump.enabled }}
109 - name: host-rootfs
110 hostPath:
111 path: /
112 - name: coredump
113 hostPath:
114 path: {{ .Values.config.coreDump.path }}
115 {{- end }}
Hyunsun Moon83ff7352020-07-09 11:03:52 -0700116{{- end }}