summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/kubernetes
diff options
context:
space:
mode:
authorAreli Fuss <af732p@att.com>2018-02-01 13:09:07 +0200
committerMichael Lando <ml636r@att.com>2018-02-06 17:57:29 +0000
commit471a29706bfc3ed50a6c66f96ee6575fc2e3087b (patch)
treecce1286f59676a2f7097cb34146cfa94940d65b4 /sdc-os-chef/kubernetes
parent00c6ec7d386bd27c7752cf86e4692669e8b850ab (diff)
Add K8S deployment above Vagrant
Set deployment manifest files and scripts for deploy SDC over Kubernetes inside Vagrant Preparation for OOM integration Change-Id: I1f54b95067538f42d2d68fa3366b512dc9134f43 Issue-ID: SDC-907 Signed-off-by: Areli Fuss <af732p@att.com>
Diffstat (limited to 'sdc-os-chef/kubernetes')
-rw-r--r--sdc-os-chef/kubernetes/sdc/Chart.yaml4
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-check-job-completion.yaml82
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-environment-configmap.yaml99
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-be.yaml130
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-cs.yaml86
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-es.yaml63
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-fe.yaml107
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-kb.yaml72
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-pv-pvc.yaml32
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-cs.yaml53
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-es.yaml47
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/secrets/sdc-cs-secret.yaml14
-rw-r--r--sdc-os-chef/kubernetes/sdc/templates/services/all-services.yaml127
-rw-r--r--sdc-os-chef/kubernetes/sdc/values.yaml21
14 files changed, 937 insertions, 0 deletions
diff --git a/sdc-os-chef/kubernetes/sdc/Chart.yaml b/sdc-os-chef/kubernetes/sdc/Chart.yaml
new file mode 100644
index 0000000000..668a9a641e
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/Chart.yaml
@@ -0,0 +1,4 @@
+apiVersion: v1
+description: A Helm chart for Kubernetes
+name: sdc
+version: 0.1.0
diff --git a/sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-check-job-completion.yaml b/sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-check-job-completion.yaml
new file mode 100644
index 0000000000..2561cae4ba
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-check-job-completion.yaml
@@ -0,0 +1,82 @@
+---
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: sdc-check-job-completion
+ namespace: onap-sdc
+data:
+ sdc_check_job_completion.py: |
+ #!/usr/bin/python
+ from __future__ import print_function
+ import time, argparse, logging, sys, os
+ import kubernetes.client
+ from kubernetes import client, config
+ from pprint import pprint
+
+ #extract env variables.
+ namespace = os.environ['NAMESPACE']
+ cert = os.environ['CERT']
+ host = os.environ['KUBERNETES_SERVICE_HOST']
+ token_path = os.environ['TOKEN']
+
+ with open(token_path, 'r') as token_file:
+ token = token_file.read().replace('\n', '')
+
+ client.configuration.api_key['authorization'] = token
+ client.configuration.api_key_prefix['authorization'] = 'Bearer'
+ client.configuration.host = "https://" + str(host)
+ client.configuration.ssl_ca_cert = cert
+
+ api_instance = client.BatchV1Api()
+
+ #setup logging
+ log = logging.getLogger(__name__)
+ handler = logging.StreamHandler(sys.stdout)
+ handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s'))
+ handler.setLevel(logging.INFO)
+ log.addHandler(handler)
+ log.setLevel(logging.INFO)
+
+
+ def is_ready(job_name):
+ log.info( "[INFO] Checking if " + job_name + " is completed")
+ pretty = True
+ job_status = False
+
+ try:
+ api_response = api_instance.read_namespaced_job_status(job_name, namespace, pretty=pretty)
+ except Exception as e:
+ print("Exception when calling BatchV1Api->read_namespaced_job_status: %s\n" % e)
+
+ pprint(api_response)
+ if api_response.status.succeeded == 1:
+ job_status_type = api_response.status.conditions[0].type
+ if job_status_type == "Complete":
+ job_status = True
+
+ print("[DBG] jobStatus: " + unicode(job_status))
+ return job_status
+
+
+ def main(args):
+ for job_name in args:
+ timeout = time.time() + 60 * 10
+ while True:
+ ready = is_ready(job_name)
+ if ready is True :
+ break
+ elif time.time() > timeout:
+ log.warning( "timed out waiting for '" + job_name + "' to be ready")
+ exit(1)
+ else:
+ time.sleep(5)
+
+
+ if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description='Process some names.')
+ parser.add_argument('--job-name', action='append', required=True, help='A container name')
+ args = parser.parse_args()
+ arg_dict = vars(args)
+
+ for arg in arg_dict.itervalues():
+ main(arg)
diff --git a/sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-environment-configmap.yaml b/sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-environment-configmap.yaml
new file mode 100644
index 0000000000..966180022b
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/configmaps/sdc-environment-configmap.yaml
@@ -0,0 +1,99 @@
+---
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: sdc-environment
+ namespace: onap-sdc
+data:
+ AUTO.json: |
+ {
+ "name": "{{ .Values.env.name }}",
+ "description": "OpenSource-{{ .Values.env.name }}",
+ "cookbook_versions": {
+ "Deploy-SDandC": "= 1.0.0"
+ },
+ "json_class": "Chef::Environment",
+ "chef_type": "environment",
+
+ "default_attributes": {
+ "CS_VIP": "{{ .Values.env.vip }}",
+ "BE_VIP": "{{ .Values.env.vip }}",
+ "FE_VIP": "{{ .Values.env.vip }}",
+ "ES_VIP": "{{ .Values.env.vip }}",
+ "interfaces": {
+ "application": "eth0",
+ "private": "eth0"
+ },
+ "ECompP": {
+ "ecomp_rest_url": "http://portalapps.onap-portal:8989/ONAPPORTAL/auxapi",
+ "ueb_url_list": "dmaap.onap-message-router,dmaap.onap-message-router",
+ "app_secret": "XftIATw9Jr3VzAcPqt3NnJOu",
+ "app_key": "x9UfO7JsDn8BESVX",
+ "inbox_name": "ECOMP-PORTAL-INBOX",
+ "ecomp_redirect_url": "http://portalapps.onap-portal:8989/ONAPPORTAL/login.htm",
+ "app_topic_name": "ECOMP-PORTAL-OUTBOX-SDC1",
+ "decryption_key": "AGLDdG4D04BKm2IxIWEr8o=="
+ },
+ "UEB": {
+ "PublicKey": "iPIxkpAMI8qTcQj8",
+ "SecretKey": "Ehq3WyT4bkif4zwgEbvshGal",
+ "fqdn": ["dmaap.onap-message-router", "dmaap.onap-message-router"]
+ },
+ "Nodes": {
+ "CS": "{{ .Values.env.nodeCS }}",
+ "BE": "{{ .Values.env.nodeBE }}",
+ "FE": "{{ .Values.env.nodeFE }}",
+ "ES": "{{ .Values.env.nodeES }}"
+ },
+ "Designers": {
+ "DCAE": {
+ "dcae_host": "yyy",
+ "dcae_port": "yyy",
+ "dcae_path": "yyy",
+ "dcae_protocol": "yyy"
+ },
+ "WORKFLOW": {
+ "workflow_host": "yyy",
+ "workflow_port": "yyy",
+ "workflow_path": "yyy",
+ "workflow_protocol": "yyy"
+ }
+ }
+ },
+ "override_attributes": {
+ "FE": {
+ "http_port": "8181",
+ "https_port": "9443"
+ },
+ "BE": {
+ "http_port": "8080",
+ "https_port": "8443"
+ },
+ "elasticsearch": {
+ "cluster_name": "SDC-ES-",
+ "ES_path_home": "/usr/share/elasticsearch",
+ "ES_path_data": "/usr/share/elasticsearch/data",
+ "num_of_replicas": "0",
+ "num_of_shards": "1"
+ },
+
+ "cassandra": {
+ "concurrent_reads": "32",
+ "num_tokens": "256",
+ "data_dir": "/var/lib/cassandra/data",
+ "hinted_handoff_enabled": "true",
+ "cassandra_user": "asdc_user",
+ "cassandra_password": "Aa1234%^!",
+ "concurrent_writes": "32",
+ "cluster_name": "SDC-CS-",
+ "multithreaded_compaction": "false",
+ "cache_dir": "/var/lib/cassandra/saved_caches",
+ "log_file": "/var/lib/cassandra/log/system.log",
+ "phi_convict_threshold": "8",
+ "commitlog_dir": "/var/lib/cassandra/commitlog",
+ "socket_read_timeout": "20000",
+ "socket_connect_timeout": "20000",
+ "titan_connection_timeout": "10000"
+ }
+ }
+ }
diff --git a/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-be.yaml b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-be.yaml
new file mode 100644
index 0000000000..ab293c2444
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-be.yaml
@@ -0,0 +1,130 @@
+#{{ if not .Values.disableSdcSdcBe }}
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ labels:
+ app: sdc-be
+ name: sdc-be
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ replicas: 1
+ strategy:
+ type: RollingUpdate
+ rollingUpdate:
+ maxSurge: 2
+ maxUnavailable: 0
+ selector:
+ matchLabels:
+ app: sdc-be
+ template:
+ metadata:
+ annotations:
+ checksum/config: {{ include (print $.Template.BasePath "/configmaps/sdc-environment-configmap.yaml") . | sha256sum }}
+ checksum/config: {{ include (print $.Template.BasePath "/configmaps/sdc-check-job-completion.yaml") . | sha256sum }}
+ labels:
+ app: sdc-be
+ name: sdc-be
+ spec:
+ initContainers:
+ - name: sdc-be-readiness
+ image: {{ .Values.image.readiness }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - sdc-es
+ - --container-name
+ - sdc-cs
+ - --container-name
+ - sdc-kb
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ - name: sdc-job-completion
+ image: {{ .Values.image.readiness }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ command:
+ - python
+ args:
+ - /root/readiness/sdc_check_job_completion.py
+ - --job-name
+ - sdc-config-cassandra
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ volumeMounts:
+ - mountPath: /root/readiness
+ name: sdc-check-job-completion
+ containers:
+ - name: sdc-be
+ image: {{ .Values.image.sdcBackend }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ ports:
+ - containerPort: 8443
+ - containerPort: 8080
+ volumeMounts:
+ - mountPath: /usr/share/elasticsearch/data/
+ name: sdc-sdc-es-es
+ - mountPath: /root/chef-solo/environments/
+ name: sdc-environments
+ - mountPath: /etc/localtime
+ name: sdc-localtime
+ readOnly: true
+ - mountPath: /var/lib/jetty/logs
+ name: sdc-logs
+ - mountPath: /var/log/onap
+ name: sdc-logs-2
+ - mountPath: /tmp/logback.xml
+ name: sdc-logback
+ env:
+ - name: ENVNAME
+ value: AUTO
+ - name: HOST_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ lifecycle:
+ postStart:
+ exec:
+ command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/catalog-be/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
+ readinessProbe:
+ tcpSocket:
+ port: 8443
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ volumes:
+ - name: filebeat-conf
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+ - name: sdc-logs-2
+ emptyDir: {}
+ - name: sdc-data-filebeat
+ emptyDir: {}
+ - name: sdc-logback
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/sdc/be/logback.xml
+ - name: sdc-sdc-es-es
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-es/ES
+ - name: sdc-environments
+ configMap:
+ name: sdc-environment
+ - name: sdc-localtime
+ hostPath:
+ path: /etc/localtime
+ - name: sdc-logs
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
+ - name: sdc-check-job-completion
+ configMap:
+ name: sdc-check-job-completion
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+#{{ end }}
diff --git a/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-cs.yaml b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-cs.yaml
new file mode 100644
index 0000000000..64d18370e8
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-cs.yaml
@@ -0,0 +1,86 @@
+#{{ if not .Values.disableSdcSdcCs }}
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ labels:
+ app: sdc-cs
+ name: sdc-cs
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ selector:
+ matchLabels:
+ app: sdc-cs
+ template:
+ metadata:
+ labels:
+ app: sdc-cs
+ name: sdc-cs
+ spec:
+ initContainers:
+ - command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - sdc-es
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ image: {{ .Values.image.readiness }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ name: sdc-cs-readiness
+ containers:
+ - name: sdc-cs
+ image: {{ .Values.image.sdcCassandra }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ env:
+ - name: ENVNAME
+ value: AUTO
+ - name: HOST_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: ES_HEAP_SIZE
+ value: "1024M"
+ - name: CS_PASSWORD
+ valueFrom:
+ secretKeyRef: {name: sdc-cs-secret, key: cs_password}
+ volumeMounts:
+ - mountPath: /var/lib/cassandra/
+ name: sdc-sdc-cs-cs
+ - mountPath: /root/chef-solo/environments/
+ name: sdc-environments
+ - mountPath: /etc/localtime
+ name: sdc-localtime
+ readOnly: true
+ - mountPath: /var/lib/jetty/logs
+ name: sdc-logs
+ ports:
+ - containerPort: 9042
+ - containerPort: 9160
+ readinessProbe:
+ exec:
+ command:
+ - /bin/sh
+ - -c
+ - /var/lib/ready/probe.sh
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ volumes:
+ - name: sdc-sdc-cs-cs
+ persistentVolumeClaim:
+ claimName: sdc-cs-db
+ - name: sdc-environments
+ configMap:
+ name: sdc-environment
+ - name: sdc-localtime
+ hostPath:
+ path: /etc/localtime
+ - name: sdc-logs
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+#{{ end }}
diff --git a/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-es.yaml b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-es.yaml
new file mode 100644
index 0000000000..d673e40d2e
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-es.yaml
@@ -0,0 +1,63 @@
+#{{ if not .Values.disableSdcSdcEs }}
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ labels:
+ app: sdc-es
+ name: sdc-es
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ selector:
+ matchLabels:
+ app: sdc-es
+ template:
+ metadata:
+ labels:
+ app: sdc-es
+ name: sdc-es
+ spec:
+ containers:
+ - image: {{ .Values.image.sdcElasticsearch }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ name: sdc-es
+ env:
+ - name: ENVNAME
+ value: "AUTO"
+ - name: HOST_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: ES_HEAP_SIZE
+ value: "1024M"
+ volumeMounts:
+ - mountPath: /root/chef-solo/environments/
+ name: sdc-environments
+ - mountPath: /etc/localtime
+ name: sdc-localtime
+ readOnly: true
+ - mountPath: /var/lib/jetty/logs
+ name: sdc-logs
+ ports:
+ - containerPort: 9200
+ - containerPort: 9300
+ readinessProbe:
+ httpGet:
+ path: "_cluster/health?wait_for_status=yellow&timeout=120s"
+ port: 9200
+ scheme: HTTP
+ initialDelaySeconds: 60
+ timeoutSeconds: 5
+ periodSeconds: 5
+ volumes:
+ - name: sdc-environments
+ configMap:
+ name: sdc-environment
+ - name: sdc-localtime
+ hostPath:
+ path: /etc/localtime
+ - name: sdc-logs
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+#{{ end }}
diff --git a/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-fe.yaml b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-fe.yaml
new file mode 100644
index 0000000000..c21efdcb8f
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-fe.yaml
@@ -0,0 +1,107 @@
+#{{ if not .Values.disableSdcSdcFe }}
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ labels:
+ app: sdc-fe
+ name: sdc-fe
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ selector:
+ matchLabels:
+ app: sdc-fe
+ template:
+ metadata:
+ labels:
+ app: sdc-fe
+ name: sdc-fe
+ spec:
+ initContainers:
+ - command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - sdc-es
+ - --container-name
+ - sdc-cs
+ - --container-name
+ - sdc-kb
+ - --container-name
+ - sdc-be
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ image: {{ .Values.image.readiness }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ name: sdc-fe-readiness
+ volumes:
+# - name: filebeat-conf
+# hostPath:
+# path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+ - name: sdc-logs-2
+ emptyDir: {}
+ - name: sdc-data-filebeat
+ emptyDir: {}
+# - name: sdc-logback
+# hostPath:
+# path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/sdc/fe/logback.xml
+# - name: sdc-sdc-es-es
+# hostPath:
+# path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-es/ES
+ - name: sdc-environments
+ configMap:
+ name: sdc-environment
+ - name: sdc-localtime
+ hostPath:
+ path: /etc/localtime
+# - name: sdc-logs
+# hostPath:
+# path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
+# - name: sdc-fe-config
+# hostPath:
+# path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-fe/FE_2_setup_configuration.rb
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+ containers:
+ - name: sdc-fe
+ env:
+ - name: ENVNAME
+ value: AUTO
+ - name: HOST_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ image: {{ .Values.image.sdcFrontend }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ volumeMounts:
+# - mountPath: /usr/share/elasticsearch/data/
+# name: sdc-sdc-es-es
+ - mountPath: /root/chef-solo/environments/
+ name: sdc-environments
+ - mountPath: /etc/localtime
+ name: sdc-localtime
+ readOnly: true
+# - mountPath: /var/lib/jetty/logs
+# name: sdc-logs
+# - mountPath: /var/log/onap
+# name: sdc-logs-2
+# - mountPath: /root/chef-solo/cookbooks/sdc-catalog-fe/recipes/FE_2_setup_configuration.rb
+# name: sdc-fe-config
+# - mountPath: /tmp/logback.xml
+# name: sdc-logback
+ lifecycle:
+ postStart:
+ exec:
+ command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/catalog-fe/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
+ ports:
+ - containerPort: 9443
+ - containerPort: 8181
+ readinessProbe:
+ tcpSocket:
+ port: 8181
+ initialDelaySeconds: 5
+ periodSeconds: 10
+#{{ end }}
diff --git a/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-kb.yaml b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-kb.yaml
new file mode 100644
index 0000000000..5c7f4a4614
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-kb.yaml
@@ -0,0 +1,72 @@
+#{{ if not .Values.disableSdcSdcKb }}
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ labels:
+ app: sdc-kb
+ name: sdc-kb
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ selector:
+ matchLabels:
+ app: sdc-kb
+ template:
+ metadata:
+ labels:
+ app: sdc-kb
+ name: sdc-kb
+ spec:
+ initContainers:
+ - command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - sdc-es
+ - --container-name
+ - sdc-cs
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ image: {{ .Values.image.readiness }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ name: sdc-kb-readiness
+ containers:
+ - env:
+ - name: ENVNAME
+ value: AUTO
+ - name: ELASTICSEARCH_URL
+ value: http://sdc-es:9200
+ image: {{ .Values.image.sdcKibana }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ name: sdc-kb
+ volumeMounts:
+ - mountPath: /root/chef-solo/environments/
+ name: sdc-environments
+ - mountPath: /etc/localtime
+ name: sdc-localtime
+ readOnly: true
+ - mountPath: /var/lib/jetty/logs
+ name: sdc-logs
+ ports:
+ - containerPort: 5601
+ readinessProbe:
+ tcpSocket:
+ port: 5601
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ volumes:
+ - name: sdc-environments
+ configMap:
+ name: sdc-environment
+ - name: sdc-localtime
+ hostPath:
+ path: /etc/localtime
+ - name: sdc-logs
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+#{{ end }}
diff --git a/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-pv-pvc.yaml b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-pv-pvc.yaml
new file mode 100644
index 0000000000..c8ce9531c2
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/deployments/sdc-pv-pvc.yaml
@@ -0,0 +1,32 @@
+#{{ if not .Values.disableSdcSdcCs }}
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: "{{ .Values.nsPrefix }}-sdc-cs-db"
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+ labels:
+ name: "{{ .Values.nsPrefix }}-sdc-cs-db"
+spec:
+ capacity:
+ storage: 2Gi
+ accessModes:
+ - ReadWriteMany
+ persistentVolumeReclaimPolicy: Retain
+ hostPath:
+ path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-cs/CS
+---
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: sdc-cs-db
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ accessModes:
+ - ReadWriteMany
+ resources:
+ requests:
+ storage: 2Gi
+ selector:
+ matchLabels:
+ name: "{{ .Values.nsPrefix }}-sdc-cs-db"
+#{{ end }} \ No newline at end of file
diff --git a/sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-cs.yaml b/sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-cs.yaml
new file mode 100644
index 0000000000..e371b43377
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-cs.yaml
@@ -0,0 +1,53 @@
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: sdc-config-cassandra
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+ labels:
+ app: sdc-config-cassandra
+spec:
+ template:
+ metadata:
+ name: sdc-cs-init
+ spec:
+ initContainers:
+ - name: sdc-init-cs-readiness
+ image: {{ .Values.image.readiness }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - sdc-cs
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ containers:
+ - name: sdc-config-cs
+ image: {{ .Values.image.sdcCassandraInit }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ ports:
+ - containerPort: 8080
+ volumeMounts:
+ - mountPath: /root/chef-solo/environments/
+ name: sdc-environments
+ env:
+ - name: ENVNAME
+ value: "AUTO"
+ - name: SDC_USER
+ valueFrom:
+ secretKeyRef: {name: sdc-cs-secret, key: sdc_user}
+ - name: SDC_PASSWORD
+ valueFrom:
+ secretKeyRef: {name: sdc-cs-secret, key: sdc_password}
+ volumes:
+ - name: sdc-environments
+ configMap:
+ name: sdc-environment
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+ restartPolicy: Never
diff --git a/sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-es.yaml b/sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-es.yaml
new file mode 100644
index 0000000000..e0f6466636
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/jobs/sdc-config-es.yaml
@@ -0,0 +1,47 @@
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: sdc-config-elasticsearch
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+ labels:
+ app: sdc-config-elasticsearch
+spec:
+ template:
+ metadata:
+ name: sdc-es-init
+ spec:
+ initContainers:
+ - name: sdc-init-es-readiness
+ image: {{ .Values.image.readiness }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - sdc-es
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ containers:
+ - name: sdc-config-es
+ image: {{ .Values.image.sdcElasticsearchInit }}
+ imagePullPolicy: {{ .Values.pullPolicy }}
+ ports:
+ - containerPort: 8080
+ volumeMounts:
+ - mountPath: /root/chef-solo/environments/
+ name: sdc-environments
+ env:
+ - name: ENVNAME
+ value: "AUTO"
+ volumes:
+ - name: sdc-environments
+ configMap:
+ name: sdc-environment
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+ restartPolicy: Never
diff --git a/sdc-os-chef/kubernetes/sdc/templates/secrets/sdc-cs-secret.yaml b/sdc-os-chef/kubernetes/sdc/templates/secrets/sdc-cs-secret.yaml
new file mode 100644
index 0000000000..2e63c60538
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/secrets/sdc-cs-secret.yaml
@@ -0,0 +1,14 @@
+---
+apiVersion: v1
+kind: Secret
+metadata:
+ name: sdc-cs-secret
+ namespace: onap-sdc
+type: Opaque
+data:
+ #application user
+ sdc_user: YXNkY191c2Vy
+ sdc_password: QWExMjM0JV4h
+ #default user:
+ cs_password: b25hcDEyMyNAIQ==
+
diff --git a/sdc-os-chef/kubernetes/sdc/templates/services/all-services.yaml b/sdc-os-chef/kubernetes/sdc/templates/services/all-services.yaml
new file mode 100644
index 0000000000..4100dc24a4
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/templates/services/all-services.yaml
@@ -0,0 +1,127 @@
+#{{ if not .Values.disableSdcSdcEs }}
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: sdc-es
+ name: sdc-es
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ ports:
+ - name: sdc-es-port-9200
+ port: 9200
+ - name: sdc-es-port-9300
+ port: 9300
+ selector:
+ app: sdc-es
+ clusterIP: None
+#{{ end }}
+#{{ if not .Values.disableSdcSdcCs }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: sdc-cs
+ name: sdc-cs
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ ports:
+ - name: sdc-cs-port-9042
+ port: 9042
+ - name: sdc-cs-port-9160
+ port: 9160
+ selector:
+ app: sdc-cs
+ clusterIP: None
+#{{ end }}
+#{{ if not .Values.disableSdcSdcKb }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: sdc-kb
+ name: sdc-kb
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+spec:
+ ports:
+ - name: sdc-kb-port-5601
+ port: 5601
+ selector:
+ app: sdc-kb
+ clusterIP: None
+#{{ end }}
+#{{ if not .Values.disableSdcSdcBe }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: sdc-be
+ name: sdc-be
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+ annotations:
+ msb.onap.org/service-info: '[
+ {
+ "serviceName": "sdc",
+ "version": "v1",
+ "url": "/sdc/v1",
+ "protocol": "REST",
+ "port": "8080",
+ "visualRange":"1"
+ },
+ {
+ "serviceName": "sdc-deprecated",
+ "version": "v1",
+ "url": "/sdc/v1",
+ "protocol": "REST",
+ "port": "8080",
+ "visualRange":"1",
+ "path":"/sdc/v1"
+ }
+ ]'
+spec:
+ ports:
+ - name: sdc-be-port-8443
+ nodePort: {{ .Values.nodePortPrefix }}04
+ port: 8443
+ - name: sdc-be-port-8080
+ nodePort: {{ .Values.nodePortPrefix }}05
+ port: 8080
+ selector:
+ app: sdc-be
+ type: NodePort
+#{{ end }}
+#{{ if not .Values.disableSdcSdcFe }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: sdc-fe
+ name: sdc-fe
+ namespace: "{{ .Values.nsPrefix }}-sdc"
+ annotations:
+ msb.onap.org/service-info: '[
+ {
+ "serviceName": "sdc-gui",
+ "version": "v1",
+ "url": "/sdc1",
+ "protocol": "UI",
+ "port": "8181",
+ "visualRange":"0|1"
+ }
+ ]'
+spec:
+ ports:
+ - name: sdc-fe-port-9443
+ nodePort: {{ .Values.nodePortPrefix }}07
+ port: 9443
+ - name: sdc-fe-port-8181
+ nodePort: {{ .Values.nodePortPrefix }}06
+ port: 8181
+ selector:
+ app: sdc-fe
+ type: NodePort
+#{{ end }} \ No newline at end of file
diff --git a/sdc-os-chef/kubernetes/sdc/values.yaml b/sdc-os-chef/kubernetes/sdc/values.yaml
new file mode 100644
index 0000000000..a6950b262b
--- /dev/null
+++ b/sdc-os-chef/kubernetes/sdc/values.yaml
@@ -0,0 +1,21 @@
+nsPrefix: onap
+pullPolicy: IfNotPresent
+nodePortPrefix: 302
+image:
+ readiness: oomk8s/readiness-check:1.0.0
+ sdcKibana: nexus3.onap.org:10001/onap/sdc-kibana:1.2-STAGING-latest
+ sdcFrontend: nexus3.onap.org:10001/onap/sdc-frontend:1.2-STAGING-latest
+ sdcElasticsearch: nexus3.onap.org:10001/onap/sdc-elasticsearch:1.2.0-STAGING-latest
+ sdcCassandra: nexus3.onap.org:10001/onap/sdc-cassandra:1.2.0-STAGING-latest
+ sdcBackend: nexus3.onap.org:10001/onap/sdc-backend:1.2-STAGING-latest
+ sdcElasticsearchInit: nexus3.onap.org:10001/onap/sdc-init-elasticsearch:1.2-STAGING-latest
+ sdcCassandraInit: vulpe03/cqlsh
+ filebeat: docker.elastic.co/beats/filebeat:5.5.0
+
+env:
+ name: AUTO
+ vip: sdc-cs.onap-sdc
+ nodeCS: sdc-cs.onap-sdc
+ nodeES: sdc-es.onap-sdc
+ nodeBE: sdc-be.onap-sdc
+ nodeFe: sdc-fe.onap-sdc \ No newline at end of file