aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMandeep Khinda <mandeep.khinda@amdocs.com>2017-09-21 18:22:10 +0000
committerMandeep Khinda <mandeep.khinda@amdocs.com>2017-09-21 20:27:26 +0000
commitde8d47e2497260fbe0530faf43eb51a074beef78 (patch)
treeaa6255626d9b61224fb1a419ce56a5f66086b43a
parent3e130463a0062cdb7aef9717c46ee5bc9958a32e (diff)
dcaegen2 bootstrap container in K8s
launching the dcaegen2 bootstrap container in OOM K8s. -based on dcaegen2/deployments/bootstrap/README-docker.md -requires an openstack private key pair file locally -requires mining and updating a yaml configuration file as per the comments in the sample file given. -unfortunately, my attempts to bundle the secret and configmap in the helm package didn't work out as they are external files so I create them using the createAll.bash script. Issue-ID: OOM-107 Change-Id: I221f60af66ea0f7e97ddd8b92819dce9aa6b5a81 Signed-off-by: Mandeep Khinda <mandeep.khinda@amdocs.com>
-rw-r--r--kubernetes/dcaegen2/.helmignore22
-rw-r--r--kubernetes/dcaegen2/Chart.yaml4
-rw-r--r--kubernetes/dcaegen2/dcae-parameters-sample.yaml41
-rw-r--r--kubernetes/dcaegen2/templates/pod.yaml28
-rw-r--r--kubernetes/dcaegen2/values.yaml6
-rwxr-xr-xkubernetes/oneclick/createAll.bash35
-rw-r--r--kubernetes/oneclick/setenv.bash9
7 files changed, 144 insertions, 1 deletions
diff --git a/kubernetes/dcaegen2/.helmignore b/kubernetes/dcaegen2/.helmignore
new file mode 100644
index 0000000000..a7adb75030
--- /dev/null
+++ b/kubernetes/dcaegen2/.helmignore
@@ -0,0 +1,22 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+dcae-parameters-sample.yaml \ No newline at end of file
diff --git a/kubernetes/dcaegen2/Chart.yaml b/kubernetes/dcaegen2/Chart.yaml
new file mode 100644
index 0000000000..4ab4f859c7
--- /dev/null
+++ b/kubernetes/dcaegen2/Chart.yaml
@@ -0,0 +1,4 @@
+apiVersion: v1
+description: DCAE Generation 2 bootstrap container
+name: dcaegen2
+version: 1.1.0
diff --git a/kubernetes/dcaegen2/dcae-parameters-sample.yaml b/kubernetes/dcaegen2/dcae-parameters-sample.yaml
new file mode 100644
index 0000000000..b2cffae46b
--- /dev/null
+++ b/kubernetes/dcaegen2/dcae-parameters-sample.yaml
@@ -0,0 +1,41 @@
+# UUID of the OpenStack"s CentOS 7 cloud VM image
+# If your Openstack does not have a CentOS 7 cloud image, you will have to add one.
+centos7image_id: "52d4ea09-cc69-4a9a-9961-938a3282d209"
+# UUID of the OpenStack"s Ubuntu 16.04 VM image
+# If your Openstack does not have a buntu 16.04 cloud image, you will have to add one.
+ubuntu1604image_id: "97bbe637-5d42-419a-a2c7-beff33ffa23c"
+# ID of the OpenStack"s VM flavor to be used by DCAEGEN2 VMs (m1.medium/m1.large)
+flavor_id: "4"
+# UUID of the OpenStack"s security group to be used for DCAEGEN2 VMs
+security_group: "abc0687d-34ab-4d37-8fe8-4b544d94ba71"
+# The name of the OpenStack network where public IP addresses and floating IPs are allocated from
+# This must use the name and not the UUID. The name must be unique otherwise the installer fails
+public_net: "public"
+# The name of the OpenStack network where private IP addresses are allocated from
+private_net: "onap_oam"
+# Group header for OpenStack Keystone parameters
+openstack:
+ # User name
+ username: "dev"
+ # Password
+ password: "dev"
+ # Name of the OpenStack tenant/project where DCAEGEN2 VMs are deployed
+ tenant_name: "dev"
+ # Openstack authentication API URL, for example "https://horizon.playground.onap.org:5000/v2.0"
+ auth_url: "http://1.2.3.4:5000/v2.0"
+ # Name of the OpenStack region where DCAEGEN2 VMs are deployed, for example "RegionOne"
+ region: "RegionOne"
+# Name of the public key uploaded to OpenStack in the Prepration step
+keypair: "dcae-g2"
+# Path to the private key within the conatiner (!! Do not change!!)
+key_filename: "/opt/dcae/key"
+# Prefix (location code) of all DCAEGEN2 VMs
+location_prefix: "onapr1"
+# Domain name of the OpenStack tenant "onapr1.playground.onap.org"
+location_domain: "onap-dcaegen2"
+# Location of the raw artifact repo hosting additional boot scripts called by DCAEGEN2 VMs" cloud-init, for example: "https://nexus.onap.org/service/local/repositories/raw/content"
+codesource_url: "https://nexus.onap.org/content/sites/raw"
+# Path to the boot scripts within the raw artifact repo, for example: "org.onap.dcaegen2.deployments.scripts/releases/"
+codesource_version: "org.onap.dcaegen2.deployments/releases/scripts/"
+
+
diff --git a/kubernetes/dcaegen2/templates/pod.yaml b/kubernetes/dcaegen2/templates/pod.yaml
new file mode 100644
index 0000000000..e275ff671d
--- /dev/null
+++ b/kubernetes/dcaegen2/templates/pod.yaml
@@ -0,0 +1,28 @@
+apiVersion: v1
+kind: Pod
+metadata:
+ name: {{ .Chart.Name }}
+ namespace: "{{ .Values.nsPrefix }}-dcaegen2"
+spec:
+ containers:
+ - name: {{ .Chart.Name }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ volumeMounts:
+ - name: installer-config-mount
+ mountPath: /opt/app/installer/config
+ readOnly: true
+ env:
+ - name: LOCATION
+ value: "{{ .Values.location }}"
+ volumes:
+ - name: installer-config-mount
+ projected:
+ sources:
+ - secret:
+ name: "{{ .Chart.Name }}-openstack-ssh-private-key"
+ - configMap:
+ name: "{{ .Chart.Name }}-config-inputs"
+ imagePullSecrets:
+ - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+ restartPolicy: Never \ No newline at end of file
diff --git a/kubernetes/dcaegen2/values.yaml b/kubernetes/dcaegen2/values.yaml
new file mode 100644
index 0000000000..5d446c8c41
--- /dev/null
+++ b/kubernetes/dcaegen2/values.yaml
@@ -0,0 +1,6 @@
+nsPrefix: onap
+location: dg2
+image:
+ repository: nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.bootstrap
+ tag: 1.1-latest
+ pullPolicy: Always \ No newline at end of file
diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash
index afe71af8e1..c8810aa615 100755
--- a/kubernetes/oneclick/createAll.bash
+++ b/kubernetes/oneclick/createAll.bash
@@ -39,11 +39,46 @@ create_registry_key() {
check_return_code $cmd
}
+configure_dcaegen2() {
+ if [ ! -s "$OPENSTACK_PRIVATE_KEY_PATH" ]
+ then
+ echo "ERROR: $OPENSTACK_PRIVATE_KEY_PATH does not exist or is empty. Cannot launch dcae gen2."
+ return 1
+ fi
+
+ cmd=`echo kubectl --namespace $1-$2 create secret generic $2-openstack-ssh-private-key --from-file=key=${OPENSTACK_PRIVATE_KEY_PATH}`
+ eval ${cmd}
+ check_return_code $cmd
+
+ if [ ! -s "$DCAEGEN2_CONFIG_INPUT_FILE_PATH" ]
+ then
+ echo "ERROR: $DCAEGEN2_CONFIG_INPUT_FILE_PATH does not exist or is empty. Cannot launch dcae gen2."
+ return 1
+ fi
+
+ cmd=`echo kubectl --namespace $1-$2 create configmap $2-config-inputs --from-file=inputs.yaml=${DCAEGEN2_CONFIG_INPUT_FILE_PATH}`
+ eval ${cmd}
+ check_return_code $cmd
+}
+
create_onap_helm() {
HELM_VALUES_ADDITION=""
if [[ ! -z $HELM_VALUES_FILEPATH ]]; then
HELM_VALUES_ADDITION="--values=$HELM_VALUES_FILEPATH"
fi
+ # Have to put a check for dcaegen2 because it requires external files to helm
+ # which should not be part of the Chart.
+ if [ "$2" = "dcaegen2" ];
+ then
+ configure_dcaegen2 $1 $2
+ local result=$?
+ if [ $result -ne 0 ]
+ then
+ echo "ERROR: dcaegen2 failed to configure: Pre-requisites not met. Skipping deploying it and continue"
+ return
+ fi
+ fi
+
cmd=`echo helm install $LOCATION/$2/ --name $1-$2 --namespace $1 --set nsPrefix=$1,nodePortPrefix=$3 ${HELM_VALUES_ADDITION}`
eval ${cmd}
check_return_code $cmd
diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash
index a1aba3daf4..6dfd948924 100644
--- a/kubernetes/oneclick/setenv.bash
+++ b/kubernetes/oneclick/setenv.bash
@@ -1,8 +1,15 @@
#!/bin/bash
# Deploying MSB first and kube2msb last will ensure all the ONAP services can be registered to MSB
-HELM_APPS=('consul' 'msb' 'mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'appc' 'aai' 'sdc' 'dcae' 'log' 'cli' 'multicloud' 'clamp' 'kube2msb')
+HELM_APPS=('consul' 'msb' 'mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'appc' 'aai' 'sdc' 'dcaegen2' 'log' 'cli' 'multicloud' 'clamp' 'kube2msb')
ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001}
ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker}
ONAP_DOCKER_PASS=${ONAP_DOCKER_PASS:-docker}
ONAP_DOCKER_MAIL=${ONAP_DOCKER_MAIL:-$USERNAME@$USERDOMAIN}
+# Openstack key pair private key file location required to enable dcaegen2 installer CRUD operations in your Openstack
+# Ensure you set the name of your keypair in the dcae-parameters.yaml entry "keypair: "dcae-g2"
+# example: export OPENSTACK_PRIVATE_KEY_PATH=/home/user/Downloads/dcae-g2.pem
+OPENSTACK_PRIVATE_KEY_PATH=${OPENSTACK_PRIVATE_KEY_PATH:-~/.ssh/onap_rsa}
+# dcaegen2 bootstrap configuration input yaml file. Start from the sample, and set your environments real values:
+# example: export DCAEGEN2_CONFIG_INPUT_FILE_PATH=/tmp/dcae-parameters.yaml
+DCAEGEN2_CONFIG_INPUT_FILE_PATH=${DCAEGEN2_CONFIG_INPUT_FILE_PATH:-../dcaegen2/dcae-parameters-sample.yaml} \ No newline at end of file