Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | {{ tuple "spgwc" . | include "omec-control-plane.service_account" }} |
| 18 | --- |
| 19 | apiVersion: apps/v1 |
| 20 | kind: StatefulSet |
| 21 | metadata: |
| 22 | name: spgwc |
| 23 | labels: |
| 24 | {{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }} |
| 25 | spec: |
| 26 | replicas: 1 |
Hyunsun Moon | 834c28f | 2019-12-05 18:26:22 -0800 | [diff] [blame] | 27 | serviceName: spgwc-headless |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 28 | 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 Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 66 | {{- if .Values.config.coreDump.enabled }} |
| 67 | {{ tuple "spgwc" . | include "omec-control-plane.coredump_init" | indent 6 }} |
| 68 | {{- end }} |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 69 | containers: |
| 70 | - name: spgwc |
| 71 | image: {{ .Values.images.tags.spgwc }} |
| 72 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 73 | {{- if .Values.config.coreDump.enabled }} |
| 74 | securityContext: |
| 75 | privileged: true |
| 76 | runAsUser: 0 |
| 77 | {{- end }} |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 78 | 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 Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 92 | {{- 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 Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 102 | {{- if .Values.config.coreDump.enabled }} |
| 103 | - name: coredump |
| 104 | mountPath: /tmp/coredump |
| 105 | {{- end }} |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 106 | 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 Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 115 | {{- 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 }} |