adding node 96/296/3
authorNaga Sugguna <ns156u@att.com>
Tue, 16 Oct 2018 18:36:28 +0000 (14:36 -0400)
committerNaga Sugguna <ns156u@att.com>
Wed, 17 Oct 2018 13:56:37 +0000 (09:56 -0400)
hpgen10 updated as a 3 node cluster
1prom-gens.sh fixed not cleanup certificates everytime
transfer.sh created just to transfer files genesis node and update setting for newly added nodes.

Change-Id: I3c47848c858c1e108de60e3b82e815a9d0a3eb32

hpgen10.yaml
scripts/update_bios_settings.py
site/hpgen10/baremetal/promjoin.yaml
site/hpgen10/baremetal/rack.yaml
site/hpgen10/pki/pki-catalog.yaml
tools/1prom-gen.sh
tools/transfer.sh [new file with mode: 0644]

index bde76bf..a2aff22 100644 (file)
@@ -245,16 +245,16 @@ masters:
     neutron: 10.0.101.32
     oob_user: Administrator
     oob_password: Admin123
-workers:
-  - name : aknode33
-    oob: 192.168.41.133
-    host: 192.168.2.33
-    storage: 172.31.1.33
-    pxe: 172.30.1.33
-    ksn: 172.29.1.33
-    neutron: 10.0.101.33
-    oob_user: Administrator
-    oob_password: Admin123
+#workers:
+#  - name : aknode33
+#    oob: 192.168.41.133
+#    host: 192.168.2.33
+#    storage: 172.31.1.33
+#    pxe: 172.30.1.33
+#    ksn: 172.29.1.33
+#    neutron: 10.0.101.33
+#    oob_user: Administrator
+#    oob_password: Admin123
 #  - name : aknode34
 #    oob: 192.168.41.134
 #    host: 192.168.2.34
index 146717e..f15c07b 100644 (file)
@@ -49,8 +49,11 @@ def create_rc_masters(source, target_suffix):
     data = template.render(yaml=master)
     target_file = "server-config/"+master['name']+target_suffix
     print target_file
+    if os.path.exists(target_file):
+      print 'rc file exists maynot be new node'
+      continue
     if not os.path.exists(os.path.dirname(target_file)):
-     os.makedirs(os.path.dirname(target_file))
+      os.makedirs(os.path.dirname(target_file))
     fd2 = open(target_file,'w')
     fd2.write(data)
     fd2.write("\n")
@@ -72,8 +75,11 @@ def create_rc_workers(source, target_suffix):
       data = template.render(yaml=master)
       target_file = "server-config/"+master['name']+target_suffix
       print target_file
+      if os.path.exists(target_file):
+        print 'rc file exists maynot be new node'
+        continue
       if not os.path.exists(os.path.dirname(target_file)):
-       os.makedirs(os.path.dirname(target_file))
+        os.makedirs(os.path.dirname(target_file))
       fd2 = open(target_file,'w')
       fd2.write(data)
       fd2.write("\n")
index 2ffcdef..8932c1e 100644 (file)
@@ -34,7 +34,6 @@ data:
         node_names:
           - 'aknode31'
           - 'aknode32'
-          - 'aknode33'
   # TODO(alanmeadows) move what is global about this document - everything except nodenames to global
   assets:
     - path: /opt/promjoin.sh
index 843bfcd..58bcb28 100644 (file)
@@ -96,38 +96,4 @@ data:
     rack: RACK01
     tags:
       - 'masters'
----
-schema: 'drydock/BaremetalNode/v1'
-metadata:
-  schema: 'metadata/Document/v1'
-  name: aknode33
-  layeringDefinition:
-    abstract: false
-    layer: site
-  storagePolicy: cleartext
-data:
-  host_profile: ComputePlane
-  # the hostname for a server, could be used in multiple DNS domains to
-  # represent different interfaces
-  addressing:
-      # Which network the address applies to. If a network appears in addressing
-      # that isn't assigned to an interface, design validation will fail
-    - network: oob
-      address: 192.168.41.133
-    - network: pxe
-      # The address assigned. Either a explicit IPv4 or IPv6 address
-      # or dhcp or slaac
-      address: 172.30.1.33
-    - network: oam
-      address: 192.168.2.33
-    - network: storage
-      address: 172.31.1.33
-    - network: overlay
-      address: 10.0.101.33
-    - network: calico
-      address: 172.29.1.33
-  metadata:
-    rack: RACK01
-    tags:
-      - 'workers'
 ...
index a0ea7ee..cce0cb4 100644 (file)
@@ -73,15 +73,6 @@ data:
             - 172.30.1.32
           groups:
             - system:nodes
-        - document_name: kubelet-aknode33
-          common_name: system:node:aknode33
-          hosts:
-            - aknode33
-            - 192.168.2.33
-            - 172.29.1.33
-            - 172.30.1.33
-          groups:
-            - system:nodes
         - document_name: scheduler
           description: Service certificate for Kubernetes scheduler
           common_name: system:kube-scheduler
index 6aef8ba..2665e87 100755 (executable)
@@ -138,9 +138,7 @@ ENDKEY
    systemctl restart docker || true
 }
 
-cleanup() {
-   rm -rf ./tars/$SITE/configs/promenade
-   rm -rf ./tars/$SITE/configs/promenade-bundle
+create_directories() {
    mkdir -p ./tars/$SITE/configs/promenade
    mkdir -p ./tars/$SITE/configs/promenade-bundle
 }
@@ -186,7 +184,7 @@ prepare_tar(){
 }
 
 #install_docker
-cleanup
+create_directories
 get_site_config
 gen_certs
 gen_bundle
diff --git a/tools/transfer.sh b/tools/transfer.sh
new file mode 100644 (file)
index 0000000..d4993df
--- /dev/null
@@ -0,0 +1,54 @@
+#!/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.                                             #
+##############################################################################
+
+set -x
+TIMESTAMP=$(date +"%Y%m%d%H%M")
+echo "Logging to /var/log/yaml_builds/transfer_$TIMESTAMP.log"
+exec > /var/log/yaml_builds/transfer_$TIMESTAMP.log
+exec 2>&1
+
+source $(dirname $0)/setenv.sh
+
+if [ -z "$1" ]
+then
+  echo "Please pass site name as command line argument"
+  exit -2
+else
+  SITE=${SITE:-$1}
+  echo "SITE=$SITE"
+fi
+
+if [ -z "$YAML_BUILDS" ]
+then
+  echo "Please set YAML_BUILDS"
+  exit -3
+fi
+
+
+source $(dirname $0)/env_$SITE.sh
+
+cd $YAML_BUILDS
+
+scp $YAML_BUILDS/tars/promenade-bundle-$SITE.tar $GENESIS_HOST:/tmp/
+ssh $GENESIS_HOST << EOF
+  # TODO avoid following hard coding$
+  cp /tmp/promenade-bundle-$SITE.tar /root/akraino/
+  cd /root/akraino/
+  tar -xmf promenade-bundle-$SITE.tar
+EOF
+# Update BIOS Setting
+python $YAML_BUILDS/scripts/update_bios_settings.py $SITE.yaml