Woojoong Kim | 67dac6d | 2019-08-02 12:20:31 -0700 | [diff] [blame] | 1 | --- |
| 2 | # Copyright 2019-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: apps/v1 |
| 18 | kind: StatefulSet |
| 19 | metadata: |
| 20 | name: {{ .Values.cu.name }} |
| 21 | labels: |
| 22 | app: {{ .Values.cu.name }} |
| 23 | spec: |
| 24 | replicas: {{ .Values.cu.accelleran.replicas }} |
| 25 | selector: |
| 26 | matchLabels: |
| 27 | app: {{ .Values.cu.name }} |
| 28 | serviceName: {{ .Values.cu.name | quote }} |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
| 32 | app: {{ .Values.cu.name }} |
| 33 | annotations: |
| 34 | k8s.v1.cni.cncf.io/networks: '[ |
Woojoong Kim | 90397c5 | 2019-08-28 17:49:45 -0700 | [diff] [blame^] | 35 | { |
| 36 | "name": "f1-net-cu", |
| 37 | "interface": {{ .Values.cu.accelleran.interface | quote }}, |
| 38 | "ips": {{ .Values.cu.accelleran.ips | quote }} |
| 39 | } |
Woojoong Kim | 67dac6d | 2019-08-02 12:20:31 -0700 | [diff] [blame] | 40 | ]' |
| 41 | |
| 42 | spec: |
| 43 | nodeSelector: |
| 44 | {{ toYaml .Values.cu.nodeselector | indent 8 }} |
| 45 | initContainers: |
| 46 | - name: init-iptables |
| 47 | image: {{ .Values.cu.accelleran.images.init }} |
| 48 | command: [ "sh", "-c"] |
| 49 | args: |
| 50 | - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP; |
| 51 | securityContext: |
| 52 | capabilities: |
| 53 | add: |
| 54 | - NET_ADMIN |
| 55 | terminationGracePeriodSeconds: 1 |
| 56 | containers: |
| 57 | - name: nats |
| 58 | image: {{ .Values.cu.accelleran.images.nats }} |
| 59 | imagePullPolicy: IfNotPresent |
| 60 | stdin: true |
| 61 | tty: true |
| 62 | env: |
| 63 | - name: NATS_SERVICE_NAME |
| 64 | value: {{ .Values.cu.accelleran.nats.servicename }} |
| 65 | command: [ "sh", "-c"] |
| 66 | args: |
| 67 | - gnatsd -DV -c /etc/gnatsd.conf; |
| 68 | resources: |
| 69 | limits: |
| 70 | cpu: {{ .Values.cu.accelleran.resources.cpu }} |
| 71 | memory: {{ .Values.cu.accelleran.resources.mem }} |
| 72 | {{- if .Values.network.sriov.enabled }} |
| 73 | intel.com/sriov_netdevice: '2' |
| 74 | {{- end }} |
| 75 | securityContext: |
| 76 | capabilities: |
| 77 | add: |
| 78 | - NET_ADMIN |
| 79 | - IPC_LOCK |
| 80 | - name: redis |
| 81 | image: {{ .Values.cu.accelleran.images.redis }} |
| 82 | imagePullPolicy: IfNotPresent |
| 83 | stdin: true |
| 84 | tty: true |
| 85 | command: ["sh", "-c"] |
| 86 | args: |
| 87 | # FIXME: Redis can't support with dns resolution, can't set hostname at here. |
| 88 | - (sleep 5; redis-cli -h localhost -p 6379 set NATS_SERVICE_URL "nat://$(ip route get 116 | awk '{print $NF;exit}'):4222";) & |
| 89 | /usr/local/bin/redis-server |
| 90 | resources: |
| 91 | limits: |
| 92 | cpu: {{ .Values.cu.accelleran.resources.cpu }} |
| 93 | memory: {{ .Values.cu.accelleran.resources.mem }} |
| 94 | {{- if .Values.network.sriov.enabled }} |
| 95 | intel.com/sriov_netdevice: '2' |
| 96 | {{- end }} |
| 97 | securityContext: |
| 98 | capabilities: |
| 99 | add: |
| 100 | - NET_ADMIN |
| 101 | - IPC_LOCK |
| 102 | - name: bbu |
| 103 | image: {{ .Values.cu.accelleran.images.bbu }} |
Woojoong Kim | d543368 | 2019-08-26 15:06:16 -0700 | [diff] [blame] | 104 | imagePullPolicy: IfNotPresent |
Woojoong Kim | 67dac6d | 2019-08-02 12:20:31 -0700 | [diff] [blame] | 105 | env: |
| 106 | - name: MME_IP |
| 107 | value: {{ .Values.mme.nodeport_ip_addr }} |
| 108 | stdin: true |
| 109 | tty: true |
| 110 | command: ["sh", "-c"] |
| 111 | # Configure BBU SCTP source port to `s1ap_external`, MME endpoint port to `mme_port` and configure BBU to use |
| 112 | # Removed ProgRAN-related command - you can see about it in `helm-chart/mcord/mcord-bbu` |
| 113 | args: |
| 114 | - sqlite3 /mnt/app/datastore.db "update cellS1apConfig set enbSctpPort={{ .Values.cu.accelleran.ports.s1ap }};"; |
| 115 | sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceFapControlLteGateway set S1SigLinkPort={{ .Values.mme.port }};"; |
Woojoong Kim | 90397c5 | 2019-08-28 17:49:45 -0700 | [diff] [blame^] | 116 | sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceCellConfigLteEpcPlmnList set PLMNID={{ .Values.epc.config.plmnid }};"; |
Woojoong Kim | 67dac6d | 2019-08-02 12:20:31 -0700 | [diff] [blame] | 117 | sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('{{ .Values.enb.socket_interface }}');"; |
| 118 | sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;"; |
Woojoong Kim | e0c94a8 | 2019-08-27 10:27:27 -0700 | [diff] [blame] | 119 | {{- if .Values.cu.accelleran.progran.enabled }} |
| 120 | sqlite3 /mnt/app/datastore.db "update featureActivation set mmeSlicingEnabled=1;"; |
| 121 | sqlite3 /mnt/app/datastore.db "update featureActivation set ranSlicingEnabled=1;"; |
| 122 | sqlite3 /mnt/app/datastore.db "insert into pranServerAddress (pranServerIpAddress,pranServerPort) values ('{{ .Values.cu.accelleran.progran.ip }}', {{ .Values.cu.accelleran.progran.port }});"; |
| 123 | {{- end}} |
Woojoong Kim | 67dac6d | 2019-08-02 12:20:31 -0700 | [diff] [blame] | 124 | sleep 10; |
| 125 | /l3/l3start; |
| 126 | volumeMounts: |
| 127 | - name: bbu-config |
| 128 | mountPath: /mnt/app/bootstrap.txt |
| 129 | subPath: bootstrap.txt |
| 130 | resources: |
| 131 | limits: |
| 132 | cpu: {{ .Values.cu.accelleran.resources.cpu }} |
| 133 | memory: {{ .Values.cu.accelleran.resources.mem }} |
| 134 | {{- if .Values.network.sriov.enabled }} |
| 135 | intel.com/sriov_netdevice: '2' |
| 136 | {{- end }} |
| 137 | securityContext: |
| 138 | capabilities: |
| 139 | add: |
| 140 | - NET_ADMIN |
| 141 | - IPC_LOCK |
| 142 | - SYS_NICE |
| 143 | volumes: |
| 144 | - name: bbu-config |
| 145 | configMap: |
| 146 | name: l3-config |
| 147 | items: |
| 148 | - key: bootstrap.txt |
Woojoong Kim | d543368 | 2019-08-26 15:06:16 -0700 | [diff] [blame] | 149 | path: bootstrap.txt |