I have been trying to get an HAProxy Ingress working on my kubernetes cluster. I have been following the instructions in the README (https://github.com/jcmoraisjr/haproxy-ingress/tree/master/examples/deployment). I see that haproxy-ingress pod has this in its log:
I0617 16:50:31.298997 6 launch.go:181]
Name: HAProxy
Release: v0.9
Build: git-4220104
Repository: https://github.com/jcmoraisjr/haproxy-ingress
I0617 16:50:31.299065 6 launch.go:184] Watching for ingress class: haproxy
I0617 16:50:31.299633 6 launch.go:427] Creating API client for https://10.233.0.1:443
I0617 16:50:31.307638 6 launch.go:439] Running in Kubernetes Cluster version v1.18 (v1.18.3) - git (clean) commit 2e7996e3e2712684bc73f0dec0200d64eec7fe40 - platform linux/amd64
F0617 16:50:31.308283 6 launch.go:207] no service with name ingress-controller/ingress-default-backend found: services "ingress-default-backend" is forbidden: User "system:serviceaccount:ingress-controller:default" cannot get resource "services" in API group "" in the namespace "ingress-controller"
The one thing to note that didn't seem to work in the README was this:
kubectl --namespace=ingress-controller create -f haproxy-ingress.yaml
That command failed with this error:
error: unable to recognize "haproxy-ingress.yaml": no matches for kind "Deployment" in version "apps/v1beta2"
I had to change the apiVersion: apps/v1beta2
to apiVersion: apps/v1
Did that cause the problem?
Thanks!
Upate:
I was able to get the haproxy-ingress pod to finally launch without error. After much trial and error I final figured out that I need to update the haproxy-ingress "deployment" (via the dashbaord). I only had to add the one line:
serviceAccountName: ingress-controller
directly after the spec: tag.
I am still not able to get an external address.
when I run
kubectl describe ingress app --namespace=ingress-controller
I do not see an IP address associated with host.
$ kubectl describe ingress app --namespace=ingress-controller
Name: app
Namespace: ingress-controller
Address:
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends
---- ---- --------
ifs-alpha-kube.cisco.com
/ service-nodeport:80 (<error: endpoints "service-nodeport" not found>)
Annotations: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal CREATE 37m ingress-controller Ingress ingress-controller/app
Normal UPDATE 18m (x3 over 10h) ingress-controller Ingress ingress-controller/app
Normal UPDATE 18m (x2 over 19m) ingress-controller Ingress ingress-controller/app
and if I execute
$ kubectl get service -A -o wide
I see that no service has an external ip.
Update II
Turns out I don't need to see external ips.
There seems to be a couple of things going on there, but overall it appears the yaml you linked to expects haproxy to be the additional Ingress controller, and not the only one -- that's why it's missing the
ingress-default-backend
and theRoleBinding
The docs version (as described by the fine manual) seems to be more complete, as it contains the
Service
,ClusterRoleBinding
, and associated component partsIf you're helm savvy, you may enjoy the haproxy helm chart more, since it is more one-stop-shopping