Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2018-present Open Networking Foundation |
| 3 | Copyright 2018 Intel Corporation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */}} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 17 | --- |
| 18 | apiVersion: apps/v1 |
| 19 | kind: StatefulSet |
| 20 | metadata: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 21 | name: spgwu |
Hyunsun Moon | 834c28f | 2019-12-05 18:26:22 -0800 | [diff] [blame] | 22 | serviceName: spgwu-headless |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 23 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 24 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 25 | spec: |
| 26 | replicas: 1 |
| 27 | selector: |
| 28 | matchLabels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 29 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 6 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 30 | template: |
| 31 | metadata: |
| 32 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 33 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 8 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 34 | annotations: |
| 35 | k8s.v1.cni.cncf.io/networks: '[ |
Hyunsun Moon | 7a921d1 | 2019-08-21 20:52:09 -0500 | [diff] [blame] | 36 | { |
| 37 | "name": "s1u-net", |
| 38 | "interface": {{ .Values.config.spgwu.s1u.device | quote }}, |
| 39 | "ips": {{ .Values.config.spgwu.s1u.ip | quote }} |
| 40 | }, |
| 41 | { |
| 42 | "name": "sgi-net", |
| 43 | "interface": {{ .Values.config.spgwu.sgi.device | quote }}, |
| 44 | "ips": {{ .Values.config.spgwu.sgi.ip | quote }} |
| 45 | } |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 46 | ]' |
| 47 | spec: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 48 | {{- if .Values.nodeSelectors.enabled }} |
Woojoong Kim | 314d57c | 2019-07-09 17:08:11 -0700 | [diff] [blame] | 49 | nodeSelector: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 50 | {{ .Values.nodeSelectors.spgwu.label }}: {{ .Values.nodeSelectors.spgwu.value }} |
| 51 | {{- end }} |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 52 | {{- if not .Values.config.sriov.enabled }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 53 | initContainers: |
| 54 | - name: spgwu-iptables-init |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 55 | image: {{ .Values.images.tags.init | quote }} |
| 56 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 57 | command: [ "sh", "-xec"] |
| 58 | securityContext: |
| 59 | capabilities: |
| 60 | add: |
| 61 | - NET_ADMIN |
| 62 | args: |
| 63 | - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP; |
| 64 | - name: spgwu-af-iface-init |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 65 | image: {{ .Values.images.tags.init | quote }} |
| 66 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 67 | securityContext: |
| 68 | capabilities: |
| 69 | add: |
| 70 | - NET_ADMIN |
| 71 | command: |
| 72 | - /opt/dp/scripts/setup-af-iface.sh |
| 73 | volumeMounts: |
| 74 | - name: dp-script |
| 75 | mountPath: /opt/dp/scripts/setup-af-iface.sh |
| 76 | subPath: setup-af-iface.sh |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 77 | {{- end }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 78 | containers: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 79 | - name: spgwu |
| 80 | image: {{ .Values.images.tags.spgwu | quote }} |
| 81 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 82 | stdin: true |
| 83 | tty: true |
| 84 | env: |
| 85 | - name: MEM_LIMIT |
| 86 | valueFrom: |
| 87 | resourceFieldRef: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 88 | containerName: spgwu |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 89 | resource: limits.memory |
| 90 | divisor: 1Mi |
Hyunsun Moon | c4a7d54 | 2019-08-22 18:53:40 -0500 | [diff] [blame] | 91 | - name: POD_IP |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 92 | valueFrom: |
| 93 | fieldRef: |
| 94 | fieldPath: status.podIP |
Woojoong Kim | 4866d75 | 2019-12-17 16:32:23 -0800 | [diff] [blame] | 95 | - name: DP_NAME |
| 96 | value: "{{ .Values.config.spgwu.dpName }}" |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 97 | command: ["bash", "-xc"] |
| 98 | args: |
| 99 | - ip a; |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 100 | /opt/dp/scripts/run.sh; |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 101 | volumeMounts: |
| 102 | - name: dp-script |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 103 | mountPath: /opt/dp/scripts/run.sh |
| 104 | subPath: run.sh |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 105 | - name: dp-config |
| 106 | mountPath: /etc/dp/config |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 107 | resources: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 108 | requests: |
| 109 | {{- if .Values.resources.enabled }} |
| 110 | {{ toYaml .Values.resources.spgwu.requests | indent 12 }} |
| 111 | {{- end }} |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 112 | {{- if .Values.config.sriov.enabled }} |
Woojoong Kim | e455aab | 2019-07-12 10:53:43 -0700 | [diff] [blame] | 113 | intel.com/sriov_vfio: 2 |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 114 | {{- end }} |
| 115 | limits: |
| 116 | {{- if .Values.resources.enabled }} |
| 117 | {{ toYaml .Values.resources.spgwu.limits | indent 12 }} |
| 118 | {{- end }} |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 119 | {{- if .Values.config.sriov.enabled }} |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 120 | intel.com/sriov_vfio: 2 |
| 121 | {{- end }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 122 | securityContext: |
| 123 | capabilities: |
| 124 | add: |
| 125 | - IPC_LOCK |
| 126 | volumes: |
| 127 | - name: dp-script |
| 128 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 129 | name: spgwu |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 130 | defaultMode: 493 |
| 131 | - name: dp-config |
| 132 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 133 | name: spgwu |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 134 | defaultMode: 420 |