Home > Back-end >  Nginx ingress failed: HTTP probe failed with statuscode: 503
Nginx ingress failed: HTTP probe failed with statuscode: 503

Time:10-07

I'm following this Link to install nginx-ingress-controller on my bare metal server Kubernetes-v.1.19.6

The below commands i have executed as part of installation.

$ git clone https://github.com/nginxinc/kubernetes-ingress.git --branch v2.4.0
$ cd kubernetes-ingress/deployments

$ kubectl apply -f common/ns-and-sa.yaml
$ kubectl apply -f rbac/rbac.yaml
$ kubectl apply -f rbac/ap-rbac.yaml
$ kubectl apply -f rbac/apdos-rbac.yaml

$ kubectl apply -f common/default-server-secret.yaml
$ kubectl apply -f common/nginx-config.yaml
$ kubectl apply -f common/ingress-class.yaml


$ kubectl apply -f daemon-set/nginx-ingress.yaml

I have followed DaemonSet method.

$ kubectl get all -n nginx-ingress
NAME                      READY   STATUS    RESTARTS   AGE
pod/nginx-ingress-bcrk5   0/1     Running   0          19m
pod/nginx-ingress-ndpfz   0/1     Running   0          19m
pod/nginx-ingress-nvp98   0/1     Running   0          19m

NAME                           DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/nginx-ingress   3         3         0       3            0           <none>          19m
$ kubectl describe pods nginx-ingress-bcrk5 -n nginx-ingress
Events:
  Type     Reason     Age                     From               Message
  ----     ------     ----                    ----               -------
  Normal   Scheduled  38m                     default-scheduler  Successfully assigned nginx-ingress/nginx-ingress-bcrk5 to node-4
  Normal   Pulling    38m                     kubelet            Pulling image "nginx/nginx-ingress:2.4.0"
  Normal   Pulled     37m                     kubelet            Successfully pulled image "nginx/nginx-ingress:2.4.0" in 19.603066401s
  Normal   Created    37m                     kubelet            Created container nginx-ingress
  Normal   Started    37m                     kubelet            Started container nginx-ingress
  Warning  Unhealthy  3m13s (x2081 over 37m)  kubelet            Readiness probe failed: HTTP probe failed with statuscode: 503

$ kubectl describe pods nginx-ingress-ndpfz -n nginx-ingress
Events:
  Type     Reason     Age                     From               Message
  ----     ------     ----                    ----               -------
  Normal   Scheduled  38m                     default-scheduler  Successfully assigned nginx-ingress/nginx-ingress-ndpfz to node-3
  Normal   Pulling    38m                     kubelet            Pulling image "nginx/nginx-ingress:2.4.0"
  Normal   Pulled     38m                     kubelet            Successfully pulled image "nginx/nginx-ingress:2.4.0" in 19.339839106s
  Normal   Created    38m                     kubelet            Created container nginx-ingress
  Normal   Started    38m                     kubelet            Started container nginx-ingress
  Warning  Unhealthy  3m50s (x2081 over 38m)  kubelet            Readiness probe failed: HTTP probe failed with statuscode: 503

$ kubectl describe pods nginx-ingress-nvp98 -n nginx-ingress
Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  39m                    default-scheduler  Successfully assigned nginx-ingress/nginx-ingress-nvp98 to node-2
  Normal   Pulling    39m                    kubelet            Pulling image "nginx/nginx-ingress:2.4.0"
  Normal   Pulled     38m                    kubelet            Successfully pulled image "nginx/nginx-ingress:2.4.0" in 19.273346892s
  Normal   Created    38m                    kubelet            Created container nginx-ingress
  Normal   Started    38m                    kubelet            Started container nginx-ingress
  Warning  Unhealthy  4m8s (x2081 over 38m)  kubelet            Readiness probe failed: HTTP probe failed with statuscode: 503

Still READY and UP-TO-DATE state showing 0, Ideally it show 3 in both the categories. Please let me know what i'm missing here as part of installation?

Any help is appreciated.

CodePudding user response:

can you share the nginx logs?

kubectl -n nginx-ingrelss logs -l app=ginx-ingress

I can't guess anything..

CodePudding user response:

I'd recommend installing it using helm

See https://github.com/nginxinc/kubernetes-ingress/tree/main/deployments/helm-chart

helm repo add nginx-stable https://helm.nginx.com/stable

helm install nginx-ingress nginx-stable/nginx-ingress \
    --namespace $NAMESPACE \
    --version $VERSION

You can look for versions compatibles with your Kubernetes cluster version using:

helm search repo nginx-stable/nginx-ingress --versions

When installation is well finished, you should see ingress-controller service that holds an $EXTERNAL-IP

NAME                                 TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)                                  AGE

ingress-nginx-controller             LoadBalancer   10.0.XXX.XXX   XX.XXX.XXX.XX   80:30578/TCP,443:31874/TCP               548d
  • Related