blob: 17b5ab521cca8eb3c203b57f05d5f91f0b43322c [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 Chenda76c322019-01-18 13:31:55 -080067 command: [ "bash", "-xc"]
68 args:
69 - . /opt/ngic/config/cp_config.cfg;
70 - 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 Chen450a98a2019-01-15 16:56:30 -080076 #- name: SGW_S1U_IP # for now,this will be in our own pod
77 # value: "5.5.5.5"
78 - name: APN
79 value: {{ .Values.ngic_cp.config.apn }}
80 - name: IP_POOL_IP
81 value: "{{ .Values.ngic_cp.config.ue_ip_pool }}"
82 - name: IP_POOL_MASK
83 value: "{{ .Values.ngic_cp.config.ue_ip_pool_mask }}"
84 - name: S11_TEID_POOL_START
85 value: "00100000"
86 - name: S11_TEID_POOL_STOP
87 value: "001fffff"
88 - name: S1U_TEID_POOL_START
89 value: "00100000"
90 - name: S1U_TEID_POOL_STOP
91 value: "001fffff"
92 - name: MEM_LIMIT
93 valueFrom:
94 resourceFieldRef:
95 containerName: ngic
96 resource: limits.memory
97 divisor: 1Mi
98 volumeMounts:
99 - name: config-volume
100 mountPath: /opt/ngic/config
101 #- name: hugepage
102 # mountPath: /dev/hugepages
103 - name: shared-data
104 mountPath: /opt/ngic/config/shared
105 resources:
106 limits:
107 #hugepages-1Gi: 4Gi
108 cpu: {{ .Values.ngic_cp.resources.cpu }}
109 memory: {{ .Values.ngic_cp.resources.mem }}
110 volumes:
111 - name: config-volume
112 configMap:
113 name: ngiccp-config
114 - name: shared-data
115 emptyDir: {}