blob: 48ccdfc1ccc732d351bcc6ff9cb84ed4b2e636eb [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:
20 namespace: {{ .Values.namespace }}
21 name: hss
22spec:
23 selector:
24 app: hss
25 clusterIP: None
26 ports:
27 - name: s6a
28 port: {{ .Values.hss.ports.s6a }}
29 protocol: TCP
30---
31apiVersion: apps/v1
32kind: StatefulSet
33metadata:
34 namespace: {{ .Values.namespace }}
35 name: hss
36 labels:
37 app: hss
38spec:
39 replicas: {{ .Values.hss.replicas }}
40 selector:
41 matchLabels:
42 app: hss
43 serviceName: "hss"
44 template:
45 metadata:
46 namespace: {{ .Values.namespace }}
47 labels:
48 app: hss
49 spec:
50 terminationGracePeriodSeconds: 1
51 initContainers:
52 - name: init-db
53 image: {{ .Values.hss.images.init }}
54 command: [ "bash", "-xc"]
55 args:
56 - until nslookup cassandra; do echo waiting for cassandra; sleep 2; done;
57 sleep 5;
58 cqlsh --file /scripts/oai_db.cql cassandra;
59 /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra mme-0.mme.{{ .Values.namespace }}.svc.cluster.local mme.{{ .Values.namespace }}.svc.cluster.local;
60 cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" cassandra;
61 cqlsh -e "select imsi,key,opc,sqn from vhss.users_imsi;" cassandra;
62 /scripts/data_provisioning_mme.sh 1 19136246000 mme-0.mme.{{ .Values.namespace }}.svc.cluster.local mme.{{ .Values.namespace }}.svc.cluster.local 1 cassandra;
63 /scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 cassandra;
64 containers:
65 - name: hss
66 image: {{ .Values.hss.images.hss }}
67 imagePullPolicy: Always
68 env:
69 - name: CASSANDRA_ADDR
70 value: cassandra
71 - name: MME_ADDR
72 value: mme-0.mme.{{ .Values.namespace }}.svc.cluster.local
73 #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