Answers: <p>i'm guessing the problem is that the name of the service port is not configured, and in the ingress you specified the http name and it can not find it.
  name your port http , or give the port that you want to use (80) to the servicePort in the ingress file</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-05-14T17:12:16.767Z
Answers: This is actually really helpful. It is indeed the name of the service port issue. It works when I put 80 instead of http.
Answers: Sumei Xu
Answers: CC BY-SA 4.0
Answers: 2022-11-30T02:26:42.267Z
Answers: Thank you so much. I was struggling with the ingress and the problem was the service. it was on 8080 by default on helm chart of jenkins, so i changed it to 80
Answers: rodridevops
Answers: CC BY-SA 4.0
Answers: 2021-05-14T15:39:53.020Z
Answers: 2021-05-14T15:39:53.020Z
Answers: danny kaplunski
Body: <p>I am having some issue with creating ingress for a nginx service that I deployed in a kubernetes cluster. I am able to open the web page using port forwarding, so I think the service should work.The issue might be with configuring the ingress.I checked for selector, different ports, but still could not find where goes wrong. Anyone could help ? Thank you in advance.</p>
  <pre><code># Source: django/templates/configmap.yaml
  apiVersion: v1
  kind: ConfigMap
  metadata:
    name: vehement-horse-django-config
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
      enter code here
  
  data:
  ---
  # Source: django/templates/service.yaml
  apiVersion: v1
  kind: Service
  metadata:
    name: vehement-horse-django
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
  spec:
    type: ClusterIP
    ports:
      - port: 80
        targetPort: 8080
        protocol: TCP
        name: 
    selector:
      app.kubernetes.io/name: django
      app.kubernetes.io/instance: vehement-horse
  ---
  # Source: django/templates/deployment.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: vehement-horse-django
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
  spec:
    replicas: 
    selector:
      matchLabels:
        app.kubernetes.io/name: django
        app.kubernetes.io/instance: vehement-horse
    template:
      metadata:
        labels:
          app.kubernetes.io/name: django
          app.kubernetes.io/instance: vehement-horse
      spec:
        containers:
          - name: django
            image: &quot;website:72cf09525f2da01706cdb4c6131e8bf1802ea6a3&quot;
            imagePullPolicy: Always
            envFrom:
            - configMapRef:
                name: vehement-horse-django-config
            ports:
              - name: http
                containerPort: 8080
                protocol: TCP
            resources:
              limits:
                cpu: 1
                memory: 1Gi
              requests:
                cpu: 1
                memory: 512Mi
              
        imagePullSecrets:
          - name: some-secret
  ---
  # Source: django/templates/ingress.yaml
  apiVersion: networking.k8s.io/v1beta1
  kind: Ingress
  metadata:
    name: vehement-horse-django
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
  spec:
    rules:
      - host: something.com
        http:
          paths:
            - path: /
              backend:
                serviceName: vehement-horse-django
                servicePort: http
  </code></pre>
  
Tags: <kubernetes><helm>
Title: 503 Service Temporarily Unavailable using Kubernetes
UserDisplayName: Sumei Xu
ThreadText: # 503 Service Temporarily Unavailable using Kubernetes
  
  (Asked by: username_0 on 2021-05-12)
  
  I am having some issue with creating ingress for a nginx service that I deployed in a kubernetes cluster. I am able to open the web page using port forwarding, so I think the service should work.The issue might be with configuring the ingress.I checked for selector, different ports, but still could not find where goes wrong. Anyone could help ? Thank you in advance.
  
  ```
  # Source: django/templates/configmap.yaml
  apiVersion: v1
  kind: ConfigMap
  metadata:
    name: vehement-horse-django-config
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
      enter code here
  
  data:
  ---
  # Source: django/templates/service.yaml
  apiVersion: v1
  kind: Service
  metadata:
    name: vehement-horse-django
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
  spec:
    type: ClusterIP
    ports:
      - port: 80
        targetPort: 8080
        protocol: TCP
        name: 
    selector:
      app.kubernetes.io/name: django
      app.kubernetes.io/instance: vehement-horse
  ---
  # Source: django/templates/deployment.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: vehement-horse-django
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
  spec:
    replicas: 
    selector:
      matchLabels:
        app.kubernetes.io/name: django
        app.kubernetes.io/instance: vehement-horse
    template:
      metadata:
        labels:
          app.kubernetes.io/name: django
          app.kubernetes.io/instance: vehement-horse
      spec:
        containers:
          - name: django
            image: "website:72cf09525f2da01706cdb4c6131e8bf1802ea6a3"
            imagePullPolicy: Always
            envFrom:
            - configMapRef:
                name: vehement-horse-django-config
            ports:
              - name: http
                containerPort: 8080
                protocol: TCP
            resources:
              limits:
                cpu: 1
                memory: 1Gi
              requests:
                cpu: 1
                memory: 512Mi
              
        imagePullSecrets:
          - name: some-secret
  ---
  # Source: django/templates/ingress.yaml
  apiVersion: networking.k8s.io/v1beta1
  kind: Ingress
  metadata:
    name: vehement-horse-django
    labels:
      app.kubernetes.io/name: django
      helm.sh/chart: django-0.0.1
      app.kubernetes.io/instance: vehement-horse
      app.kubernetes.io/managed-by: Tiller
  spec:
    rules:
      - host: something.com
        http:
          paths:
            - path: /
              backend:
                serviceName: vehement-horse-django
                servicePort: http
  
  ```
  
  **Tags:** kubernetes, helm
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-05-14. Score: 3 | Accepted answer
  
  i'm guessing the problem is that the name of the service port is not configured, and in the ingress you specified the http name and it can not find it.
  name your port http , or give the port that you want to use (80) to the servicePort in the ingress file
  
  > **Comments:**
  > **username_0**: This is actually really helpful. It is indeed the name of the service port issue. It works when I put 80 instead of http.  
  > **username_2**: Thank you so much. I was struggling with the ingress and the problem was the service. it was on 8080 by default on helm chart of jenkins, so i changed it to 80  
  
  ---
  
  