blob: 7a04bcbcf14c1723e03bf87c432deea2e93ebf1a [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:
nodeSelector:
kubernetes.io/hostname: "node3"
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 domain name resolve."; sleep 2; done;
until cqlsh -e "show version" {{ .Values.hssdb_hostname }}; do echo "waiting for cassandra database ready."; sleep 2; done;
until cqlsh --file /scripts/oai_db.cql {{ .Values.hssdb_hostname }}; do echo "Writing data into database failed. Retrying ..."; sleep 2; done;
/scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 {{ .Values.hssdb_hostname }} {{ .Values.mme_hostname }} {{ .Values.mme_hostname }};
cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" {{ .Values.hssdb_hostname }};
/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 {{ .Values.hssdb_hostname }};
/scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 {{ .Values.hssdb_hostname }};
containers:
- name: hss
image: {{ .Values.hss.images.hss }}
imagePullPolicy: Always
env:
- name: CASSANDRA_ADDR
value: {{ .Values.hssdb_hostname }}
- name: MME_ADDR
value: mme-0.{{ .Values.mme_hostname }}.{{ .Values.namespace }}.svc.cluster.local
#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