cozystack
cozystack copied to clipboard
Remove dependency on external DNS configuration for internal kubernetes API requests
When the user does not have the correct DNS record for the tenant Kubernetes API, attempting to read logs from the cluster results in the following error:
Error from server (InternalError): Internal error occurred: Authorization error (user=kube-apiserver-kubelet-client, verb=get, resource=nodes, subresource=proxy)
https://stackoverflow.com/questions/54572775/kubectl-logs-f-gets-authorization-error/68355619#68355619
Current Workaround To address this issue temporarily, I updated the CoreDNS configuration in the management cluster:
rewrite name dashboard.example.org root-ingress-controller.tenant-root.svc.cozy.local
rewrite name grafana.example.org root-ingress-controller.tenant-root.svc.cozy.local
rewrite name kubernetes-test.example.org root-ingress-controller.tenant-root.svc.cozy.local
After restarting Kamaji, the logs started working correctly.
I think we need to find a permanent solution to remove the dependency on correctly configured DNS records, at least for requests originating from within the cluster. This will ensure that internal API requests function correctly regardless of the external DNS configuration.