To match all hosts, leave the hostname empty (from docs) - How to replicate this in ingress

1. Caddy version (caddy version):

caddy ingress in kubernetes (latest)

2. How I run Caddy:

I run caddy through kubernetes helm chart deployment, were autotls and email are passed in with helm chart.

a. System environment:

kubernetes helm deployment

b. Command:

Installed from local repo (forked from ingress) inside ingress\charts\caddy-ingress-controller

  helm install \
    --namespace=caddy-system \
    --atomic \
    --set image.tag=latest \
    --set ingressController.autotls=true \
    --set ingressController.email=your@email.com
    mycaddy \
    caddy-ingress-controller

c. Service/unit/compose file:

My ingress controller file

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: app
  annotations:
    kubernetes.io/ingress.class: caddy
  namespace: app
spec:
  rules:
  - host: sellerspotdev.me
    http:
      paths:
      - path: /
        backend:
          serviceName: web
          servicePort: 8080
  - host: www.sellerspotdev.me
    http:
      paths:
      - path: /
        backend:
          serviceName: web
          servicePort: 8080
  - host: shop.sellerspotdev.tech
    http:
      paths:
      - path: /
        backend:
          serviceName: web
          servicePort: 8080
  - http:
      paths:
      - path: /
        backend:
          serviceName: web
          servicePort: 8080

d. My complete Caddyfile or JSON config:

No caddy file - installed using helm chart and having ingress file (above one).

3. The problem I’m having:

I have two problems

  • To match all hosts, leave the hostname empty (from caddyfile docs) - How to replicate this in ingress
    i want the caddy to consider all the hostname (including the custom domains cnamed to the main domain) through ingress.

  • second problem i’m facing is caddy is not automatically redirecting http => https , in the docs it is mentioned as passing autotls: true and email: will automatically do https redirecting
    but auto redirecting is not happening in my case.

4. Error messages and/or full log output:

Please check the below linked two issues for error logs and caption.

5. What I already tried:

6. Links to relevant resources:

for problem no 1:
https://github.com/caddyserver/caddy/issues/3812
for problem no 2;
https://github.com/caddyserver/ingress/issues/50

This topic was automatically closed after 30 days. New replies are no longer allowed.