-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLS certificate lookup fails for server aliases unless specified host is loaded at least once #11067
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-kind bug
|
/triage needs-information |
Hi there @longwuyuan, First off hello and thanks for the reply!
Hi there I could not find specific documentation regarding the host not being required. In this case wouldn't the hosts and the tls hosts match on the wildcard?
Here is the server block with the alias created, it looks identical outside of the addition of the domain under the
If you add another host to the ingress rules I do see a new server block created and the certificate works as intended. |
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach |
We're experiencing this bug within our system right now, and now we're unable to use Nginx ingress with aliases with a regular expressions and a wildcard certificates. As a workaround we had to create something like proxy on top of that, until it will be fixed |
I am not sure what the bug is, even though I ack the info provided here is a helpful effort. In particular the controller does not support wildcard sni. Also, the values in the tls hosts field do not match the names used in the tlsSecret. The secret does not contain subject or alternate for test.cluster.foo.example and I welcome being corrected but currently I believe that is needed. |
What happened:
Reopening issue which is the same as #4832
I defined an ingress resource with a server alias on a separate domain, using the nginx.ingress.kubernetes.io/server-alias, and 2 certificates one wildcard that matches the primary domain and a wildcard host that matches the alias. When sending a request that matches the alias but not the primary host, the fake self-signed certificate is used. When sending a request that matches the primary host, the configured certificate is used. If I manually specify a different subdomain on the
server-alias
as a host in the ingress the certificate is loaded as intended for theservice-alias
subdomain.What you expected to happen:
I expected to receive the configured certificate for the
server-alias
used in the ingress, without having to define it as a host.NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
NGINX Ingress controller
Release: v1.10.0
Build: 71f78d4
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.25.3
Kubernetes version (use
kubectl version
):Client Version: v1.28.7+k3s1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.7+k3s1
Environment:
Cloud provider or hardware configuration:
OS (e.g. from /etc/os-release): Fedora 39
Kernel (e.g.
uname -a
): Linux fedora 6.6.13-200.fc39.x86_64 Basic structure #1 SMP PREEMPT_DYNAMIC Sat Jan 20 18:03:28 UTC 2024 x86_64 GNU/LinuxInstall tools:
Basic cluster related info:
How was the ingress-nginx-controller installed:
helm ls -A | grep -i ingress
helm -n <ingresscontrollernamespace> get values <helmreleasename>
If helm was not used, then copy/paste the complete precise command used to install the controller, along with the flags and options used
if you have more than one instance of the ingress-nginx-controller installed in the same cluster, please provide details for all the instances
Current State of the controller:
kubectl describe ingressclasses
kubectl -n <ingresscontrollernamespace> get all -A -o wide
kubectl -n <ingresscontrollernamespace> describe po <ingresscontrollerpodname>
kubectl -n <ingresscontrollernamespace> describe svc <ingresscontrollerservicename>
Current state of ingress object, if applicable:
kubectl -n <appnamespace> get all,ing -o wide
kubectl -n <appnamespace> describe ing <ingressname>
Others:
kubectl describe ...
of any custom configmap(s) created and in useHow to reproduce this issue:
Install K3s (Any Distro, Seen on EKS as well)
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable traefik" sh -s -
Install the ingress controller using helm
Create Dummy certificates
Install an application that will act as default backend (is just an echo app)
kubectl apply -n ingress-nginx -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/http-svc.yaml
Create an ingress (please add any additional annotation required)
make a request
Update
/etc/host
to point to 127.0.0.1 fortest.cluster.foo.example
andtest.random.bar.example
Expect to see
test.cluster.foo.example
using the correct certificateAnything else we need to know: If you add a valid host entry the cert is loaded (see comment in manifest above)
The text was updated successfully, but these errors were encountered: