blob: 6c7c9e42f73c4d2b5ffd759e196465007cd129fa [file] [log] [blame]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08001---
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---
17apiVersion: v1
18kind: Service
19metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080020 name: hss
21spec:
22 selector:
23 app: hss
24 clusterIP: None
25 ports:
26 - name: s6a
27 port: {{ .Values.hss.ports.s6a }}
28 protocol: TCP
29---
30apiVersion: apps/v1
31kind: StatefulSet
32metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080033 name: hss
34 labels:
35 app: hss
36spec:
37 replicas: {{ .Values.hss.replicas }}
38 selector:
39 matchLabels:
40 app: hss
41 serviceName: "hss"
42 template:
43 metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080044 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 Chenb3409b82019-01-17 15:34:23 -080056 /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra mme mme;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080057 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 Chenb3409b82019-01-17 15:34:23 -080059 /scripts/data_provisioning_mme.sh 1 19136246000 mme mme 1 cassandra;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080060 /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 Chenb3409b82019-01-17 15:34:23 -080069 value: mme
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080070 #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