The default Ingress controller for RKE2 and K3s are Nginx and Traefik, respectively, but both can have this overridden; for example, K3s can be deployed using Nginx in place of Traefik, using the K3s Helm Controller, and likewise for Ingress controllers like the one provided for Caddy.
To do this when deploying clusters via Rancher Manager, there are two steps:
- Disable the default Ingress in the
Cluster
specification. - Add an additional manifest to the
spec.rkeConfig
to add a Helm Chart for the Caddy Ingress.
For the first step, either uncheck the box for Nginx (or Traefik for K3s) Ingress in your Rancher UI:
Or, in the cluster yaml, ensure this line is present:
machineGlobalConfig:
cni: calico
disable:
- rke2-ingress-nginx
in your machineGlobalConfig.
For step 2, add the following:
---
apiVersion: v1
kind: Namespace
metadata:
name: caddy-system
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: caddy-ingress-controller
namespace: kube-system
spec:
repo: https://caddyserver.github.io/ingress
chart: caddy-ingress-controller
targetNamespace: caddy-system
# valuesContent: |
# minikube: true #hostNet for testing, otherwise use load balancer
# loadBalancer:
# enabled: false
# automaticHTTPS: your@email.com
to, either, the UI field for additional manifests:
or to .spec.rkeConfig
in the yaml editor:
rkeConfig:
additionalManifest: |-
---
apiVersion: v1
kind: Namespace
metadata:
name: caddy-system
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: caddy-ingress-controller
namespace: kube-system
spec:
repo: https://caddyserver.github.io/ingress
chart: caddy-ingress-controller
targetNamespace: caddy-system
Once your cluster is done provisioning, you can verify that Caddy is running as your default Ingress:
Top comments (0)