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 |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame^] | 66 | command: [ "bash", "-xc"] |
| 67 | args: |
| 68 | - . /opt/ngic/config/cp_config.cfg; |
| 69 | - sleep 20; |
| 70 | - ./ngic_controlplane $EAL_ARGS -- $APP_ARGS; |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 71 | tty: true |
| 72 | env: |
| 73 | - name: MME_S11_IP |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame^] | 74 | value: {{ .Values.mme_hostname }} |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 75 | #- name: SGW_S1U_IP # for now,this will be in our own pod |
| 76 | # value: "5.5.5.5" |
| 77 | - name: APN |
| 78 | value: {{ .Values.ngic_cp.config.apn }} |
| 79 | - name: IP_POOL_IP |
| 80 | value: "{{ .Values.ngic_cp.config.ue_ip_pool }}" |
| 81 | - name: IP_POOL_MASK |
| 82 | value: "{{ .Values.ngic_cp.config.ue_ip_pool_mask }}" |
| 83 | - name: S11_TEID_POOL_START |
| 84 | value: "00100000" |
| 85 | - name: S11_TEID_POOL_STOP |
| 86 | value: "001fffff" |
| 87 | - name: S1U_TEID_POOL_START |
| 88 | value: "00100000" |
| 89 | - name: S1U_TEID_POOL_STOP |
| 90 | value: "001fffff" |
| 91 | - name: MEM_LIMIT |
| 92 | valueFrom: |
| 93 | resourceFieldRef: |
| 94 | containerName: ngic |
| 95 | resource: limits.memory |
| 96 | divisor: 1Mi |
| 97 | volumeMounts: |
| 98 | - name: config-volume |
| 99 | mountPath: /opt/ngic/config |
| 100 | #- name: hugepage |
| 101 | # mountPath: /dev/hugepages |
| 102 | - name: shared-data |
| 103 | mountPath: /opt/ngic/config/shared |
| 104 | resources: |
| 105 | limits: |
| 106 | #hugepages-1Gi: 4Gi |
| 107 | cpu: {{ .Values.ngic_cp.resources.cpu }} |
| 108 | memory: {{ .Values.ngic_cp.resources.mem }} |
| 109 | volumes: |
| 110 | - name: config-volume |
| 111 | configMap: |
| 112 | name: ngiccp-config |
| 113 | - name: shared-data |
| 114 | emptyDir: {} |