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 |
| 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 |