Replies: 2 comments 8 replies
-
Have you read: https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
It looks like you're trying to use a headless service, but appear to have missed the bit where you set |
Beta Was this translation helpful? Give feedback.
-
As noted above, using a headless service, i.e setting |
Beta Was this translation helpful? Give feedback.
-
Environmental Info:
K3s Version:
k3s version v1.28.7+k3s1 (051b14b)
go version go1.21.7
Node(s) CPU architecture, OS, and Version:
Linux kubernetes-test-server 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Cluster Configuration:
1 server, 2 agents, Traefik disabled, using Nginx instead, almost clean install
Describe the bug:
As recommend in https://kubernetes.io/docs/concepts/services-networking/service/ I did try to abstract access to an externally hosted mariaDB. However, both the recommend approach and the legacy approach with Endpoints did not work as expected. There is a slight difference however, in the EndpointSlice case the service description showed
Endpoints: <none>
while in the endpoints case it was empty, i.e.Endpoints:
.Steps To Reproduce:
It is a clean K3s with
--disable traefik
, nginx ingress as well as cert-manager installed via helm, plus GitLab Agent for Kubernetes also using Helm.The Service:
I've tried both, EndpointSlice:
, and Endpoints:
Both were successfully deployed in the same namespace as the service and linked to the service.
case EndpointSlices
kubectl get endpointslice -l kubernetes.io/service-name=mariadb
kubectl describe service mariadb
case Endpoints
kubectl describe endpoints mariadb:
kubectl describe service mariadb
Expected behavior:
The external database should be reachable through the service abstraction.
Actual behavior:
My applications just only reach the empty service.
Additional context / logs:
DNS is working in principle:
kubectl exec -i -t dnsutils -- nslookup mariadb
Beta Was this translation helpful? Give feedback.
All reactions