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: mme |
| 21 | spec: |
| 22 | selector: |
| 23 | app: mme |
| 24 | type: NodePort |
| 25 | ports: |
| 26 | - name: s11 |
| 27 | port: {{ .Values.mme.ports.s11 }} |
| 28 | protocol: UDP |
| 29 | - name: s1ap |
| 30 | port: {{ .Values.mme.ports.s1ap }} |
| 31 | protocol: TCP |
| 32 | - name: s6a |
| 33 | port: {{ .Values.mme.ports.s6a }} |
| 34 | protocol: TCP |
| 35 | --- |
| 36 | apiVersion: apps/v1 |
| 37 | kind: StatefulSet |
| 38 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 39 | name: mme |
| 40 | labels: |
| 41 | app: mme |
| 42 | spec: |
| 43 | replicas: {{ .Values.mme.replicas }} |
| 44 | selector: |
| 45 | matchLabels: |
| 46 | app: mme |
| 47 | serviceName: "mme" |
| 48 | template: |
| 49 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 50 | labels: |
| 51 | app: mme |
| 52 | spec: |
| 53 | terminationGracePeriodSeconds: 1 |
| 54 | initContainers: |
| 55 | - name: init-mme |
| 56 | image: {{ .Values.mme.images.init }} |
| 57 | command: [ "sh", "-c"] |
| 58 | securityContext: |
| 59 | privileged: true |
| 60 | capabilities: |
| 61 | add: |
| 62 | - NET_ADMIN |
| 63 | args: |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame^] | 64 | - until nslookup {{ .Values.hss_hostname }}; do echo waiting for hss; sleep 2; done; |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 65 | - iptables -A OUTPUT -p sctp --sport {{ .Values.mme.ports.s1ap }} --chunk-types any ABORT -j DROP; |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 66 | containers: |
| 67 | - name: mme |
| 68 | image: {{ .Values.mme.images.mme }} |
| 69 | imagePullPolicy: Always |
| 70 | env: |
| 71 | - name: SGW_S11_IP |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame^] | 72 | value: {{ .Values.spgwc_hostname }} |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 73 | - name: MME_ETH0_IP |
| 74 | valueFrom: |
| 75 | fieldRef: |
| 76 | fieldPath: status.podIP |
| 77 | - name: ENB_S1AP_IP |
| 78 | value: {{ .Values.mme.enb_s1ap_ip }} |
| 79 | - name: ENB_S1AP_PORT |
| 80 | value: "{{ .Values.mme.ports.s1ap }}" #ng4t uses 32767 |
| 81 | - name: CONNECT_PEER |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame^] | 82 | value: {{ .Values.hss_hostname }} |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 83 | - name: VAR_HSS_REALM |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame^] | 84 | value: {{ .Values.hss_hostname }} |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 85 | - name: HSS_S6A_IP |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame^] | 86 | value: {{ .Values.hss_hostname }} |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 87 | - name: HSS_PORT |
| 88 | value: "{{ .Values.mme.ports.s6a }}" |
| 89 | stdin: true |
| 90 | tty: true |
| 91 | #command: [ "sleep", "3600"] |
| 92 | resources: |
| 93 | limits: |
| 94 | cpu: {{ .Values.mme.resources.cpu }} |
| 95 | memory: {{ .Values.mme.resources.mem }} |
| 96 | volumeMounts: |
| 97 | - name: mme-script |
| 98 | mountPath: /opt/c3po/mme/bin/launch.sh |
| 99 | subPath: launch.sh |
| 100 | - name: mme-config |
| 101 | mountPath: /etc/mme/conf |
| 102 | volumes: |
| 103 | - name: mme-script |
| 104 | configMap: |
| 105 | name: mme |
| 106 | defaultMode: 493 |
| 107 | - name: mme-config |
| 108 | configMap: |
| 109 | name: mme |
| 110 | defaultMode: 420 |