Thanks for the feedback, Tom.
I did get a chance to try a few more ideas out, both attempting to use the ingress address as well as 127.0.0.1 with /etc/hosts entries pointing to my "dns_domain" of bitwarden.juju.
It appears that the ingress is performing a direct passthrough from the ingress address advertised in juju status:
nginx-ingress-integrator/0* active idle 10.1.146.217 Ingress with service IP(s): 10.152.183.206
But is not listening on localhost/127.0.0.1 on either 80, 443, or service port 8000 or updated service port 8143, all provide connection refused upon attempt to access with curl or telnet/nc. Only the service port is listening on the advertised 10.152.183.206 IP.
You can see here in my ingress definition that bitwarden.juju hostname should be TLS encapsulated with the bitwarden secret (SSL cert/key). (For the below log, this secret changed to bitwarden-tls.)
drew@grimoire:~$ kubectl describe ingress -n demo bitwarden-k8s-ingress
Name: bitwarden-k8s-ingress
Namespace: demo
Address: 127.0.0.1
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
TLS:
bitwarden-tls terminates bitwarden.juju
Rules:
Host Path Backends
---- ---- --------
bitwarden.juju
/ bitwarden-k8s-service:8143 (10.1.146.216:8143)
Annotations: nginx.ingress.kubernetes.io/rewrite-target: /
Events: <none>
(I changed the port to 8143 for a new demo from port 8000.)
The logs of the ingress controller show the following, most notably, the secret is being added to the local store (without error). Interestingly, no ports are listed in the ingress status for bitwarden-k8s-ingress, just an IP of 127.0.0.1 is set. I’m not sure if this is intended or not, or something I should be setting. I was imagining that the nginx-ingress-integrator provided the glue for the inbound external IP to this localhost IP, but maybe that’s incorrect.
-------------------------------------------------------------------------------
NGINX Ingress controller
Release: v0.44.0
Build: f802554ccfadf828f7eb6d3f9a9333686706d613
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.19.6
-------------------------------------------------------------------------------
I0707 16:56:35.115393 7 flags.go:208] "Watching for Ingress" class="public"
W0707 16:56:35.115429 7 flags.go:211] Only Ingresses with class "public" will be processed by this Ingress controller
W0707 16:56:35.115640 7 client_config.go:614] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I0707 16:56:35.115793 7 main.go:241] "Creating API client" host="https://10.152.183.1:443"
I0707 16:56:35.127872 7 main.go:285] "Running in Kubernetes cluster" major="1" minor="21+" git="v1.21.1-3+ba118484dd39df" state="clean" commit="ba118484dd39df570e55e47f082e523cda7583e5" platform="linux/amd64"
I0707 16:56:35.255229 7 main.go:105] "SSL fake certificate created" file="/etc/ingress-controller/ssl/default-fake-certificate.pem"
I0707 16:56:35.256025 7 main.go:115] "Enabling new Ingress features available since Kubernetes v1.18"
I0707 16:56:35.277074 7 nginx.go:254] "Starting NGINX Ingress controller"
I0707 16:56:35.280073 7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress", Name:"nginx-ingress-tcp-microk8s-conf", UID:"3929ebf1-90f6-4c1c-9637-86f60166bcb7", APIVersion:"v1", ResourceVersion:"546", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress/nginx-ingress-tcp-microk8s-conf
I0707 16:56:35.280092 7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress", Name:"nginx-ingress-udp-microk8s-conf", UID:"c2289e42-da48-4127-8a04-e3053e3837b8", APIVersion:"v1", ResourceVersion:"547", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress/nginx-ingress-udp-microk8s-conf
I0707 16:56:35.280404 7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress", Name:"nginx-load-balancer-microk8s-conf", UID:"f531b784-4575-4c17-99da-012144f35ad2", APIVersion:"v1", ResourceVersion:"545", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress/nginx-load-balancer-microk8s-conf
I0707 16:56:36.477474 7 nginx.go:296] "Starting NGINX process"
I0707 16:56:36.477522 7 leaderelection.go:243] attempting to acquire leader lease ingress/ingress-controller-leader-public...
I0707 16:56:36.477825 7 controller.go:146] "Configuration changes detected, backend reload required"
I0707 16:56:36.487218 7 leaderelection.go:253] successfully acquired lease ingress/ingress-controller-leader-public
I0707 16:56:36.487347 7 status.go:84] "New leader elected" identity="nginx-ingress-microk8s-controller-gj8j2"
I0707 16:56:36.541352 7 controller.go:163] "Backend successfully reloaded"
I0707 16:56:36.541429 7 controller.go:174] "Initial sync, sleeping for 1 second"
I0707 16:56:36.541521 7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress", Name:"nginx-ingress-microk8s-controller-gj8j2", UID:"73f5ccb3-94c0-4489-b2c0-3625ca757911", APIVersion:"v1", ResourceVersion:"5293", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I0707 17:28:51.981207 7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"demo", Name:"bitwarden-k8s-ingress", UID:"79a6c020-7b26-4fd4-b532-09c92b61eb62", APIVersion:"networking.k8s.io/v1beta1", ResourceVersion:"8119", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync
I0707 17:28:51.981504 7 backend_ssl.go:66] "Adding secret to local store" name="demo/bitwarden-tls"
I0707 17:28:55.273512 7 controller.go:146] "Configuration changes detected, backend reload required"
I0707 17:28:55.327323 7 controller.go:163] "Backend successfully reloaded"
I0707 17:28:55.327707 7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress", Name:"nginx-ingress-microk8s-controller-gj8j2", UID:"73f5ccb3-94c0-4489-b2c0-3625ca757911", APIVersion:"v1", ResourceVersion:"5293", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I0707 17:29:36.498697 7 status.go:281] "updating Ingress status" namespace="demo" ingress="bitwarden-k8s-ingress" currentValue=[] newValue=[{IP:127.0.0.1 Hostname: Ports:[]}]
I0707 17:29:36.513918 7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"demo", Name:"bitwarden-k8s-ingress", UID:"79a6c020-7b26-4fd4-b532-09c92b61eb62", APIVersion:"networking.k8s.io/v1beta1", ResourceVersion:"8188", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync
W0708 06:16:38.818165 7 reflector.go:436] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: watch of *v1.ConfigMap ended with: very short watch: k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Unexpected watch close - watch lasted less than a second and no items received
W0708 06:16:38.818165 7 reflector.go:436] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: watch of *v1.Endpoints ended with: very short watch: k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Unexpected watch close - watch lasted less than a second and no items received
W0708 06:16:38.818212 7 reflector.go:436] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: watch of *v1.Secret ended with: very short watch: k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Unexpected watch close - watch lasted less than a second and no items received
W0708 06:16:38.818229 7 reflector.go:436] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: watch of *v1.Service ended with: very short watch: k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Unexpected watch close - watch lasted less than a second and no items received
W0708 06:16:38.818635 7 reflector.go:436] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: watch of *v1beta1.Ingress ended with: very short watch: k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Unexpected watch close - watch lasted less than a second and no items received
E0708 06:16:39.192151 7 leaderelection.go:325] error retrieving resource lock ingress/ingress-controller-leader-public: Get "https://10.152.183.1:443/api/v1/namespaces/ingress/configmaps/ingress-controller-leader-public": dial tcp 10.152.183.1:443: connect: connection refused
E0708 06:16:39.642374 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1.Secret: failed to list *v1.Secret: Get "https://10.152.183.1:443/api/v1/secrets?fieldSelector=%2Ctype%21%3Dhelm.sh%2Frelease.v1&resourceVersion=18475": dial tcp 10.152.183.1:443: connect: connection refused
E0708 06:16:39.642773 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: Get "https://10.152.183.1:443/apis/networking.k8s.io/v1beta1/ingresses?resourceVersion=18475": dial tcp 10.152.183.1:443: connect: connection refused
E0708 06:16:39.662844 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1.ConfigMap: failed to list *v1.ConfigMap: Get "https://10.152.183.1:443/api/v1/configmaps?labelSelector=OWNER%21%3DTILLER&resourceVersion=69476": dial tcp 10.152.183.1:443: connect: connection refused
E0708 06:16:40.088085 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1.Endpoints: failed to list *v1.Endpoints: Get "https://10.152.183.1:443/api/v1/endpoints?resourceVersion=18536": dial tcp 10.152.183.1:443: connect: connection refused
E0708 06:16:40.341479 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1.Service: failed to list *v1.Service: Get "https://10.152.183.1:443/api/v1/services?resourceVersion=18475": dial tcp 10.152.183.1:443: connect: connection refused
E0708 06:16:41.259415 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: Get "https://10.152.183.1:443/apis/networking.k8s.io/v1beta1/ingresses?resourceVersion=18475": dial tcp 10.152.183.1:443: connect: connection refused
E0708 06:16:54.202586 7 leaderelection.go:325] error retrieving resource lock ingress/ingress-controller-leader-public: Get "https://10.152.183.1:443/api/v1/namespaces/ingress/configmaps/ingress-controller-leader-public": dial tcp 10.152.183.1:443: connect: connection refused
E0709 00:31:51.733534 7 leaderelection.go:325] error retrieving resource lock ingress/ingress-controller-leader-public: Get "https://10.152.183.1:443/api/v1/namespaces/ingress/configmaps/ingress-controller-leader-public": dial tcp 10.152.183.1:443: connect: connection refused
I0709 15:38:51.109731 7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"demo", Name:"bitwarden-k8s-ingress", UID:"79a6c020-7b26-4fd4-b532-09c92b61eb62", APIVersion:"networking.k8s.io/v1beta1", ResourceVersion:"228683", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync
I0709 15:38:54.388141 7 controller.go:146] "Configuration changes detected, backend reload required"
I0709 15:38:54.561115 7 controller.go:163] "Backend successfully reloaded"
I0709 15:38:54.561264 7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress", Name:"nginx-ingress-microk8s-controller-gj8j2", UID:"73f5ccb3-94c0-4489-b2c0-3625ca757911", APIVersion:"v1", ResourceVersion:"5293", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
Here are the upstream references I’ve been investigating:
https://kubernetes.github.io/ingress-nginx/user-guide/tls/
The "default-http-backend" not found appears to be normal/ignorable per this thread:
https://github.com/nginxinc/kubernetes-ingress/issues/966
I believe the errors in the log above are from my kubectl describe ingress -n ingress command during troubleshooting.