aboutsummaryrefslogtreecommitdiffstats
path: root/kud/hosting_providers/containerized
diff options
context:
space:
mode:
authorRitu Sood <Ritu.Sood@intel.com>2019-10-24 22:22:57 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-24 22:22:57 +0000
commit09aa5765d5667dbe46947dd9d4f41c9063b44646 (patch)
treef9490feb458a64dd4b90628f4ec239fb16d65d2a /kud/hosting_providers/containerized
parenteb414b9d43a9b094ce9445b35933f00343d40b8f (diff)
parent47224ff96fea8e5a4cda20e5211f66adceb87d10 (diff)
Merge "Adding onap4ks installation script in kud containerized installer"
Diffstat (limited to 'kud/hosting_providers/containerized')
-rwxr-xr-xkud/hosting_providers/containerized/installer.sh63
-rw-r--r--kud/hosting_providers/containerized/inventory/group_vars/k8s-cluster.yml9
2 files changed, 69 insertions, 3 deletions
diff --git a/kud/hosting_providers/containerized/installer.sh b/kud/hosting_providers/containerized/installer.sh
index 426c89a0..52fe6279 100755
--- a/kud/hosting_providers/containerized/installer.sh
+++ b/kud/hosting_providers/containerized/installer.sh
@@ -27,7 +27,7 @@ function install_prerequisites {
# _install_ansible() - Install and Configure Ansible program
function _install_ansible {
- local version=$(grep "ansible_version" ${kud_playbooks}/kud-vars.yml | \
+ local version=$(grep "ansible_version" ${kud_playbooks}/kud-vars.yml |
awk -F ': ' '{print $2}')
mkdir -p /etc/ansible/
pip install ansible==$version
@@ -100,6 +100,7 @@ function install_k8s {
# install_addons() - Install Kubenertes AddOns
function install_addons {
+ local plugins_name=$1
source /etc/environment
echo "Installing Kubernetes AddOns"
ansible-galaxy install $verbose -r \
@@ -108,7 +109,7 @@ function install_addons {
ansible-playbook $verbose -i \
$kud_inventory $kud_playbooks/configure-kud.yml | \
tee $cluster_log/setup-kud.log
- for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd}; do
+ for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd $plugins_name}; do
echo "Deploying $addon using configure-$addon.yml playbook.."
ansible-playbook $verbose -i \
$kud_inventory $kud_playbooks/configure-${addon}.yml | \
@@ -188,7 +189,7 @@ function install_pkg {
function install_cluster {
install_k8s $1
- install_addons
+ install_addons $2
echo "installed the addons"
if ${KUD_PLUGIN_ENABLED:-false}; then
install_plugin
@@ -197,18 +198,53 @@ function install_cluster {
_print_kubernetes_info
}
+function usage {
+ echo "installer usage:"
+ echo "./installer.sh --install_pkg - Install the required softwarepackage"
+ echo "./installer.sh --cluster <cluster name> \
+- Install k8s cluster with default plugins"
+ echo "./installer.sh --cluster <cluster name> \
+--plugins <plugin_1 plugin_2> - Install k8s cluster with default plugins \
+and additional plugins such as onap4k8s."
+}
+
+if [ $# -eq 0 ]; then
+ echo "Error: No arguments supplied"
+ usage
+ exit 1
+fi
+
+if [ -z "$1" ]; then
+ echo "Error: Null argument passed"
+ usage
+ exit 1
+fi
if [ "$1" == "--install_pkg" ]; then
export kud_inventory_folder=$kud_folder/inventory
kud_inventory=$kud_inventory_folder/hosts.ini
install_pkg
+ echo "install pkg"
exit 0
fi
if [ "$1" == "--cluster" ]; then
+ if [ -z "${2-}" ]; then
+ echo "Error: Cluster name is null"
+ usage
+ exit 1
+ fi
+
cluster_name=$2
kud_multi_cluster_path=/opt/kud/multi-cluster
cluster_path=$kud_multi_cluster_path/$cluster_name
+ echo $cluster_path
+ if [ ! -d "${cluster_path}" ]; then
+ echo "Error: cluster_path ${cluster_path} doesn't exit"
+ usage
+ exit 1
+ fi
+
cluster_log=$kud_multi_cluster_path/$cluster_name/log
export kud_inventory_folder=$kud_folder/inventory/$cluster_name
kud_inventory=$kud_inventory_folder/hosts.ini
@@ -218,6 +254,27 @@ if [ "$1" == "--cluster" ]; then
cp $kud_multi_cluster_path/$cluster_name/hosts.ini $kud_inventory_folder/
cp -rf $kud_folder/inventory/group_vars $kud_inventory_folder/
+ if [ -n "$3" ]; then
+ if [ "$3" == "--plugins" ]; then
+ if [ -z "${4-}" ]; then
+ echo "Error: plugins arguments is null; Refer the usage"
+ usage
+ exit 1
+ fi
+ plugins_name=${@:4:$#}
+ install_cluster $cluster_name $plugins_name
+ exit 0
+ else
+ echo "Error: cluster argument should have plugins; \
+ Refer the usage"
+ usage
+ exit 1
+ fi
+ fi
install_cluster $cluster_name
exit 0
fi
+
+echo "Error: Refer the installer usage"
+usage
+exit 1
diff --git a/kud/hosting_providers/containerized/inventory/group_vars/k8s-cluster.yml b/kud/hosting_providers/containerized/inventory/group_vars/k8s-cluster.yml
index bc085b4e..31d0d669 100644
--- a/kud/hosting_providers/containerized/inventory/group_vars/k8s-cluster.yml
+++ b/kud/hosting_providers/containerized/inventory/group_vars/k8s-cluster.yml
@@ -71,3 +71,12 @@ local_release_dir: "/tmp/releases"
# cannot access each over via ssh or you want to use local docker
# images as a cache for multiple clusters.
download_localhost: false
+
+# Subnet for cluster IPs
+kube_service_addresses: 10.244.0.0/18
+
+# Subnet for Pod IPs
+kube_pods_subnet: 10.244.64.0/18
+
+# disable localdns cache
+enable_nodelocaldns: false