in

Health probe for custom nginx image returning "not ready"


Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version:
Client Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.0”, GitCommit:“c2b5237ccd9c0f1d600d3072634ca66cefdf272f”, GitTreeState:“clean”, BuildDate:“2021-08-04T18:03:20Z”, GoVersion:“go1.16.6”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“21”, GitVersion:“v1.21.1”, GitCommit:“5e58841cce77d4bc13713ad2b91fa0d961e69192”, GitTreeState:“clean”, BuildDate:“2021-05-21T23:01:33Z”, GoVersion:“go1.16.4”, Compiler:“gc”, Platform:“linux/amd64”}

Cloud being used: DigitalOcean droplet
Installation method: kind
Host OS: ubuntu v21
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend-deployment-v2
  namespace: ingress-nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend-app
  template:
    metadata:
      name: frontend-pod
      labels:
        app: frontend-app
    spec:
      imagePullSecrets:
      - name: ghcr-secret
      containers:
      - name: frontend-container-v2
        image: ghcr.io/...
        imagePullPolicy: IfNotPresent
        env:
        - name: REACT_APP_ENV
          value: "production"
         ports:
          - containerPort: 3000
            name: frontend-p-port
        readinessProbe:
          httpGet:
            path: /
            port: 3000
          initialDelaySeconds: 3
          periodSeconds: 4

The docker image is pulled from a private ghcr.io hosted package. The docker file ends with

ENTRYPOINT ["nginx", "-g", "daemon off;"]

The image works as expected using docker. The image also runs in the cluster. However, the health-check seems to indicate failure.

NAME                                     READY   STATUS    RESTARTS   AGE
frontend-deployment-v2-699bb477c-5c8hc   0/1     Running   0          50m

Does anyone know why this might be?

Thank you in advance.

1 post – 1 participant

Read full topic



Source: https://discuss.kubernetes.io/t/health-probe-for-custom-nginx-image-returning-not-ready/18572

Starter template for Login, Register and Forgot Password using ReactJS with simple form validation

Microx v1.0 – CV Resume and Personal Portfolio HTML5 Template – ULC