blob: dd3fb88065e2c61a6d3aa7c5add4dcfdb42700c5 [file] [log] [blame]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08001---
Wei-Yu Chen53aec362019-01-18 16:30:33 -08002# Copyright 2018-present Open Networking Foundation
3# Copyright 2018 Intel Corporation
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08004#
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---
18apiVersion: v1
19kind: Service
20metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080021 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:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080034 name: hss
35 labels:
36 app: hss
37spec:
38 replicas: {{ .Values.hss.replicas }}
39 selector:
40 matchLabels:
41 app: hss
42 serviceName: "hss"
43 template:
44 metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080045 labels:
46 app: hss
47 spec:
48 terminationGracePeriodSeconds: 1
49 initContainers:
50 - name: init-db
51 image: {{ .Values.hss.images.init }}
Wei-Yu Chenda76c322019-01-18 13:31:55 -080052 command: ["bash", "-xc"]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080053 args:
Wei-Yu Chenda76c322019-01-18 13:31:55 -080054 - until nslookup {{ .Values.hssdb_hostname }}; do echo waiting for cassandra; sleep 2; done;
Wei-Yu Chen4182f962019-01-24 15:47:39 -080055 sleep 10;
Wei-Yu Chen9e5e0462019-01-18 16:58:10 -080056 cqlsh --file /scripts/oai_db.cql cassandra;
57 /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra {{ .Values.mme_hostname }} {{ .Values.mme_hostname }};
58 cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" cassandra;
Wei-Yu Chen4182f962019-01-24 15:47:39 -080059 /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 cassandra;
Wei-Yu Chen9e5e0462019-01-18 16:58:10 -080060 /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
65 env:
66 - name: CASSANDRA_ADDR
Wei-Yu Chen4182f962019-01-24 15:47:39 -080067 value: {{ .Values.hssdb_hostname }}
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080068 - name: MME_ADDR
Wei-Yu Chen4182f962019-01-24 15:47:39 -080069 value: mme-0.{{ .Values.mme_hostname }}.{{ .Values.namespace }}.svc.cluster.local
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