Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active July 20, 2022 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save vfarcic/2fd2229c3235074946269665d0efdfc9 to your computer and use it in GitHub Desktop.
Save vfarcic/2fd2229c3235074946269665d0efdfc9 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/2fd2229c3235074946269665d0efdfc9
####################
# Create a Cluster #
####################
# Only if you did not yet clone that repository
git clone \
https://github.com/vfarcic/devops-catalog-code.git
cd devops-catalog-code
git pull
cd terraform-aks/simple
az login
terraform init
terraform apply \
--var ingress_nginx=true
export KUBECONFIG=$PWD/kubeconfig
kubectl get nodes
cd ../../../
######################
# Ingress Controller #
######################
export INGRESS_HOST=$(kubectl \
--namespace ingress-nginx \
get svc ingress-nginx-controller \
--output jsonpath="{.status.loadBalancer.ingress[0].ip}")
echo $INGRESS_HOST
# Repeat the `export` command if the output is empty
###########
# Argo CD #
###########
helm repo add argo \
https://argoproj.github.io/argo-helm
helm repo update
helm upgrade --install \
argocd argo/argo-cd \
--namespace argocd \
--create-namespace \
--version 2.10.0 \
--set server.ingress.hosts="{argocd.$INGRESS_HOST.nip.io}" \
--set server.ingress.enabled=true \
--set server.extraArgs="{--insecure}" \
--set installCRDs=false \
--set controller.args.appResyncPeriod=30 \
--wait
export PASS=$(kubectl \
--namespace argocd \
get pods \
--selector app.kubernetes.io/name=argocd-server \
--output name \
| cut -d'/' -f 2)
argocd login \
--insecure \
--username admin \
--password $PASS \
--grpc-web \
argocd.$INGRESS_HOST.nip.io
argocd account update-password \
--current-password $PASS \
--new-password admin123
export ARGOCD_ADDR=$(kubectl \
--namespace argocd \
get ingress argocd-server \
--output jsonpath="{.spec.rules[0].host}")
#######################
# Destroy The Cluster #
#######################
cd devops-catalog-code/terraform-aks/simple
terraform destroy
cd ../../../
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment