Add more Consul registrations 87/41087/1
authorJack Lucas <jflucas@research.att.com>
Wed, 4 Apr 2018 21:47:28 +0000 (21:47 +0000)
committerJack Lucas <jflucas@research.att.com>
Wed, 4 Apr 2018 21:48:08 +0000 (21:48 +0000)
Change-Id: I3d548b26a2868529cf85057aa348b8ce4ba2f6a8
Issue-ID: DCAEGEN2-421
Signed-off-by: Jack Lucas <jflucas@research.att.com>
k8s-bootstrap-container/bootstrap.sh
k8s-bootstrap-container/pom.xml

index 5fc831c..3459edc 100755 (executable)
@@ -1,4 +1,20 @@
 #!/bin/bash
+# ================================================================================
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# 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.
+# ============LICENSE_END=========================================================
+
 # Install DCAE via Cloudify Manager
 # Expects:
 #   CM address (IP or DNS) in CMADDR environment variable
 
 set -ex
 
+# Consul service registration data
 CBS_REG='{"ID": "dcae-cbs0", "Name": "config_binding_service", "Address": "config-binding-service", "Port": 10000}'
+CBS_REG1='{"ID": "dcae-cbs1", "Name": "config-binding-service", "Address": "config-binding-service", "Port": 10000}'
+CM_REG='{"ID": "dcae-cm0", "Name": "cloudify_manager", "Address": "cloudify-manager.onap", "Port": 80}'
+INV_REG='{"ID": "dcae-inv0", "Name": "inventory", "Address": "inventory", "Port": 8080}'
+
+
+
+
+
 # Deploy components
 # $1 -- name (for bp and deployment)
 # $2 -- blueprint name
@@ -19,7 +44,7 @@ CBS_REG='{"ID": "dcae-cbs0", "Name": "config_binding_service", "Address": "confi
 function deploy {
     cfy install -b $1 -d $1 -i /inputs/$3 /blueprints/$2
 }
-# Set up profile to access CMs
+# Set up profile to access Cloudify Manager
 cfy profiles use -u admin -t default_tenant -p "${CMPASS}"  "${CMADDR}"
 
 # Output status, for debugging purposes
@@ -35,8 +60,15 @@ do
     curl -v -X PUT -H "Content-Type: application/json" --data-binary @/tmp/dcae-upload ${CONSUL}/v1/kv/${key}
 done
 
-# For backward compatibility, load config_binding_service into Consul as service
+# For backward compatibility, load some platform services into Consul service registry
+# Some components still rely on looking up a service in Consul
 curl -v -X PUT -H "Content-Type: application/json" --data "${CBS_REG}" ${CONSUL}/v1/agent/service/register
+curl -v -X PUT -H "Content-Type: application/json" --data "${CBS_REG1}" ${CONSUL}/v1/agent/service/register
+curl -v -X PUT -H "Content-Type: application/json" --data "${CM_REG}" ${CONSUL}/v1/agent/service/register
+curl -v -X PUT -H "Content-Type: application/json" --data "${INV_REG}" ${CONSUL}/v1/agent/service/register
+
+# Store the CM password into a Cloudify secret
+cfy secret create -s ${CMPASS} cmpass
 
 # Load plugins onto CM
 # Allow "already loaded" error
index e2645c7..724ada3 100644 (file)
@@ -27,7 +27,7 @@ limitations under the License.
   <groupId>org.onap.dcaegen2.deployments</groupId>
   <artifactId>k8s-bootstrap-container</artifactId>
   <name>dcaegen2-deployments-k8s-bootstrap-container</name>
-  <version>1.1.2</version>
+  <version>1.1.3</version>
   <url>http://maven.apache.org</url>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>