haproxytech / helm-charts

Helm chart for HAProxy Kubernetes Ingress Controller
Apache License 2.0
155 stars 121 forks source link

No access possible in local docker desktop installation #221

Closed khauser closed 10 months ago

khauser commented 10 months ago

When I deploy a nginx ingress I am able to access my application via 80 and 443. This does also work with https://haproxy-ingress.github.io/.

The haproxytech ingress doesn't seem to work the same way and I have no access to my application.

Install ingress:

haproxy-ingress.yaml

controller:
  replicaCount: 1
defaultBackend:
  enabled: false
helm upgrade ingress-controller haproxytech/kubernetes-ingress \
    --install \
    --force \
    --wait \
    --namespace ingress-controller \
    --create-namespace \
    --version 1.36.1 \
    --set controller.logging.level=debug \
    -f helm/haproxy-ingress.yaml

My Application Ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
...
spec:
  ingressClassName: haproxy
  rules:
  - host: <my domain>
    http:
      paths:
      - backend:
          service:
            name: <my service>
            port:
              name: svc
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - <my domain>
    secretName: ingress-tls-csi
dkorunic commented 10 months ago

When you are saying this is running under Docker, I presume you are using Kind under Docker? In regards to tcp/80 and tcp/443, you should be able to access through clusterIP for your kubernetes-ingress service and it should be listening to tcp/80 and tcp/443. In case that doesn't work, problem is in your network (Docker, K8s, host) setup.

khauser commented 10 months ago

@dkorunic Thanks for your message. Docker for Desktop on Windows comes with Kubernetes itself. I'll check with the clusterIp.

khauser commented 10 months ago

So okay, ClusterIP is only cluster internal. But I need access from outsite the cluster. So then it should be a NortPort service.

And it is type: NodePort.

The other 2 ingress do have type: LoadBalancer here.

dkorunic commented 10 months ago

Most likely you would like to have a LoadBalancer service, ie:

controller:
  kind: DaemonSet
  ingressClass: haproxy
  service:
    type: LoadBalancer

But it is really hard to tell at this point what are you trying to do, given the lack of information..

khauser commented 10 months ago

I'll try that.

khauser commented 10 months ago

Now, I have access. Thank you very much!