How to fix "503 Service Temporarily Unavailable" How to fix "503 Service Temporarily Unavailable" kubernetes kubernetes

How to fix "503 Service Temporarily Unavailable"


Yes, i end up with same error. once i changed the service type to "ClusterIP", it worked fine for me.


Found this page after searching for a solution to nginx continually returning 503 responses despite the service names all being configured correctly. The issue for me was that I had configured the kubernetes service in a specific namespace, but did not update the ingress component to be in the same namespace. Despite being such a simple solution it was not at all obvious!


I advise you to use service type ClusterIPTake look on this useful article: services-kubernetes.

If you use Ingress you have to know that Ingress isn’t a type of Service, but rather an object that acts as a reverse proxy and single entry-point to your cluster that routes the request to different services. The most basic Ingress is the NGINX Ingress Controller, where the NGINX takes on the role of reverse proxy, while also functioning as SSL. On below drawing you can see workflow between specific components of environment objects.

Ingress is exposed to the outside of the cluster via ClusterIP and Kubernetes proxy, NodePort, or LoadBalancer, and routes incoming traffic according to the configured rules.

Example of service definition:

---apiVersion: v1kind: Servicemetadata:  name: app-svc  labels:    app: app1spec:  type: ClusterIP  ports:  - port: 80  selector:    app: app1---apiVersion: v1kind: Servicemetadata:  name: app2-svc  labels:    app: app2spec:  type: ClusterIP  ports:  - port: 80  selector:    app: app2

Let me know if it helps.