- Azure CLI
- kubectl:
az aks install-cli
- Lens: An IDE to visually navigate Kubernetes
- Terraform: Automated infrastructure install
- Docker Desktop (OPTIONAL): This lets you have a local kubernetes instance to play with
Prerequisite: get the access token for terraform state store account
export ARM_ACCESS_KEY=$(az storage account keys list -g "Sandbox-base" --subscription "Transact Dev Sandbox" --account-name tcdemos --query "[?keyName=='key1'].value | [0]" -o tsv)
cd infrastructure/terraform-infra
terraform init
terraform apply
az aks get-credentials -g RG-US-East2-bootcamp --admin -n AKS-US-East2-bootcamp
kubectl create namespace myname
kubectl config set-context --current --namespace myname
cd applications
kubectl apply -k whereami
Connect to one of the pods
kubectl get pods
kubectl port-forward pod/<pod-id> 8080
Browse to http://localhost:8080
Edit the applications/whereami/kustomize.yaml
file to uncomment the line that says service-lb.yaml
resources:
- ksa.yaml
- deployment.yaml
- configmap.yaml
- service-lb.yaml
#- service-internal.yaml
#- ingress.yaml
Then run
cd applications
kubectl apply -k whereami
kubectl get services -w
Wait for an external IP then browse to http://external-ip-from-above
Edit the applications/whereami/kustomize.yaml
file as below
resources:
- ksa.yaml
- deployment.yaml
- configmap.yaml
# service-lb.yaml
- service-internal.yaml
- ingress.yaml
Edit the applications/whereami/ingress.yaml
file to replace the host
- host: bootcamp.myname.io
Then run
cd applications
kubectl apply -k whereami
kubectl get services -w
Poison your etc/hosts
external-ip-from-above bootcamp.myname.io
Then browse to http://bootcamp.myname.io
kubectl cluster-info
: Print the address of the master and cluster serviceskubectl exec pod_name -- ls /
: Run command in an existing podkubectl get pod|service|deployment|ingress|... -o wide
: List all information about a resource with more detailskubectl config get-contexts
: Gets configured clusters in the kubeconfig filekubectl config use-context docker-dekstop
: Sets the current-context (cluster in use) in a kubeconfig filekubectl config set-context --current --namespace=namespace
: sets the default namespace
- Monitoring (See Lab 5 here)