Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 1 | --- |
Wei-Yu Chen | 53aec36 | 2019-01-18 16:30:33 -0800 | [diff] [blame] | 2 | # Copyright 2018-present Open Networking Foundation |
| 3 | # Copyright 2018 Intel Corporation |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 4 | # |
| 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 | --- |
| 18 | apiVersion: v1 |
| 19 | kind: Service |
| 20 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 21 | name: ngic-cp |
| 22 | spec: |
| 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 Chen | ec8a2d7 | 2019-02-12 14:36:10 -0800 | [diff] [blame] | 34 | apiVersion: v1 |
| 35 | kind: Service |
| 36 | metadata: |
| 37 | name: ngic-cp-external |
| 38 | spec: |
| 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 Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 48 | apiVersion: apps/v1 |
| 49 | kind: StatefulSet |
| 50 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 51 | name: ngic-cp |
| 52 | labels: |
| 53 | app: ngic-cp |
| 54 | spec: |
| 55 | replicas: {{ .Values.ngic_cp.replicas }} |
| 56 | selector: |
| 57 | matchLabels: |
| 58 | app: ngic-cp |
| 59 | serviceName: "ngic-cp" |
| 60 | template: |
| 61 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 62 | labels: |
| 63 | app: ngic-cp |
| 64 | spec: |
Wei-Yu Chen | ec8a2d7 | 2019-02-12 14:36:10 -0800 | [diff] [blame] | 65 | nodeSelector: |
| 66 | kubernetes.io/hostname: "node2" |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 67 | 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 Chen | 353512d | 2019-01-30 13:28:48 -0800 | [diff] [blame] | 83 | command: [ "bash", "-xc" ] |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame] | 84 | args: |
Wei-Yu Chen | d21956f | 2019-02-04 15:21:01 -0800 | [diff] [blame] | 85 | - . /opt/ngic/config/cp_config.cfg; |
Wei-Yu Chen | 9e5e046 | 2019-01-18 16:58:10 -0800 | [diff] [blame] | 86 | sleep 20; |
| 87 | ./ngic_controlplane $EAL_ARGS -- $APP_ARGS; |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 88 | tty: true |
| 89 | env: |
| 90 | - name: MME_S11_IP |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame] | 91 | value: {{ .Values.mme_hostname }} |
Wei-Yu Chen | d21956f | 2019-02-04 15:21:01 -0800 | [diff] [blame] | 92 | - name: SGW_S11_IP |
Pingping Lin | 79f8470 | 2019-02-05 18:38:40 -0800 | [diff] [blame] | 93 | value: {{ .Values.spgwc_hostname }} |
Wei-Yu Chen | d21956f | 2019-02-04 15:21:01 -0800 | [diff] [blame] | 94 | - name: SGW_S1U_IP |
| 95 | value: {{ .Values.spgwu_s1u_ip }} |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 96 | - 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: {} |