How to check connectivity during network lab
kubectl run -i -t busybox-curl --image=yauritux/busybox-curl --restart=Never
curl -v <ip>:<port>
- Deploy virtual network
az network vnet create -g aks02-XX -n vnet --address-prefix 172.16.0.0/16 \
--subnet-name aks \
--subnet-prefix 172.16.0.0/24
- Get the subnet resource ID for the existing subnet into which the AKS cluster will be joined.
az network vnet subnet list \
--resource-group aks02-XX \
--vnet-name vnet \
--query [].id --output tsv
- Deploy AKS with CNI
az aks create -g aks02-XX -n aks02 --kubernetes-version 1.12.5 \
--network-plugin azure \
--vnet-subnet-id <subnet-id> \
--docker-bridge-address 172.17.0.1/16 \
--dns-service-ip 10.2.0.10 \
--service-cidr 10.2.0.0/24
- Get access to cluster and verify the pods
az aks get-credentials -g aks02-XX -n aks02 --admin
kubectl get pods --all-namespaces -o wide
- Create demo application.
kubectl apply -f kuard.yaml
- Expose demo application with public IP.
apiVersion: v1
kind: Service
metadata:
name: kuard
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
protocol: TCP
selector:
app: kuard
kubectl apply -f lb.yaml
- Check public ip of service.
kubectl get svc --all-namespaces -o wide
- Expose demo application with internal IP.
apiVersion: v1
kind: Service
metadata:
name: kuard-internal
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
protocol: TCP
selector:
app: kuard
kubectl apply -f ilb.yaml
- Check internal ip of service.
kubectl get svc --all-namespaces -o wide
- Expose demo application with static internal IP.
apiVersion: v1
kind: Service
metadata:
name: kuard-internal
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
protocol: TCP
loadBalancerIP: 172.16.0.240
selector:
app: kuard
kubectl apply -f ilb-fix-ip.yaml
- Check internal ip of service.
kubectl get svc --all-namespaces -o wide
Links: