#verify health of the cluster
kubectl get nodes
# List all deployments in all namespaces
kubectl get deployments --all-namespaces=true
# List all deployments in a specific namespace
# Format :kubectl get deployments --namespace <namespace-name>
kubectl get deployments --namespace kube-system
# List details about a specific deployment
# Format :kubectl describe deployment <deployment-name> --namespace <namespace-name>
kubectl describe deployment my-dep --namespace kube-system
# List pods using a specific label
# Format :kubectl get pods -l <label-key>=<label-value> --all-namespaces=true
kubectl get pods -l app=nginx --all-namespaces=true
# Get logs for all pods with a specific label
# Format :kubecl logs -l <label-key>=<label-value>
kubectl logs -l app=nginx --namespace kube-system
# set default Namespace context
kubectl config set-context --current --namespace=app-d
# List the pods
kubectl get pods -l app.kubernetes.io/name=vault
# Connect to the instance
kubectl exec -ti vault-0 -- vault operator init
# Create a namespace for your ingress resources
kubectl create namespace app-d
#Get status:
kubectl --namespace ingress-basic get services -o wide -w nginx-ingress-controller
kubectl get service -l app=nginx-ingress --namespace ingress-basic
kubectl get events -n app-d
kubectl.exe logs kyron-api-948458ffc-27b65
#Create two new deployments
kubectl apply -f ..\..\helm\app1.yaml --namespace app-d
kubectl apply -f ..\..\helm\app2.yaml --namespace app-d
kubectl apply -f ..\..\helm\api.yaml --namespace app-d
# Set Default Context
kubectl config set-context --current --namespace=app-d
# Delete deployments, service, and ingress
kubectl delete ingress kyron-api
kubectl.exe delete deployments kyron-api
kubectl.exe delete service kyron-api
#uninstall:
helm delete consul
kubectl delete namespace consul
kubectl delete ingress api
kubectl.exe delete deployments api
kubectl.exe delete service api
$name = "justin"
kubectl delete ingress $name
kubectl.exe delete deployments $name
kubectl.exe delete service $name
#uninstall:
helm delete consul
kubectl delete namespace consul
Create the ingres route in the hello-world-ingress.yaml, then load
# assumes ACR Admin Account is enabled
ACR_UNAME=$(az acr credential show -n $ACR_NAME --query="username" -o tsv)
ACR_PASSWD=$(az acr credential show -n $ACR_NAME --query="passwords[0].value" -o tsv)
kubectl create secret docker-registry $ACR_SHORTNAME `
--docker-server=$ACR_NAME `
--docker-username=$ACR_UNAME `
--docker-password=$ACR_PASSWD `
--docker-email=cploegj@jci.com
docker login -u appd-creds-topull -p SOMEPASS SOMEREPO.azurecr.io
#Create the ingres route in the hello-world-ingress.yaml, then load
kubectl apply -f ..\..\helm\hello-world-ingress.yaml
# Test: To test the routes for the ingress controller, browse to the two applications with a web client. If needed, you can quickly test this internal-only functionality from a pod on the AKS cluster. Create a test pod and attach a terminal session to it:
#either or
kubectl run -it --rm aks-ingress-test --image=debian --namespace ingress-basic
kubectl attach aks-ingress-test-cc78684bb-t482j -c aks-ingress-test -i -t
# Install curl in the pod using apt-get:
apt-get update && apt-get install -y curl
# Now access the address of your Kubernetes ingress controller using curl, such as http://172.16.192.245. Provide your own internal IP address specified when you deployed the ingress controller in the first step of this article.
curl -L http://172.16.192.245