mirror of
https://github.com/eliasstepanik/caddy-ingess.git
synced 2026-01-09 19:48:28 +00:00
2.6 KiB
2.6 KiB
Requirements
- A running kubernetes cluster (if you don't have one see Setup a local cluster section)
- helm 3 installed on your machine
- skaffold installed on your machine
Setup a local cluster
Then we can create a two nodes cluster (one master and one worker):
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
EOF
and activate the kubectl config via:
kind export kubeconfig
Setup development env
Replace also the domain name to use in kubernetes/sample/example-ingress.yaml from kubernetes.localhost to your domain (ensure also that the subdomain example1 and example2 are resolved to the server public IP)
Create a namespace to host the caddy ingress controller:
kubectl create ns caddy-system
Then we can start skaffold using:
make dev
this will automatically:
- build your docker image every time you change some code
- update the helm release every time you change the helm chart
- expose the caddy ingress controller (port 8080 and 8443)
You can test that all work as expected with:
curl -H 'Host: example1.kubernetes.localhost http://127.0.0.1:80/hello1
curl -H 'Host: example1.kubernetes.localhost http://127.0.0.1:80/hello2
curl -H 'Host: example2.kubernetes.localhost http://127.0.0.1:80/hello1
curl -H 'Host: example2.kubernetes.localhost http://127.0.0.1:80/hello2
Notes
- You can change local port forwarded by skaffold by changing the port values in the
skaffold.yamlfile on sectionportForwardlocalPort. Remind that you can forward only port greater than 1024 if you execute it as non-root user - You can delete your local cluster with the command
kind delete cluster - To use TLS your domain should be publicly resolved to your cluster IP in order to allow Let's Encrypt to validate the domain
Releasing new helm chart version
If you want to release a new version of the caddy-ingress-controller chart, you'll need
to create a new PR with:
- The new chart's
versioninChart.yaml - The new
image.taginvalues.yaml(if you want to update the default image used in the chart) - The new
appVersioninChart.yaml(if you did the previous line)
Releasing a new app version
To release a new caddy-ingress-controller image, you need to create a new semver tag. It will build and push an image to https://hub.docker.com/r/caddy/ingress.