My notes about the DevOps course with K8S and Jenkins. This deploys a Kind cluster (Kubernetes In Docker) with Nginx Ingress, Jenkins and Helm.
Clone this repository and run:
make create
This creates a cluster with Kind. Please, ensure the api-server node (container) has the address 172.18.0.2
, because this is the address configured in kind/config.yaml
.
docker inspect kind-control-plane --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
If not, destroy the cluster and create it again.
Please, run the following command:
make destroy
Or you can simply delete Kind containers like this:
docker rm -f $(docker ps -qa --filter label=io.x-k8s.kind.cluster=kind)
If Kind cluster is running inside of another host, such as a VM, some redirects may be required:
kubectl get ingress -A # check ingress's address
iptables -t nat -A PREROUTING -p tcp -d LOCAL_IP_ADDRESS --dport 80 -j DNAT --to-destination INGRESS_ADDRESS:80
iptables -t nat -A POSTROUTING -p tcp -d INGRESS_ADDRESS --dport 80 -j MASQUERADE
iptables -A FORWARD -p tcp -d INGRESS_ADDRESS --dport 80 -j ACCEPT
Please, check utils/redirect-to-ingress.sh
and utils/redirect-to-ingress.service
.