kubernetes service external ip pending

by Anish

Posted on Friday January 18, 2019


This sample chapter extracted from the book, Kubernetes for DevOps .

Get this book on Just $9 or Ask Author for Discount

Well if you stuck in solving the problem of "kubernetes service external ip pending", let's visit the k8 concept once more time.

  • Run a Hello World application in your cluster:
# kubectl run hello-world --replicas=2 --labels="run=LoadBalancer" --image=gcr.io/google-samples/node-hello:1.0  --port=8080
deployment.apps/hello-world created
  • Create a Service object that exposes the deployment:
# kubectl expose deployment hello-world --type=LoadBalancer --name=lb-service
service/lb-service exposed
  • Display information about the Service:
# kubectl get services lb-service
NAME         TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
lb-service   LoadBalancer   <pending>     8080:31031/TCP   1m

After you create the service, it takes time for the cloud infrastructure to create the load balancer and write its IP address into the Service object

Well All the time passes still kubernetes service external ip pending ?

If Kubernetes is running in an environment that doesn't support LoadBalancer services, the load balancer will not be provisioned, but the service will still behave like a NodePort service, your cloud/K8 engine should support LoadBalancer Service

In that case if you manage to add or EIP or VIP to your node then you can attach to the EXTERNAL-IP of your TYPE=LoadBalancer in k8 cluster, for example attaching the EIP/VIP address to the node

root@kube-master:/home/ansible# kubectl patch svc lb-service  -p '{"spec": {"type": "LoadBalancer", "externalIPs":[""]}}'
service/lb-service patched
  • Display information about the Service:
root@kube-master:/home/ansible# kubectl get services lb-service
lb-service LoadBalancer 8080:31031/TCP 10m
  • so you can now access the service at that IP address
root@kube-master:/home/ansible# curl
Hello Kubernetes!

since it's kubernetes you may encounter some issues, feel free to poke me

Thanku for reading !!! Give a Share for Support

Your Support Matters!

Instead of directly asking for donations, I'm thrilled to offer you all nine of my books for just $9 on leanpub By grabbing this bundle you not only help cover my coffee, beer, and Amazon bills but also play a crucial role in advancing and refining this project. Your contribution is indispensable, and I'm genuinely grateful for your involvement in this journey!

Any private key value that you enter or we generate is not stored on this site, this tool is provided via an HTTPS URL to ensure that private keys cannot be stolen, for extra security run this software on your network, no cloud dependency

python Cryptography Topics
For Coffee/ Beer/ Amazon Bill and further development of the project Support by Purchasing, The Modern Cryptography CookBook for Just $9 Coupon Price

Kubernetes for DevOps

Hello Dockerfile

Cryptography for Python Developers

Cryptography for JavaScript Developers

Go lang ryptography for Developers