blob: 219734795d9f995e0e27a79eea21b457060844e2 [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---
Wei-Yu Chenec8a2d72019-02-12 14:36:10 -080034apiVersion: v1
35kind: Service
36metadata:
37 name: ngic-cp-external
38spec:
39 selector:
40 app: ngic-cp
41 type: NodePort
42 ports:
43 - name: sx
44 port: {{ .Values.ngic_cp.ports.sx }}
45 nodePort: {{ .Values.ngic_cp.ports.sx_external }}
46 protocol: UDP
47---
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080048apiVersion: apps/v1
49kind: StatefulSet
50metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080051 name: ngic-cp
52 labels:
53 app: ngic-cp
54spec:
55 replicas: {{ .Values.ngic_cp.replicas }}
56 selector:
57 matchLabels:
58 app: ngic-cp
59 serviceName: "ngic-cp"
60 template:
61 metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080062 labels:
63 app: ngic-cp
64 spec:
Wei-Yu Chenec8a2d72019-02-12 14:36:10 -080065 nodeSelector:
66 kubernetes.io/hostname: "node2"
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080067 initContainers:
68 - name: init-iptables
69 image: {{ .Values.ngic_cp.images.init }}
70 command: [ "sh", "-c"]
71 securityContext:
72 capabilities:
73 add:
74 - NET_ADMIN
75 args:
76 - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
77 terminationGracePeriodSeconds: 1
78 containers:
79 - name: ngic
80 image: {{ .Values.ngic_cp.images.cp }}
81 imagePullPolicy: IfNotPresent
82 stdin: true
Wei-Yu Chen353512d2019-01-30 13:28:48 -080083 command: [ "bash", "-xc" ]
Wei-Yu Chenda76c322019-01-18 13:31:55 -080084 args:
Wei-Yu Chend21956f2019-02-04 15:21:01 -080085 - . /opt/ngic/config/cp_config.cfg;
Wei-Yu Chen9e5e0462019-01-18 16:58:10 -080086 sleep 20;
87 ./ngic_controlplane $EAL_ARGS -- $APP_ARGS;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080088 tty: true
89 env:
90 - name: MME_S11_IP
Wei-Yu Chenda76c322019-01-18 13:31:55 -080091 value: {{ .Values.mme_hostname }}
Wei-Yu Chend21956f2019-02-04 15:21:01 -080092 - name: SGW_S11_IP
Pingping Lin79f84702019-02-05 18:38:40 -080093 value: {{ .Values.spgwc_hostname }}
Wei-Yu Chend21956f2019-02-04 15:21:01 -080094 - name: SGW_S1U_IP
95 value: {{ .Values.spgwu_s1u_ip }}
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080096 - name: APN
97 value: {{ .Values.ngic_cp.config.apn }}
98 - name: IP_POOL_IP
99 value: "{{ .Values.ngic_cp.config.ue_ip_pool }}"
100 - name: IP_POOL_MASK
101 value: "{{ .Values.ngic_cp.config.ue_ip_pool_mask }}"
102 - name: S11_TEID_POOL_START
103 value: "00100000"
104 - name: S11_TEID_POOL_STOP
105 value: "001fffff"
106 - name: S1U_TEID_POOL_START
107 value: "00100000"
108 - name: S1U_TEID_POOL_STOP
109 value: "001fffff"
110 - name: MEM_LIMIT
111 valueFrom:
112 resourceFieldRef:
113 containerName: ngic
114 resource: limits.memory
115 divisor: 1Mi
116 volumeMounts:
117 - name: config-volume
118 mountPath: /opt/ngic/config
119 #- name: hugepage
120 # mountPath: /dev/hugepages
121 - name: shared-data
122 mountPath: /opt/ngic/config/shared
123 resources:
124 limits:
125 #hugepages-1Gi: 4Gi
126 cpu: {{ .Values.ngic_cp.resources.cpu }}
127 memory: {{ .Values.ngic_cp.resources.mem }}
128 volumes:
129 - name: config-volume
130 configMap:
131 name: ngiccp-config
132 - name: shared-data
133 emptyDir: {}