blob: 89c7167ed00288f60fdb2a781ae896d4df278fba [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 }}
Wei-Yu Chenda76c322019-01-18 13:31:55 -080051 command: ["bash", "-xc"]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080052 args:
Wei-Yu Chenda76c322019-01-18 13:31:55 -080053 - until nslookup {{ .Values.hssdb_hostname }}; do echo waiting for cassandra; sleep 2; done;
54 - sleep 5;
55 - cqlsh --file /scripts/oai_db.cql cassandra;
56 - /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra {{ .Values.mme_hostname }} {{ .Values.mme_hostname }};
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;
59 - /scripts/data_provisioning_mme.sh 1 19136246000 {{ .Values.mme_hostname }} {{ .Values.mme_hostname }} 1 cassandra;
60 - /scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 cassandra;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080061 containers:
62 - name: hss
63 image: {{ .Values.hss.images.hss }}
64 imagePullPolicy: Always
Wei-Yu Chenda76c322019-01-18 13:31:55 -080065 command: ["bash", "-xc"]
66 args:
67 - sleep 3600;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080068 env:
69 - name: CASSANDRA_ADDR
70 value: cassandra
71 - name: MME_ADDR
Wei-Yu Chenda76c322019-01-18 13:31:55 -080072 value: {{ .Values.mme_hostname }}
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080073 #command: [ "sleep", "3600"]
74 resources:
75 limits:
76 cpu: {{ .Values.hss.resources.cpu }}
77 memory: {{ .Values.hss.resources.mem }}
78 volumeMounts:
79 - name: hss-script
80 mountPath: /opt/c3po/hss/launch.sh
81 subPath: launch.sh
82 - name: hss-config
83 mountPath: /etc/hss/conf
84 volumes:
85 - name: hss-script
86 configMap:
87 name: hss
88 defaultMode: 493
89 - name: hss-config
90 configMap:
91 name: hss
92 defaultMode: 420