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: hss |
| 21 | spec: |
| 22 | selector: |
| 23 | app: hss |
| 24 | clusterIP: None |
| 25 | ports: |
| 26 | - name: s6a |
| 27 | port: {{ .Values.hss.ports.s6a }} |
| 28 | protocol: TCP |
| 29 | --- |
| 30 | apiVersion: apps/v1 |
| 31 | kind: StatefulSet |
| 32 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 33 | name: hss |
| 34 | labels: |
| 35 | app: hss |
| 36 | spec: |
| 37 | replicas: {{ .Values.hss.replicas }} |
| 38 | selector: |
| 39 | matchLabels: |
| 40 | app: hss |
| 41 | serviceName: "hss" |
| 42 | template: |
| 43 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 44 | labels: |
| 45 | app: hss |
| 46 | spec: |
| 47 | terminationGracePeriodSeconds: 1 |
| 48 | initContainers: |
| 49 | - name: init-db |
| 50 | image: {{ .Values.hss.images.init }} |
| 51 | command: [ "bash", "-xc"] |
| 52 | args: |
| 53 | - until nslookup cassandra; do echo waiting for cassandra; sleep 2; done; |
| 54 | sleep 5; |
| 55 | cqlsh --file /scripts/oai_db.cql cassandra; |
Wei-Yu Chen | b3409b8 | 2019-01-17 15:34:23 -0800 | [diff] [blame] | 56 | /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra mme mme; |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 57 | cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" cassandra; |
| 58 | cqlsh -e "select imsi,key,opc,sqn from vhss.users_imsi;" cassandra; |
Wei-Yu Chen | b3409b8 | 2019-01-17 15:34:23 -0800 | [diff] [blame] | 59 | /scripts/data_provisioning_mme.sh 1 19136246000 mme mme 1 cassandra; |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 60 | /scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 cassandra; |
| 61 | containers: |
| 62 | - name: hss |
| 63 | image: {{ .Values.hss.images.hss }} |
| 64 | imagePullPolicy: Always |
| 65 | env: |
| 66 | - name: CASSANDRA_ADDR |
| 67 | value: cassandra |
| 68 | - name: MME_ADDR |
Wei-Yu Chen | b3409b8 | 2019-01-17 15:34:23 -0800 | [diff] [blame] | 69 | value: mme |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 70 | #command: [ "sleep", "3600"] |
| 71 | resources: |
| 72 | limits: |
| 73 | cpu: {{ .Values.hss.resources.cpu }} |
| 74 | memory: {{ .Values.hss.resources.mem }} |
| 75 | volumeMounts: |
| 76 | - name: hss-script |
| 77 | mountPath: /opt/c3po/hss/launch.sh |
| 78 | subPath: launch.sh |
| 79 | - name: hss-config |
| 80 | mountPath: /etc/hss/conf |
| 81 | volumes: |
| 82 | - name: hss-script |
| 83 | configMap: |
| 84 | name: hss |
| 85 | defaultMode: 493 |
| 86 | - name: hss-config |
| 87 | configMap: |
| 88 | name: hss |
| 89 | defaultMode: 420 |