blob: 376b3d96a2679d7433268ff8948b9553b58d0f2a [file] [log] [blame]
Hyunsun Moon6ff622e2020-03-11 17:14:48 -07001{{/*
2Copyright 2020-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17---
18apiVersion: apps/v1
19kind: StatefulSet
20metadata:
21 name: spgwu
22 serviceName: spgwu-headless
23 labels:
24{{ tuple "spgwu" . | include "omec-user-plane.metadata_labels" | indent 4 }}
25spec:
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 Moonca1ed0d2020-04-27 20:22:13 -070063 command: ["/opt/bess/bessctl/conf/route_control.py"]
Hyunsun Moon6ff622e2020-03-11 17:14:48 -070064 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 Moon6ff622e2020-03-11 17:14:48 -070072 - 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 Moonca1ed0d2020-04-27 20:22:13 -070087 command: ["/etc/bess/conf/bessd-poststart.sh"]
Hyunsun Moon6ff622e2020-03-11 17:14:48 -070088 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 Moonca1ed0d2020-04-27 20:22:13 -0700110 env:
111 - name: CONF_FILE
112 value: /etc/bess/conf/spgwu.json
Hyunsun Moon6ff622e2020-03-11 17:14:48 -0700113 volumeMounts:
114 - name: hugepages
115 mountPath: /dev/hugepages
116 - name: configs
Hyunsun Moonca1ed0d2020-04-27 20:22:13 -0700117 mountPath: /etc/bess/conf
Hyunsun Moon6ff622e2020-03-11 17:14:48 -0700118 {{- 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 Moon6ff622e2020-03-11 17:14:48 -0700130 - 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 Moon6ff622e2020-03-11 17:14:48 -0700162 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 }}