By connoraye
Hi, Please tell me how to get health checks to work on a load balancer which is used by Kubernetes. I am running DOs managed Kubernetes service and spawned a Load Balancer service which has created an external load balancer, however when I hit the IP via HTTP I get a 503 gateway. When I check the health statuses of the nodes, they appear down.
Any help would be much appreciated. This is my yml for the service:
apiVersion: v1
kind: Service
metadata:
name: wordpress
labels:
app: wordpress
annotations:
service.beta.kubernetes.io/do-loadbalancer-protocol: "http"
service.beta.kubernetes.io/do-loadbalancer-healthcheck-path: "/health"
spec:
type: LoadBalancer
externalTrafficPolicy: Local
ports:
# the port the service serves on
- port: 80
selector:
app: wordpress
tier: frontend
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Problem solved: After executing kubectl exec -it pod-name-1234 sh, I used top to see Apache wasn’t running in my applications container. After checking the image, I noticed Apache was never going to run as it wasn’t included in the container build. Included Apache, problem solved after applying the new deployment yaml file.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.