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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
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:
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.
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:
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:
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