#!/bin/bash
# Copyright 2019 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.

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
NO_PROMPT=0
RANDOM_PREFIX="ONAP"
RANDOM_STRING="$RANDOM_PREFIX"-`cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 4`

AKS_NAME=
AKS_RESOURCE_GROUP_NAME=
AKS_K8_VERSION=
LOCATION=
AKS_NODE_COUNT=
AKS_NODE_SIZE=
AKS_SERVICE_CIDR=
AKS_POD_CIDR=
AKS_DNS_IP=
AKS_NODE_CIDR=
AKS_NETWORK_NAME=
USER_PUBLIC_IP_PREFIX=
PUBLIC_KEY=
AKS_ADMIN_USER=

function check_required_parameter() {
  # arg1 = parameter
  # arg2 = parameter name
  if [ -z "$1" ]; then
    echo "$2 was not was provided. This parameter is required."
    exit 1
  fi
}

function check_optional_paramater() {
  # arg1 = parameter
  # arg2 = default
  if [ -z "$1" ]; then
    echo "$2"
  else
    echo "$1"
  fi
}


while test $# -gt 0; do
  case "$1" in
    -h|--help)
      echo "./create_aks.sh [options]"
      echo " "
      echo " "
      echo "required:"
      echo "--user-public-ip            public ip that will be granted access to AKS [required]"
      echo "--admin-user                admin user created on AKS nodes [required]"
      echo "--public-key                public key added for admin user [required]"
      echo "-l, --location              location to deploy AKS [required]"
      echo " "
      echo "additional options:"
      echo "-f, --no-prompt             executes with no prompt for confirmation"
      echo "-h, --help                  provide brief overview of script"
      echo "-n, --name                  AKS name [optional]"
      echo "-g, --resource-group        name of resource group that will be created [optional]"
      echo "-s, --size                  azure flavor size for Kube nodes [optional]"
      echo "-v, --kube-version          version of Kubernetes for cluster [optional]"
      echo "-c, --node-count            number of nodes for cluster [optional]"
      echo "--service-cidr              cidr for Kuberenetes services [optional]."
      echo "--dns-ip                    IP for Kuberenetes dns service [optional]. This should be from --service-cidr."
      echo "--pod-cidr                  cidr for Kuberenetes pods [optional]."
      echo "--node-cidr                 cidr for Kuberenetes nodes [optional]."
      echo "--vnet-name                 name of Vnet to create for Kubernetes Cluster [optional]"
      echo ""
      exit 0
      ;;
    -f|--no-prompt)
      shift
      NO_PROMPT=1
      ;;
    -n|--name)
      shift
      AKS_NAME=$1
      shift
      ;;
    -g|--resource-group)
      shift
      AKS_RESOURCE_GROUP_NAME=$1
      shift
      ;;
    -s|--size)
      shift
      AKS_NODE_SIZE=$1
      shift
      ;;
    -l|--location)
      shift
      LOCATION=$1
      shift
      ;;
    -v|--kube-version)
      shift
      AKS_K8_VERSION=$1
      shift
      ;;
    -c|--node-count)
      shift
      AKS_NODE_COUNT=$1
      shift
      ;;
    --service-cidr)
      shift
      AKS_SERVICE_CIDR=$1
      shift
      ;;
    --dns-ip)
      shift
      AKS_DNS_IP=$1
      shift
      ;;
    --pod-cidr)
      shift
      AKS_POD_CIDR=$1
      shift
      ;;
    --node-cidr)
      shift
      AKS_NODE_CIDR=$1
      shift
      ;;
    --vnet-name)
      shift
      AKS_NETWORK_NAME=$1
      shift
      ;;
    --user-public-ip)
      shift
      USER_PUBLIC_IP_PREFIX=$1
      shift
      ;;
    --admin-user)
      shift
      AKS_ADMIN_USER=$1
      shift
      ;;
    --public-key)
      shift
      PUBLIC_KEY=$1
      shift
      ;;
    *)
      echo "Unknown Argument $1. Try running with --help."
      exit 0
      ;;
  esac
done

check_required_parameter "$LOCATION" "--location"
check_required_parameter "$USER_PUBLIC_IP_PREFIX" "--user-public-ip"
check_required_parameter "$AKS_ADMIN_USER" "--admin-user"
check_required_parameter "$PUBLIC_KEY" "--public-key"

