#!/bin/bash #author: tmade #version: 1.3 VERSION="1.6.3" USER="kubernetes" HOME="/home/${USER}" FILE="${HOME}/kubernetes-ingress" if [ -d ${FILE} ] then echo "" echo "${FILE} exists, renaming..." echo "" mv ${FILE} ${FILE}.bak else echo "" echo "Downloading Ingress..." echo "" fi cd ${HOME} git clone https://github.com/nginxinc/kubernetes-ingress/ cd kubernetes-ingress/deployments git checkout v${VERSION} chown -R ${USER}:${USER} ${FILE} echo "" echo "Configure RBAC" echo "" su - ${USER} -c "kubectl apply -f ~/kubernetes-ingress/deployments/common/ns-and-sa.yaml" echo "" echo "create cluster roole" echo "" su - ${USER} -c "kubectl apply -f ~/kubernetes-ingress/deployments/rbac/rbac.yaml" echo "" echo "create default secret" echo "" su - ${USER} -c "kubectl apply -f ~/kubernetes-ingress/deployments/common/default-server-secret.yaml" echo "" echo "create config map" echo "" su - ${USER} -c "kubectl apply -f ~/kubernetes-ingress/deployments/common/nginx-config.yaml" echo "" echo "create custom-resource-definitions" echo "" su - ${USER} -c "kubectl apply -f ~/kubernetes-ingress/deployments/common/custom-resource-definitions.yaml" echo "" echo "Run the Ingress Controller" echo "" #kubectl apply -f deployment/nginx-ingress.yaml su - ${USER} -c "kubectl apply -f ~/kubernetes-ingress/deployments/daemon-set/nginx-ingress.yaml" echo "" echo "Ingress Controller has been installed." echo "" echo "Status - please press \"ctrl + c\" when all pods are running" echo "" watch kubectl get pods -A -o wide