Skip to content

Latest commit

 

History

History
 
 

ingress

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Ingress on K8s

Sample ingress setup

Starting minikube for local running

minikube start --kubernetes-version=v1.24.3

NOTICE: tested on standard docker installation. if you use rootless mode, check minikube documentation and rootless documentation

Enabling ingress in minikube

minikube addons enable ingress

Adding TLS

Generate self-signed certificate

openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout tls.key -out tls.crt -subj "/CN=example.com" -days 365
kubectl create secret tls example-com-tls --cert=tls.crt --key=tls.key --dry-run=client -oyaml > ingress/example-com-tls.yaml

Checking tls setup in the ingress controller manifest, ingress.yaml

spec:
  tls:
   - secretName: example-com-tls
     hosts:
       - example.com

Apply changes

kubectl apply -f ingress

Setup example.com for making it possible to be run locally

echo "$(minikube ip) example.com" | sudo tee -a /etc/hosts

Checking changes

curl --insecure https://example.com 

Clean up

Delete artifacts and workloads

kubectl delete -f ingress

Remove entry in the /etc/hosts, if it was added as last line

sudo sed '$d' --in-place /etc/hosts