blob: 35fbe20bdd97365a250a73699468d98120d13cf5 [file] [log] [blame]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08001---
Wei-Yu Chen53aec362019-01-18 16:30:33 -08002# Copyright 2018-present Open Networking Foundation
3# Copyright 2018 Intel Corporation
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08004#
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
17---
18apiVersion: v1
19kind: Service
20metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080021 name: ngic-cp
22spec:
23 selector:
24 app: ngic-cp
25 clusterIP: None
26 ports:
27 - name: s11
28 port: {{ .Values.ngic_cp.ports.s11 }}
29 protocol: UDP
30 - name: sx
31 port: {{ .Values.ngic_cp.ports.sx }}
32 protocol: UDP
33---
34apiVersion: apps/v1
35kind: StatefulSet
36metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080037 name: ngic-cp
38 labels:
39 app: ngic-cp
40spec:
41 replicas: {{ .Values.ngic_cp.replicas }}
42 selector:
43 matchLabels:
44 app: ngic-cp
45 serviceName: "ngic-cp"
46 template:
47 metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080048 labels:
49 app: ngic-cp
50 spec:
51 initContainers:
52 - name: init-iptables
53 image: {{ .Values.ngic_cp.images.init }}
54 command: [ "sh", "-c"]
55 securityContext:
56 capabilities:
57 add:
58 - NET_ADMIN
59 args:
60 - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
61 terminationGracePeriodSeconds: 1
62 containers:
63 - name: ngic
64 image: {{ .Values.ngic_cp.images.cp }}
65 imagePullPolicy: IfNotPresent
66 stdin: true
Wei-Yu Chen353512d2019-01-30 13:28:48 -080067 command: [ "bash", "-xc" ]
Wei-Yu Chenda76c322019-01-18 13:31:55 -080068 args:
Wei-Yu Chend21956f2019-02-04 15:21:01 -080069 - . /opt/ngic/config/cp_config.cfg;
Wei-Yu Chen9e5e0462019-01-18 16:58:10 -080070 sleep 20;
71 ./ngic_controlplane $EAL_ARGS -- $APP_ARGS;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080072 tty: true
73 env:
74 - name: MME_S11_IP
Wei-Yu Chenda76c322019-01-18 13:31:55 -080075 value: {{ .Values.mme_hostname }}
Wei-Yu Chend21956f2019-02-04 15:21:01 -080076 - name: SGW_S11_IP
Pingping Lin79f84702019-02-05 18:38:40 -080077 value: {{ .Values.spgwc_hostname }}
Wei-Yu Chend21956f2019-02-04 15:21:01 -080078 - name: SGW_S1U_IP
79 value: {{ .Values.spgwu_s1u_ip }}
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080080 - name: APN
81 value: {{ .Values.ngic_cp.config.apn }}
82 - name: IP_POOL_IP
83 value: "{{ .Values.ngic_cp.config.ue_ip_pool }}"
84 - name: IP_POOL_MASK
85 value: "{{ .Values.ngic_cp.config.ue_ip_pool_mask }}"
86 - name: S11_TEID_POOL_START
87 value: "00100000"
88 - name: S11_TEID_POOL_STOP
89 value: "001fffff"
90 - name: S1U_TEID_POOL_START
91 value: "00100000"
92 - name: S1U_TEID_POOL_STOP
93 value: "001fffff"
94 - name: MEM_LIMIT
95 valueFrom:
96 resourceFieldRef:
97 containerName: ngic
98 resource: limits.memory
99 divisor: 1Mi
100 volumeMounts:
101 - name: config-volume
102 mountPath: /opt/ngic/config
103 #- name: hugepage
104 # mountPath: /dev/hugepages
105 - name: shared-data
106 mountPath: /opt/ngic/config/shared
107 resources:
108 limits:
109 #hugepages-1Gi: 4Gi
110 cpu: {{ .Values.ngic_cp.resources.cpu }}
111 memory: {{ .Values.ngic_cp.resources.mem }}
112 volumes:
113 - name: config-volume
114 configMap:
115 name: ngiccp-config
116 - name: shared-data
117 emptyDir: {}