AKS_RESOURCE_GROUP_NAME=$(check_optional_paramater "$AKS_RESOURCE_GROUP_NAME" $RANDOM_STRING"-AKSRG")
AKS_NAME=$(check_optional_paramater "$AKS_NAME" $RANDOM_STRING"-AKS")
AKS_NODE_SIZE=$(check_optional_paramater "$AKS_NODE_SIZE" "Standard_DS4_v2")
AKS_POD_CIDR=$(check_optional_paramater "$AKS_POD_CIDR" "168.1.0.0/16")
AKS_NODE_CIDR=$(check_optional_paramater "$AKS_NODE_CIDR" "169.1.0.0/16")
AKS_NETWORK_NAME=$(check_optional_paramater "$AKS_NETWORK_NAME" $RANDOM_STRING"-AKS-VNET")
AKS_SERVICE_CIDR=$(check_optional_paramater "$AKS_SERVICE_CIDR" "170.1.0.0/16")
AKS_DNS_IP=$(check_optional_paramater "$AKS_DNS_IP" "170.1.0.10")
AKS_K8_VERSION=$(check_optional_paramater "$AKS_K8_VERSION" "1.13.5")
AKS_NODE_COUNT=$(check_optional_paramater "$AKS_NODE_COUNT" "7")

if [ $NO_PROMPT = 0 ]; then
  read -p "Would you like to proceed? [y/n]" -n 1 -r
  echo " "
  if [[ ! $REPLY =~ ^[Yy]$ ]]
  then
      exit 0
  fi
fi

set -x
set -e

AKS_SUBNET_NAME=$AKS_NETWORK_NAME"-SUBNET"

echo "Creating AKS Resource Group $AKS_RESOURCE_GROUP_NAME in $LOCATION"
$DIR/create_resource_group.sh "$AKS_RESOURCE_GROUP_NAME" "$LOCATION"

az network vnet create --resource-group "$AKS_RESOURCE_GROUP_NAME" \
                       --name "$AKS_NETWORK_NAME" \
                       --address-prefix "$AKS_NODE_CIDR" \
                       --subnet-name "$AKS_SUBNET_NAME" \
                       --subnet-prefix "$AKS_NODE_CIDR"

AKS_SUBNET_ID=`az network vnet show --resource-group ${AKS_RESOURCE_GROUP_NAME} --name ${AKS_NETWORK_NAME} --query "subnets | [0] | id" --output tsv`

az aks create --name "$AKS_NAME" \
              --resource-group "$AKS_RESOURCE_GROUP_NAME" \
              --disable-rbac \
              --kubernetes-version "$AKS_K8_VERSION" \
              --location "$LOCATION" \
              --node-count "$AKS_NODE_COUNT" \
              --node-vm-size "$AKS_NODE_SIZE" \
              --service-cidr "$AKS_SERVICE_CIDR" \
              --pod-cidr "$AKS_POD_CIDR" \
              --network-plugin "kubenet" \
              --dns-service-ip "$AKS_DNS_IP" \
              --admin-username "$AKS_ADMIN_USER" \
              --ssh-key-value "$PUBLIC_KEY" \
              --vnet-subnet-id "$AKS_SUBNET_ID" \
              --vm-set-type "AvailabilitySet" \
              --load-balancer-sku "basic"
echo ""

AKS_MANAGEMENT_RESOURCE_GROUP_NAME=`az group list --query "[?starts_with(name, 'MC_${AKS_RESOURCE_GROUP_NAME}')].name | [0]" --output tsv`
AKS_NSG_NAME=`az resource list --resource-group ${AKS_MANAGEMENT_RESOURCE_GROUP_NAME} --resource-type "Microsoft.Network/networkSecurityGroups" --query "[0] | name" --output tsv`
AKS_NSG_ID=`az resource list --resource-group ${AKS_MANAGEMENT_RESOURCE_GROUP_NAME} --resource-type "Microsoft.Network/networkSecurityGroups" --query "[0] | id" --output tsv`

echo "Associating Security Group with AKS Subnet ${AKS_SUBNET_NAME}"
az network vnet subnet update --resource-group="$AKS_RESOURCE_GROUP_NAME" \
                              --name "$AKS_SUBNET_NAME" \
                              --vnet-name "$AKS_NETWORK_NAME" \
                              --network-security-group "$AKS_NSG_ID"

for ((i=0;i<$AKS_NODE_COUNT;i++)); do
  NIC_NAME=`az resource list --resource-group ${AKS_MANAGEMENT_RESOURCE_GROUP_NAME} --resource-type "Microsoft.Network/networkInterfaces" --query "[$i] | name" --output tsv`
  echo "Associating Security Group ${AKS_NSG_NAME} with AKS Node NIC ${NIC_NAME}"
  az network nic update --resource-group "$AKS_MANAGEMENT_RESOURCE_GROUP_NAME" -n "$NIC_NAME" --network-security-group "$AKS_NSG_NAME"
  echo ""
done

