I want to hide my health-check and put it on a different port. By default the google kubernetes load balancer created for an ingress uses the readiness probe for external health-checks.
Can i tell the ingress to use my alternative port without having to expose it as a service on the ingress?
Can i configure a different health check for the ingress?
is there a better way to hide my health check without using authorization?
If I understand you right, yes you can. This link will be helpful. I quote - The Ingress controller looks for a compatible readiness probe first, if it finds one, it adopts it as the GCE loadbalancer's HTTP(S) health check.
Ingress itself has no health check. The health check is for the backends. You will need to define a readiness probe in your Deployment (pod) such as:
readinessProbe:
httpGet:
path: /YOUR_PATH
port: YOUR_PORT
initialDelaySeconds: 5 #optional
periodSeconds: 5 #optional
Now if the readiness probe goes through (responds with 200), the health check for the backends will be updated by this new one.