Guys, I deployed a .NET WEB API application to Kubernets, however, when I try to access the external endpoint provided by LoadBalancer, nothing returns, do I need to configure anything else? Can anyone help me?
my configuration;
**
apiVersion: apps/v1
kind: Deployment
metadata:
name: car-companie-deployment
labels:
app: car-companie-deployment
spec:
replicas: 1
selector:
matchLabels:
app: car-companie-deployment
template:
metadata:
labels:
app: car-companie-deployment
spec:
containers:
- name: car-companie-container
image: <IMAGE>
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: car-companie-service
spec:
selector:
app: car-companie-deployment
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
**
images pods : https://imgur.com/a/N1esvEd
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!
Hi there,
There are a few things that I could suggest checking in order to further troubleshoot the issue that you are facing:
First, check the status of the service to ensure the LoadBalancer has provisioned an external IP:
kubectl get svc car-companie-service
If the “EXTERNAL-IP” is still pending, that means the LoadBalancer is still provisioning, and you’ll need to wait. If an IP is listed, that’s the IP you’ll use to access your service.
Ensure that your .NET API application inside the container is indeed listening on port 80. If it’s listening on a different port, you’ll need to adjust the containerPort value accordingly.
Ensure the pods associated with the deployment are running correctly.
kubectl get pods -l app=car-companie-deployment
Check for any restarts or issues with the pods.
Inspect the logs of a pod to see if there are any error messages or startup issues:
kubectl logs [POD_NAME] -c car-companie-container
Replace [POD_NAME] with one of the pod names from the previous command.
Try accessing the application within the cluster to see if it’s an external issue or if the app itself isn’t responding:
kubectl run -it --rm debug --image=busybox -- sh wget -qO- http://car-companie-service
This will try to access your service from a temporary pod within the cluster.
Let me know how it goes and feel free to share the extra details that you’ve gathered here so I could try to advise you further!
Best,
Bobby
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.