How to fix "503 Service Temporarily Unavailable"

how to fix anything
how to fix a zipper
how to fix things around the house
how to fix a computer
how to fix everything book
how to fix phone
how to fix keyboard
how to fix broken things

FYI:

  1. I run Kubernetes on docker desktop for mac
  2. The website based on Nginx image

I run 2 simple website deployments on Kubetesetes and use the NodePort service. Then I want to make routing to the website using ingress. When I open the browser and access the website, I get an error 503 like images below. So, how do I fix this error?

### Service
apiVersion: v1
kind: Service
metadata:
  name: app-svc
  labels:
    app: app1
spec:
  type: NodePort
  ports:
  - port: 80
  selector:
    app: app1
---
apiVersion: v1
kind: Service
metadata:
  name: app2-svc
  labels:
    app: app2
spec:
  type: NodePort
  ports:
  - port: 80
  selector:
    app: app2

### Ingress-Rules
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: app-ingress
  annotations:
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /app1
        backend:
          serviceName: app-svc
          servicePort: 30092
      - path: /app2
        backend:
          serviceName: app2-svc
          servicePort: 30936


enter image description here


I advise you to use service type ClusterIP Take 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: v1
kind: Service
metadata:
  name: app-svc
  labels:
    app: app1
spec:
  type: ClusterIP
  ports:
  - port: 80
  selector:
    app: app1
---
apiVersion: v1
kind: Service
metadata:
  name: app2-svc
  labels:
    app: app2
spec:
  type: ClusterIP
  ports:
  - port: 80
  selector:
    app: app2

Let me know if it helps.

28 HACKS TO FIX ANYTHING QUICKLY, How to Fix Roof Vents. Check for cracked housings on plastic roof vents and broken seams on metal ones. You might be tempted to throw caulk  The steps provided here should help fix any errors that come up during the Windows Update process. How does it work? We’ll begin by asking you questions about the Windows version you're using and the issue you’re experiencing.


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

How to Fix Everything, Whether you are new homeowner or an expert, knowing how to fix these 12 common household problems can help save you from a pricey  Fix definition, to repair; mend. See more. Fix meaning “to repair” appears to have been used first in America, but it is long established and has been used in England since the early 19th century: The engineer quickly fixed the faulty valve.


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!

How to Fix (Just About) Everything: More Than 550 Step-by-Step , Thousands of repair manuals, tutorials, and how-to guides for DIY fixes. From electronics to cars, learn how to repair your own stuff and save yourself some  Fix Bluetooth problems in Windows 10. Content provided by Microsoft. Applies to: Windows 10. Select Product Version. If you run into problems trying to connect to a


100 Home Repairs You Can Do Yourself, iFixit is a global community of people helping each other repair things. Let's fix the world, one device at a time. Troubleshoot with experts in the Answers  If you’re having audio problems, the following suggestions might help. The tips are listed in order, so start with the first one, see if that helps, and then continue to the next one if it doesn’t.


12 Easy Things Everyone Should Know How to Fix, Dropped that ancient vase your great grandfather shipped from the Middle East in the 19th century? Happens. But it might not be trash just yet, as these creative​  Created by Marcia Clark, Elizabeth Craft, Sarah Fain. With Robin Tunney, Adam Rayner, Merrin Dungey, Breckin Meyer. An L.A. prosecutor moves to Washington after losing a high-profile double murder case, but when the killer strikes again, she returns to seek justice under her own terms.


Repair Manuals for Every Thing, Tackling an appliance repair by yourself can be an intimidating ordeal, but we are here you make your do-it-yourself repair experience as easy as possible. Select  Fix Number FIX429871 Manufacturer Part Number 240338001 This refrigerator door shelf bin is an attachment for your refrigerator door. It is sold individually.