Woojoong Kim | 4feaddf | 2019-11-21 00:05:07 -0800 | [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 | --- |
| 18 | apiVersion: apps/v1 |
| 19 | kind: StatefulSet |
| 20 | metadata: |
| 21 | name: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }} |
| 22 | labels: |
| 23 | deployedCellId: {{ .Values.config.vranL3.instanceId }} |
| 24 | {{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 4 }} |
| 25 | spec: |
| 26 | selector: |
| 27 | matchLabels: |
| 28 | {{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 6 }} |
| 29 | serviceName: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }} |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | deployedCellId: {{ .Values.config.vranL3.instanceId }} |
| 34 | {{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 8 }} |
| 35 | spec: |
| 36 | {{- if .Values.nodeSelectors.enabled }} |
| 37 | nodeSelector: |
| 38 | {{ .Values.nodeSelectors.accelleranCBRSCU.label }}: {{ .Values.nodeSelectors.accelleranCBRSCU.value }} |
| 39 | {{- end }} |
| 40 | initContainers: |
| 41 | - name: cu-init |
| 42 | image: {{ .Values.images.tags.initCU }} |
| 43 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 44 | securityContext: |
| 45 | privileged: true |
| 46 | runAsUser: 0 |
| 47 | command: [ "sh", "-c"] |
| 48 | args: |
| 49 | - > |
| 50 | iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP; |
| 51 | if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \ |
| 52 | chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \ |
| 53 | fi; \ |
| 54 | volumeMounts: |
| 55 | - name: host-rootfs |
| 56 | mountPath: /mnt/host-rootfs |
| 57 | containers: |
| 58 | - name: vran-l3 |
| 59 | image: {{ .Values.images.tags.vranL3 }} |
| 60 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 61 | env: |
| 62 | - name: ZLOG_CONF_PATH |
| 63 | value: /zlog.conf |
| 64 | - name: BOOTSTRAP_FILENAME |
| 65 | value: /bootstrap |
| 66 | - name: LD_LIBRARY_PATH |
| 67 | value: /data/ |
| 68 | - name: FAP_DB_PATH |
| 69 | value: /data/ |
| 70 | command: ["sh", "-c"] |
| 71 | args: |
| 72 | - sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteEpcPlmnList set PLMNID='{{ .Values.config.vranL3.plmnId }}';"; |
| 73 | sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer1='{{ .Values.config.mme.ip }}';"; |
| 74 | sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer2='{{ .Values.config.mme.ip }}';"; |
| 75 | sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer3='{{ .Values.config.mme.ip }}';"; |
| 76 | sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway_S1SigLinkServerListList set S1SigLinkServerList='{{ .Values.config.mme.ip }}';"; |
| 77 | sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf set FreqBandIndicator='{{ .Values.config.vranL3.freqBand }}';"; |
| 78 | sqlite3 /data/datastore.db "update featureActivation set good1PPSRequired=0;"; |
| 79 | sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf_EARFCNDLList set EARFCNDL='{{ .Values.config.vranL3.earfcnDl }}';"; |
| 80 | sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf_EARFCNULList set EARFCNUL='{{ .Values.config.vranL3.earfcnUl }}';"; |
Woojoong Kim | 16aab89 | 2019-12-17 14:49:40 -0800 | [diff] [blame] | 81 | sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteEpc set TAC='{{ .Values.config.vranL3.tac }}';"; |
| 82 | sqlite3 /data/datastoreRemRw.db "select * from FapServiceCellConfigLteEpc;"; |
Woojoong Kim | 4feaddf | 2019-11-21 00:05:07 -0800 | [diff] [blame] | 83 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAYS1SIGLINKSERVERLIST[0] S1SIGLINKSERVERLIST {{ .Values.config.mme.ip }}; |
| 84 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAY_S1SIGLINKSERVERLISTLIST[0] S1SIGLINKSERVERLIST {{ .Values.config.mme.ip }}; |
| 85 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF FREQBANDINDICATOR {{ .Values.config.vranL3.freqBand }}; |
| 86 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FEATUREACTIVATION GOOD1PPSREQUIRED False; |
| 87 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPCPLMNLIST[0] PLMNID {{ .Values.config.vranL3.plmnId }}; |
| 88 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNDLLIST EARFCNDL {{ .Values.config.vranL3.earfcnDl }}; |
| 89 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNULLIST EARFCNUL {{ .Values.config.vranL3.earfcnUl }}; |
Woojoong Kim | 16aab89 | 2019-12-17 14:49:40 -0800 | [diff] [blame] | 90 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPC TAC {{ .Values.config.vranL3.tac }}; |
Woojoong Kim | 4feaddf | 2019-11-21 00:05:07 -0800 | [diff] [blame] | 91 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAYS1SIGLINKSERVERLIST[0]; |
| 92 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAY_S1SIGLINKSERVERLISTLIST[0]; |
| 93 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF; |
| 94 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FEATUREACTIVATION; |
| 95 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPCPLMNLIST[0]; |
| 96 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNDLLIST; |
| 97 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNULLIST; |
Woojoong Kim | 16aab89 | 2019-12-17 14:49:40 -0800 | [diff] [blame] | 98 | redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPC; |
Woojoong Kim | 4feaddf | 2019-11-21 00:05:07 -0800 | [diff] [blame] | 99 | sleep 30; |
| 100 | /data/l3service; |
| 101 | securityContext: |
| 102 | privileged: true |
| 103 | {{- if .Values.resources.enabled }} |
| 104 | resources: |
| 105 | {{ toYaml .Values.resources.accelleranCBRSCU | indent 10 }} |
| 106 | {{- end }} |
| 107 | volumeMounts: |
| 108 | - name: l3-config-volume |
| 109 | mountPath: /bootstrap |
| 110 | subPath: bootstrap |
| 111 | - name: l3-config-volume |
| 112 | mountPath: /zlog.conf |
| 113 | subPath: zlog.conf |
| 114 | volumes: |
| 115 | - name: l3-config-volume |
| 116 | configMap: |
| 117 | name: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }}-cm |
| 118 | - name: host-rootfs |
| 119 | hostPath: |
| 120 | path: / |