Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 1 | --- |
| 2 | # Copyright 2018-present Open Networking Foundation |
| 3 | # Copyright 2018 Intel Corporation |
| 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: |
| 21 | name: accelleran |
| 22 | spec: |
| 23 | selector: |
| 24 | app: accelleran |
Matteo Scandolo | dec3f27 | 2019-02-04 13:57:35 -0800 | [diff] [blame] | 25 | clusterIP: 10.116.0.1 |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 26 | ports: |
| 27 | - name: s1ap |
| 28 | port: {{ .Values.accelleran.ports.s1ap }} |
| 29 | protocol: TCP |
Matteo Scandolo | dec3f27 | 2019-02-04 13:57:35 -0800 | [diff] [blame] | 30 | --- |
| 31 | apiVersion: v1 |
| 32 | kind: Service |
| 33 | metadata: |
| 34 | name: accelleran |
| 35 | spec: |
| 36 | selector: |
| 37 | app: accelleran |
| 38 | type: NodePort |
| 39 | ports: |
| 40 | - port: {{ .Values.accelleran.ports.s1ap }} |
| 41 | nodePort: {{ .Values.accelleran.ports.s1ap }} |
| 42 | protocol: TCP |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 43 | --- |
| 44 | apiVersion: apps/v1 |
| 45 | kind: StatefulSet |
| 46 | metadata: |
| 47 | name: accelleran |
| 48 | labels: |
| 49 | app: accelleran |
| 50 | spec: |
| 51 | replicas: {{ .Values.accelleran.replicas }} |
| 52 | selector: |
| 53 | matchLabels: |
| 54 | app: accelleran |
| 55 | serviceName: "accelleran" |
| 56 | template: |
| 57 | metadata: |
| 58 | labels: |
| 59 | app: accelleran |
| 60 | annotations: |
| 61 | k8s.v1.cni.cncf.io/networks: '[ |
| 62 | { "name": "bbu-net", "interface": "vbbu-net", "namespace": "default" } |
| 63 | ]' |
| 64 | spec: |
| 65 | initContainers: |
| 66 | - name: init-iptables |
| 67 | image: {{ .Values.accelleran.images.init }} |
| 68 | command: [ "sh", "-c"] |
| 69 | args: |
| 70 | - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP; |
| 71 | securityContext: |
| 72 | capabilities: |
| 73 | add: |
| 74 | - NET_ADMIN |
| 75 | terminationGracePeriodSeconds: 1 |
| 76 | containers: |
| 77 | - name: nats |
| 78 | image: {{ .Values.accelleran.images.nats }} |
| 79 | imagePullPolicy: IfNotPresent |
| 80 | stdin: true |
| 81 | tty: true |
| 82 | env: |
| 83 | - name: NATS_SERVICE_NAME |
| 84 | value: {{ .Values.accelleran.nats_service_name }} |
| 85 | command: [ "sh", "-c"] |
| 86 | args: |
| 87 | - gnatsd -DV -c /etc/gnatsd.conf; |
| 88 | resources: |
| 89 | limits: |
| 90 | cpu: {{ .Values.accelleran.resources.cpu }} |
| 91 | memory: {{ .Values.accelleran.resources.mem }} |
| 92 | intel.com/sriov: '2' |
| 93 | securityContext: |
| 94 | capabilities: |
| 95 | add: |
| 96 | - NET_ADMIN |
| 97 | - IPC_LOCK |
| 98 | - name: redis |
| 99 | image: {{ .Values.accelleran.images.redis }} |
| 100 | imagePullPolicy: IfNotPresent |
| 101 | stdin: true |
| 102 | tty: true |
| 103 | command: ["sh", "-c"] |
| 104 | args: |
| 105 | # FIXME: Redis can't support with dns resolution, can't set hostname at here. |
Wei-Yu Chen | 353512d | 2019-01-30 13:28:48 -0800 | [diff] [blame] | 106 | - (sleep 5; redis-cli -h localhost -p 6379 set NATS_SERVICE_URL "nat://$(ip route get 116 | awk '{print $NF;exit}'):4222";) & |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 107 | /usr/local/bin/redis-server |
| 108 | resources: |
| 109 | limits: |
| 110 | cpu: {{ .Values.accelleran.resources.cpu }} |
| 111 | memory: {{ .Values.accelleran.resources.mem }} |
| 112 | intel.com/sriov: '2' |
| 113 | securityContext: |
| 114 | capabilities: |
| 115 | add: |
| 116 | - NET_ADMIN |
| 117 | - IPC_LOCK |
| 118 | - name: bbu |
| 119 | image: {{ .Values.accelleran.images.bbu }} |
Wei-Yu Chen | b92af45 | 2019-01-31 12:08:19 -0800 | [diff] [blame] | 120 | imagePullPolicy: Always |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 121 | env: |
Wei-Yu Chen | b92af45 | 2019-01-31 12:08:19 -0800 | [diff] [blame] | 122 | - name: MME_IP |
| 123 | value: {{ .Values.mme_hostname }} |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 124 | stdin: true |
| 125 | tty: true |
| 126 | command: ["sh", "-c"] |
| 127 | args: |
Wei-Yu Chen | b92af45 | 2019-01-31 12:08:19 -0800 | [diff] [blame] | 128 | - sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('eth0');"; |
| 129 | sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;" |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 130 | sleep 10; |
| 131 | /l3/l3start; |
| 132 | volumeMounts: |
| 133 | - name: bbu-config |
| 134 | mountPath: /mnt/app/bootstrap.txt |
| 135 | subPath: bootstrap.txt |
| 136 | resources: |
| 137 | limits: |
| 138 | cpu: {{ .Values.accelleran.resources.cpu }} |
| 139 | memory: {{ .Values.accelleran.resources.mem }} |
| 140 | intel.com/sriov: '2' |
| 141 | securityContext: |
| 142 | capabilities: |
| 143 | add: |
| 144 | - NET_ADMIN |
| 145 | - IPC_LOCK |
| 146 | - SYS_NICE |
| 147 | volumes: |
| 148 | - name: bbu-config |
| 149 | configMap: |
| 150 | name: l3-config |
| 151 | items: |
| 152 | - key: bootstrap.txt |
| 153 | path: bootstrap.txt |
| 154 | |