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: hss |
| 22 | spec: |
| 23 | selector: |
| 24 | app: hss |
| 25 | clusterIP: None |
| 26 | ports: |
| 27 | - name: s6a |
| 28 | port: {{ .Values.hss.ports.s6a }} |
| 29 | protocol: TCP |
| 30 | --- |
| 31 | apiVersion: apps/v1 |
| 32 | kind: StatefulSet |
| 33 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 34 | name: hss |
| 35 | labels: |
| 36 | app: hss |
| 37 | spec: |
| 38 | replicas: {{ .Values.hss.replicas }} |
| 39 | selector: |
| 40 | matchLabels: |
| 41 | app: hss |
| 42 | serviceName: "hss" |
| 43 | template: |
| 44 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 45 | labels: |
| 46 | app: hss |
| 47 | spec: |
Wei-Yu Chen | ec8a2d7 | 2019-02-12 14:36:10 -0800 | [diff] [blame] | 48 | nodeSelector: |
Wei-Yu Chen | 9f533ef | 2019-02-18 11:39:17 -0800 | [diff] [blame] | 49 | kubernetes.io/hostname: "{{ .Values.hss_node_selector }}" |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 50 | terminationGracePeriodSeconds: 1 |
| 51 | initContainers: |
| 52 | - name: init-db |
| 53 | image: {{ .Values.hss.images.init }} |
Wei-Yu Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame] | 54 | command: ["bash", "-xc"] |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 55 | args: |
Wei-Yu Chen | b92af45 | 2019-01-31 12:08:19 -0800 | [diff] [blame] | 56 | - until nslookup {{ .Values.hssdb_hostname }}; do echo "waiting for cassandra domain name resolve."; sleep 2; done; |
| 57 | until cqlsh -e "show version" {{ .Values.hssdb_hostname }}; do echo "waiting for cassandra database ready."; sleep 2; done; |
| 58 | until cqlsh --file /scripts/oai_db.cql {{ .Values.hssdb_hostname }}; do echo "Writing data into database failed. Retrying ..."; sleep 2; done; |
Doyoung Lee | 0a12ee1 | 2019-02-13 16:39:12 -0800 | [diff] [blame] | 59 | /scripts/data_provisioning_users.sh 302720100000420 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 {{ .Values.hssdb_hostname }} {{ .Values.mme_hostname }} {{ .Values.mme_hostname }}; |
Wei-Yu Chen | b92af45 | 2019-01-31 12:08:19 -0800 | [diff] [blame] | 60 | /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 {{ .Values.hssdb_hostname }} {{ .Values.mme_hostname }} {{ .Values.mme_hostname }}; |
Doyoung Lee | 0a12ee1 | 2019-02-13 16:39:12 -0800 | [diff] [blame] | 61 | cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000420';" {{ .Values.hssdb_hostname }}; |
Wei-Yu Chen | b92af45 | 2019-01-31 12:08:19 -0800 | [diff] [blame] | 62 | cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" {{ .Values.hssdb_hostname }}; |
| 63 | /scripts/data_provisioning_mme.sh 1 19136246000 mme-0.{{ .Values.mme_hostname }}.{{ .Values.namespace }}.svc.cluster.local {{ .Values.mme_hostname }}.{{ .Values.namespace }}.svc.cluster.local 1 {{ .Values.hssdb_hostname }}; |
| 64 | /scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 {{ .Values.hssdb_hostname }}; |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 65 | containers: |
| 66 | - name: hss |
| 67 | image: {{ .Values.hss.images.hss }} |
| 68 | imagePullPolicy: Always |
| 69 | env: |
| 70 | - name: CASSANDRA_ADDR |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 71 | value: {{ .Values.hssdb_hostname }} |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 72 | - name: MME_ADDR |
Wei-Yu Chen | 4182f96 | 2019-01-24 15:47:39 -0800 | [diff] [blame] | 73 | value: mme-0.{{ .Values.mme_hostname }}.{{ .Values.namespace }}.svc.cluster.local |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 74 | #command: [ "sleep", "3600"] |
| 75 | resources: |
| 76 | limits: |
| 77 | cpu: {{ .Values.hss.resources.cpu }} |
| 78 | memory: {{ .Values.hss.resources.mem }} |
| 79 | volumeMounts: |
| 80 | - name: hss-script |
| 81 | mountPath: /opt/c3po/hss/launch.sh |
| 82 | subPath: launch.sh |
| 83 | - name: hss-config |
| 84 | mountPath: /etc/hss/conf |
| 85 | volumes: |
| 86 | - name: hss-script |
| 87 | configMap: |
| 88 | name: hss |
| 89 | defaultMode: 493 |
| 90 | - name: hss-config |
| 91 | configMap: |
| 92 | name: hss |
| 93 | defaultMode: 420 |