blob: 40b8f758bd02c619a5dd1c5b7aa4fcc300badfc7 [file] [log] [blame]
---
# Copyright 2018-present Open Networking Foundation
# Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: v1
kind: Service
metadata:
name: hss
spec:
selector:
app: hss
clusterIP: None
ports:
- name: s6a
port: {{ .Values.hss.ports.s6a }}
protocol: TCP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: hss
labels:
app: hss
spec:
replicas: {{ .Values.hss.replicas }}
selector:
matchLabels:
app: hss
serviceName: "hss"
template:
metadata:
labels:
app: hss
spec:
terminationGracePeriodSeconds: 1
initContainers:
- name: init-db
image: {{ .Values.hss.images.init }}
command: ["bash", "-xc"]
args:
- until nslookup {{ .Values.hssdb_hostname }}; do echo waiting for cassandra; sleep 2; done;
sleep 5;
cqlsh --file /scripts/oai_db.cql cassandra;
/scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra {{ .Values.mme_hostname }} {{ .Values.mme_hostname }};
cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" cassandra;
cqlsh -e "select imsi,key,opc,sqn from vhss.users_imsi;" cassandra;
/scripts/data_provisioning_mme.sh 1 19136246000 {{ .Values.mme_hostname }} {{ .Values.mme_hostname }} 1 cassandra;
/scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 cassandra;
containers:
- name: hss
image: {{ .Values.hss.images.hss }}
imagePullPolicy: Always
command: ["bash", "-xc"]
args:
- sleep 3600;
env:
- name: CASSANDRA_ADDR
value: cassandra
- name: MME_ADDR
value: {{ .Values.mme_hostname }}
#command: [ "sleep", "3600"]
resources:
limits:
cpu: {{ .Values.hss.resources.cpu }}
memory: {{ .Values.hss.resources.mem }}
volumeMounts:
- name: hss-script
mountPath: /opt/c3po/hss/launch.sh
subPath: launch.sh
- name: hss-config
mountPath: /etc/hss/conf
volumes:
- name: hss-script
configMap:
name: hss
defaultMode: 493
- name: hss-config
configMap:
name: hss
defaultMode: 420