Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2020-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 | --- |
| 18 | apiVersion: apps/v1 |
| 19 | kind: StatefulSet |
| 20 | metadata: |
| 21 | name: spgwu |
| 22 | serviceName: spgwu-headless |
| 23 | labels: |
| 24 | {{ tuple "spgwu" . | include "omec-user-plane.metadata_labels" | indent 4 }} |
| 25 | spec: |
| 26 | replicas: 1 |
| 27 | selector: |
| 28 | matchLabels: |
| 29 | {{ tuple "spgwu" . | include "omec-user-plane.metadata_labels" | indent 6 }} |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | {{ tuple "spgwu" . | include "omec-user-plane.metadata_labels" | indent 8 }} |
| 34 | annotations: |
| 35 | k8s.v1.cni.cncf.io/networks: '[ |
| 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 | } |
| 46 | ]' |
| 47 | spec: |
| 48 | shareProcessNamespace: true |
| 49 | {{- if .Values.nodeSelectors.enabled }} |
| 50 | nodeSelector: |
| 51 | {{ .Values.nodeSelectors.spgwu.label }}: {{ .Values.nodeSelectors.spgwu.value }} |
| 52 | {{- end }} |
| 53 | {{- if .Values.config.coreDump.enabled }} |
| 54 | {{ tuple "spgwu" . | include "omec-user-plane.coredump_init" | indent 8 }} |
| 55 | {{- end }} |
| 56 | containers: |
| 57 | - name: routectl |
| 58 | image: {{ .Values.images.tags.bess | quote }} |
| 59 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
| 60 | env: |
| 61 | - name: PYTHONUNBUFFERED |
| 62 | value: "1" |
Hyunsun Moon | ca1ed0d | 2020-04-27 20:22:13 -0700 | [diff] [blame] | 63 | command: ["/opt/bess/bessctl/conf/route_control.py"] |
Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 64 | args: |
| 65 | - -i |
| 66 | - {{ .Values.config.spgwu.s1u.device }} |
| 67 | - {{ .Values.config.spgwu.sgi.device }} |
| 68 | {{- if .Values.resources.enabled }} |
| 69 | resources: |
| 70 | {{ toYaml .Values.resources.routectl | indent 10 }} |
| 71 | {{- end }} |
Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 72 | - name: bessd |
| 73 | image: {{ .Values.images.tags.bess | quote }} |
| 74 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
| 75 | securityContext: |
| 76 | privileged: true |
| 77 | capabilities: |
| 78 | add: |
| 79 | - IPC_LOCK |
| 80 | - NET_ADMIN |
| 81 | stdin: true |
| 82 | tty: true |
| 83 | command: ["/bin/bash", "-xc", "bessd -f -grpc-url=0.0.0.0:10514;"] |
| 84 | lifecycle: |
| 85 | postStart: |
| 86 | exec: |
Hyunsun Moon | ca1ed0d | 2020-04-27 20:22:13 -0700 | [diff] [blame] | 87 | command: ["/etc/bess/conf/bessd-poststart.sh"] |
Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 88 | livenessProbe: |
| 89 | tcpSocket: |
| 90 | port: 10514 |
| 91 | initialDelaySeconds: 15 |
| 92 | periodSeconds: 20 |
| 93 | resources: |
| 94 | requests: |
| 95 | {{- if .Values.resources.enabled }} |
| 96 | {{ toYaml .Values.resources.bess.requests | indent 12 }} |
| 97 | {{- end }} |
| 98 | {{- if .Values.networks.sriov.enabled }} |
| 99 | intel.com/sriov_vfio_s1u_net: 1 |
| 100 | intel.com/sriov_vfio_sgi_net: 1 |
| 101 | {{- end }} |
| 102 | limits: |
| 103 | {{- if .Values.resources.enabled }} |
| 104 | {{ toYaml .Values.resources.bess.limits | indent 12 }} |
| 105 | {{- end }} |
| 106 | {{- if .Values.networks.sriov.enabled }} |
| 107 | intel.com/sriov_vfio_s1u_net: 1 |
| 108 | intel.com/sriov_vfio_sgi_net: 1 |
| 109 | {{- end }} |
Hyunsun Moon | ca1ed0d | 2020-04-27 20:22:13 -0700 | [diff] [blame] | 110 | env: |
| 111 | - name: CONF_FILE |
| 112 | value: /etc/bess/conf/spgwu.json |
Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 113 | volumeMounts: |
| 114 | - name: hugepages |
| 115 | mountPath: /dev/hugepages |
| 116 | - name: configs |
Hyunsun Moon | ca1ed0d | 2020-04-27 20:22:13 -0700 | [diff] [blame] | 117 | mountPath: /etc/bess/conf |
Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 118 | {{- if .Values.config.coreDump.enabled }} |
| 119 | - name: coredump |
| 120 | mountPath: /tmp/coredump |
| 121 | {{- end }} |
| 122 | - name: web |
| 123 | image: {{ .Values.images.tags.bess | quote }} |
| 124 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
| 125 | command: ["/bin/bash", "-xc", "bessctl http 0.0.0.0 8000"] |
| 126 | {{- if .Values.resources.enabled }} |
| 127 | resources: |
| 128 | {{ toYaml .Values.resources.web | indent 10 }} |
| 129 | {{- end }} |
Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 130 | - name: cpiface |
| 131 | image: {{ .Values.images.tags.cpiface | quote }} |
| 132 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
| 133 | env: |
| 134 | - name: ZMQD_IP |
| 135 | valueFrom: |
| 136 | fieldRef: |
| 137 | fieldPath: status.podIP |
| 138 | - name: GLOG_v |
| 139 | value: "1" |
| 140 | command: ["zmq-cpiface"] |
| 141 | args: |
| 142 | - --hostname |
| 143 | - {{ .Values.config.spgwu.name | quote }} |
| 144 | - --zmqd_nb_ip |
| 145 | - {{ .Values.config.spgwu.zmq.spgwc.addr | quote }} |
| 146 | - --zmqd_nb_port |
| 147 | - {{ .Values.config.spgwu.zmq.spgwc.port | quote }} |
| 148 | - --zmqd_recv_port |
| 149 | - {{ .Values.config.spgwu.zmq.recvPort | quote }} |
| 150 | - --zmqd_ip |
| 151 | - $(ZMQD_IP) |
| 152 | - --s1u_sgw_ip |
| 153 | - {{ (split "/" .Values.config.spgwu.s1u.ip)._0 | quote }} |
| 154 | {{- if .Values.resources.enabled }} |
| 155 | resources: |
| 156 | {{ toYaml .Values.resources.cpiface | indent 10 }} |
| 157 | {{- end }} |
| 158 | volumes: |
| 159 | - name: configs |
| 160 | configMap: |
| 161 | name: spgwu |
Hyunsun Moon | 6ff622e | 2020-03-11 17:14:48 -0700 | [diff] [blame] | 162 | defaultMode: 493 |
| 163 | - name: hugepages |
| 164 | emptyDir: |
| 165 | medium: HugePages |
| 166 | {{- if .Values.config.coreDump.enabled }} |
| 167 | - name: host-rootfs |
| 168 | hostPath: |
| 169 | path: / |
| 170 | - name: coredump |
| 171 | hostPath: |
| 172 | path: {{ .Values.config.coreDump.path }} |
| 173 | {{- end }} |