Skip to content

matsest/k8s-kind-ingress-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k8s-kind-ingress-demo

Setting up an ingress controller on a kind k8s cluster

Prerequisites

  • Docker or Podman
    • If you're running Podman, please see this.
  • kind (Tested with v0.22.0)
  • kubectl (Tested with v1.29.2 - same version as cluster)

Cluster setup

  • Prepare kind cluster with port mappings:
kind create cluster --config="cluster-config.yml"

Note: To support running as rootless Docker/Podman we bind http (80) to port 1080 on localhost and https (443) to port 1443 on localhost

Usage

  1. Deploy nginx ingress controller to cluster
kubectl apply -f kind-nginx-ingress.yml

kubectl wait --namespace ingress-nginx \
  --for=condition=ready pod \
  --selector=app.kubernetes.io/component=controller \
  --timeout=90s
  1. Deploy the example workloads (pods, services and ingress)
kubectl apply -f workloads.yml

kubectl wait \
  --for=condition=ready pod \
  --selector=workload=ingress-demo \
  --timeout=90s
  1. Run curl against the ingress controller on the specified ports/paths
curl localhost:1080/foo

curl localhost:1080/bar

Output:

'hello world! this is foo!'
'hello world! this is bar!'

Clean up

  • Run kubectl delete -f workloads.yml if you want to remove the example workloads
  • Run kubectl delete -f kind-nginx-ingress.yml if you want to remove the ingress controller
  • Run kind delete cluster to remove the full cluster

Acknowledgements

About

Demo of Nginx Ingress Controller on a kind k8s cluster

Topics

Resources

License

Stars

Watchers

Forks

Languages