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 | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 22 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 23 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 24 | spec: |
| 25 | replicas: 1 |
| 26 | selector: |
| 27 | matchLabels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 28 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 6 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 29 | template: |
| 30 | metadata: |
| 31 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 32 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 8 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 33 | annotations: |
| 34 | k8s.v1.cni.cncf.io/networks: '[ |
Hyunsun Moon | 7a921d1 | 2019-08-21 20:52:09 -0500 | [diff] [blame] | 35 | { |
| 36 | "name": "s1u-net", |
| 37 | "interface": {{ .Values.config.spgwu.s1u.device | quote }}, |
| 38 | "ips": {{ .Values.config.spgwu.s1u.ip | quote }} |
| 39 | }, |
| 40 | { |
| 41 | "name": "sgi-net", |
| 42 | "interface": {{ .Values.config.spgwu.sgi.device | quote }}, |
| 43 | "ips": {{ .Values.config.spgwu.sgi.ip | quote }} |
| 44 | } |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 45 | ]' |
| 46 | spec: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 47 | {{- if .Values.nodeSelectors.enabled }} |
Woojoong Kim | 314d57c | 2019-07-09 17:08:11 -0700 | [diff] [blame] | 48 | nodeSelector: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 49 | {{ .Values.nodeSelectors.spgwu.label }}: {{ .Values.nodeSelectors.spgwu.value }} |
| 50 | {{- end }} |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 51 | {{- if not .Values.config.sriov.enabled }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 52 | initContainers: |
| 53 | - name: spgwu-iptables-init |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 54 | image: {{ .Values.images.tags.init | quote }} |
| 55 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 56 | command: [ "sh", "-xec"] |
| 57 | securityContext: |
| 58 | capabilities: |
| 59 | add: |
| 60 | - NET_ADMIN |
| 61 | args: |
| 62 | - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP; |
| 63 | - name: spgwu-af-iface-init |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 64 | image: {{ .Values.images.tags.init | quote }} |
| 65 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 66 | securityContext: |
| 67 | capabilities: |
| 68 | add: |
| 69 | - NET_ADMIN |
| 70 | command: |
| 71 | - /opt/dp/scripts/setup-af-iface.sh |
| 72 | volumeMounts: |
| 73 | - name: dp-script |
| 74 | mountPath: /opt/dp/scripts/setup-af-iface.sh |
| 75 | subPath: setup-af-iface.sh |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 76 | {{- end }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 77 | containers: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 78 | - name: spgwu |
| 79 | image: {{ .Values.images.tags.spgwu | quote }} |
| 80 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 81 | stdin: true |
| 82 | tty: true |
| 83 | env: |
| 84 | - name: MEM_LIMIT |
| 85 | valueFrom: |
| 86 | resourceFieldRef: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 87 | containerName: spgwu |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 88 | resource: limits.memory |
| 89 | divisor: 1Mi |
Hyunsun Moon | c4a7d54 | 2019-08-22 18:53:40 -0500 | [diff] [blame] | 90 | - name: POD_IP |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 91 | valueFrom: |
| 92 | fieldRef: |
| 93 | fieldPath: status.podIP |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 94 | command: ["bash", "-xc"] |
| 95 | args: |
| 96 | - ip a; |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 97 | /opt/dp/scripts/run.sh; |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 98 | volumeMounts: |
| 99 | - name: dp-script |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 100 | mountPath: /opt/dp/scripts/run.sh |
| 101 | subPath: run.sh |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 102 | - name: dp-config |
| 103 | mountPath: /etc/dp/config |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 104 | resources: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 105 | requests: |
| 106 | {{- if .Values.resources.enabled }} |
| 107 | {{ toYaml .Values.resources.spgwu.requests | indent 12 }} |
| 108 | {{- end }} |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 109 | {{- if .Values.config.sriov.enabled }} |
Woojoong Kim | e455aab | 2019-07-12 10:53:43 -0700 | [diff] [blame] | 110 | intel.com/sriov_vfio: 2 |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 111 | {{- end }} |
| 112 | limits: |
| 113 | {{- if .Values.resources.enabled }} |
| 114 | {{ toYaml .Values.resources.spgwu.limits | indent 12 }} |
| 115 | {{- end }} |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 116 | {{- if .Values.config.sriov.enabled }} |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 117 | intel.com/sriov_vfio: 2 |
| 118 | {{- end }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 119 | securityContext: |
| 120 | capabilities: |
| 121 | add: |
| 122 | - IPC_LOCK |
| 123 | volumes: |
| 124 | - name: dp-script |
| 125 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 126 | name: spgwu |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 127 | defaultMode: 493 |
| 128 | - name: dp-config |
| 129 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 130 | name: spgwu |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 131 | defaultMode: 420 |