caddyserver / ingress

WIP Caddy 2 ingress controller for Kubernetes
Apache License 2.0
620 stars 70 forks source link

Bare metal configuration? #237

Open thebigbone opened 1 month ago

thebigbone commented 1 month ago

Hello. I was setting up caddy ingress controller on a bare metal server. I am aware that LoadBalancer IP would be in pending state so I added externalIPs to the Service type. After which I tried accessing using the allocated NodePort but it doesn't seem to be working. Any help would be appreciated! Thanks.

axgkl commented 1 week ago

I think (no expert here) k8s svc type loadbalancer (that's what this here creates) always requires a controller, which can, and will create/configure such an actual loadbalancer.

If you really have an external ip, there is metal lb which provides such a controller and which makes the external ip field of the caddy service go from pending to that real ip:

helm install metallb metallb/metallb -n metallb-system
k apply -f metallb_configmap_manifest.yaml 

with metallb_configmap_manifest:

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 1.2.3.4/32 # <!------------- your ip

then check your caddy service - should now show a Loadbalancer with an external IP on it, just like in clouds.

Sorry if this was not what you asked for, pretty new within this world still :blush: