K8sbykeshed / k8s-service-validator

Kubernetes Network Service Validator
22 stars 10 forks source link

Add external service test #9

Closed sladyn98 closed 3 years ago

knabben commented 3 years ago

Taking a look on externalName service, we have the following:

https://kubernetes.io/docs/concepts/services-networking/service/#externalname

When looking up the host my-service.prod.svc.cluster.local, the cluster DNS Service returns a CNAME record with the value my.database.example.com. Accessing my-service works in the same way as other Services but with the crucial difference that redirection happens at the DNS level rather than via proxying or forwarding. 

It means the service created in our case service.x-ns will add in the DNS a CNAME record so: 1) it's needed to refactor the createExternalService() to add a new newExternalName: example.com field 2) The test should hit the Service on the 80 port, and the response must come from example.com instead of a pod. We should not pass the nodeport in the probe.