Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 1 | --- |
| 2 | # Copyright 2017-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 | apiVersion: v1 |
| 18 | kind: Service |
| 19 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 20 | name: ngic-cp |
| 21 | spec: |
| 22 | selector: |
| 23 | app: ngic-cp |
| 24 | clusterIP: None |
| 25 | ports: |
| 26 | - name: s11 |
| 27 | port: {{ .Values.ngic_cp.ports.s11 }} |
| 28 | protocol: UDP |
| 29 | - name: sx |
| 30 | port: {{ .Values.ngic_cp.ports.sx }} |
| 31 | protocol: UDP |
| 32 | --- |
| 33 | apiVersion: apps/v1 |
| 34 | kind: StatefulSet |
| 35 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 36 | name: ngic-cp |
| 37 | labels: |
| 38 | app: ngic-cp |
| 39 | spec: |
| 40 | replicas: {{ .Values.ngic_cp.replicas }} |
| 41 | selector: |
| 42 | matchLabels: |
| 43 | app: ngic-cp |
| 44 | serviceName: "ngic-cp" |
| 45 | template: |
| 46 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 47 | labels: |
| 48 | app: ngic-cp |
| 49 | spec: |
| 50 | initContainers: |
| 51 | - name: init-iptables |
| 52 | image: {{ .Values.ngic_cp.images.init }} |
| 53 | command: [ "sh", "-c"] |
| 54 | securityContext: |
| 55 | capabilities: |
| 56 | add: |
| 57 | - NET_ADMIN |
| 58 | args: |
| 59 | - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP; |
| 60 | terminationGracePeriodSeconds: 1 |
| 61 | containers: |
| 62 | - name: ngic |
| 63 | image: {{ .Values.ngic_cp.images.cp }} |
| 64 | imagePullPolicy: IfNotPresent |
| 65 | stdin: true |
| 66 | command: [ "bash", "-cx", ". /opt/ngic/config/cp_config.cfg; sleep 20; ./ngic_controlplane $EAL_ARGS -- $APP_ARGS"] |
| 67 | #command: ["sleep", "3600"] |
| 68 | tty: true |
| 69 | env: |
| 70 | - name: MME_S11_IP |
Wei-Yu Chen | b3409b8 | 2019-01-17 15:34:23 -0800 | [diff] [blame] | 71 | value: mme |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 72 | #- name: SGW_S1U_IP # for now,this will be in our own pod |
| 73 | # value: "5.5.5.5" |
| 74 | - name: APN |
| 75 | value: {{ .Values.ngic_cp.config.apn }} |
| 76 | - name: IP_POOL_IP |
| 77 | value: "{{ .Values.ngic_cp.config.ue_ip_pool }}" |
| 78 | - name: IP_POOL_MASK |
| 79 | value: "{{ .Values.ngic_cp.config.ue_ip_pool_mask }}" |
| 80 | - name: S11_TEID_POOL_START |
| 81 | value: "00100000" |
| 82 | - name: S11_TEID_POOL_STOP |
| 83 | value: "001fffff" |
| 84 | - name: S1U_TEID_POOL_START |
| 85 | value: "00100000" |
| 86 | - name: S1U_TEID_POOL_STOP |
| 87 | value: "001fffff" |
| 88 | - name: MEM_LIMIT |
| 89 | valueFrom: |
| 90 | resourceFieldRef: |
| 91 | containerName: ngic |
| 92 | resource: limits.memory |
| 93 | divisor: 1Mi |
| 94 | volumeMounts: |
| 95 | - name: config-volume |
| 96 | mountPath: /opt/ngic/config |
| 97 | #- name: hugepage |
| 98 | # mountPath: /dev/hugepages |
| 99 | - name: shared-data |
| 100 | mountPath: /opt/ngic/config/shared |
| 101 | resources: |
| 102 | limits: |
| 103 | #hugepages-1Gi: 4Gi |
| 104 | cpu: {{ .Values.ngic_cp.resources.cpu }} |
| 105 | memory: {{ .Values.ngic_cp.resources.mem }} |
| 106 | volumes: |
| 107 | - name: config-volume |
| 108 | configMap: |
| 109 | name: ngiccp-config |
| 110 | - name: shared-data |
| 111 | emptyDir: {} |