COMAC-165 Refactoring omec-control-plane HSS

- Split hss.yaml to resource specific files
- Separate job for DB sync and initial MME and user
- Make initial MME and user data configurable
- Change to use static OPC for default users

Change-Id: Ic4be24fcc5a00282ac6bd39f07a1cfc886829823
diff --git a/omec/omec-control-plane/templates/job-hss-db-sync.yaml b/omec/omec-control-plane/templates/job-hss-db-sync.yaml
new file mode 100644
index 0000000..17f3213
--- /dev/null
+++ b/omec/omec-control-plane/templates/job-hss-db-sync.yaml
@@ -0,0 +1,67 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+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: batch/v1
+kind: Job
+metadata:
+  name: job-hss-db-sync
+  labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+  template:
+    metadata:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+    spec:
+    {{- if .Values.nodeSelectors.enabled }}
+      nodeSelector:
+        {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
+    {{- end }}
+      restartPolicy: OnFailure
+      serviceAccountName: hss
+      initContainers:
+    {{- if .Values.cassandra.deploy }}
+      - name: job-db-sync-dep-check
+        image: {{ .Values.images.tags.depCheck | quote }}
+        imagePullPolicy: {{ .Values.images.pullPolicy }}
+        securityContext:
+          allowPrivilegeEscalation: false
+          readOnlyRootFilesystem: false
+          runAsUser: 0
+        env:
+          - name: NAMESPACE
+            valueFrom:
+              fieldRef:
+                apiVersion: v1
+                fieldPath: metadata.namespace
+          - name: PATH
+            value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
+          - name: COMMAND
+            value: "echo done"
+          - name: DEPENDENCY_SERVICE
+            value: {{ .Values.config.hss.hssdb }}
+        command:
+          - kubernetes-entrypoint
+        volumeMounts:
+          []
+    {{- end }}
+      containers:
+        - name: hss-db-sync
+          image: {{ .Values.images.tags.hssdb }}
+          imagePullPolicy: {{ .Values.images.pullPolicy }}
+          command: ["bash", "-xc"]
+          args:
+            - until cqlsh --file /opt/c3po/hssdb/oai_db.cql {{ .Values.config.hss.hssdb }}; do echo "Provisioning HSSDB"; sleep 2;done