2

I'm trying to deploy a knative service in my local Kubernetes cluster (Docker Desktop for windows). I could create a knative service when I use images from the google cloud container registry (gcr.io/knative-samples/helloworld-go) but I'm facing an issue when I use images from the docker hub. Please note that I not using any private repository in the Docker registry.

The revision.serving will be in status unknown for the first 10 minutes and later changes to false with the reason ProgressDeadlineExceeded. The knative service fails with reason RevisionMissing. I have tried using the official hello-world image from docker hub and the response is the same. The issue is only when I'm using images from the docker official registry but now when GCR is used.

Below is the Kubernetes manifest file I used to create a knative service.

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: **********
spec:
  template:
    metadata:
      # This is the name of our new "Revision," it must follow the convention {service-name}-{revision-name}
      name: *******-rev1
    spec:
      containers:
        - image: docker.io/*****/****:v1
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 3007

screenshot of kubernetes resources

Note: I'm using knative-serving version 1.0 Edit: (I have hidden image name)

status of revision.serving

  • Could you please add the pods (`kubectl get pods`) output to the information provided? If it's reporting an image pull error, could you also add the information of the **specific** pod (`kubectl get pods $podname`)? – markusthoemmes Nov 26 '21 at 11:20
  • @markusthoemmes (kubectl get pods) give No resources found as output as when the status changed from unknown to false, pods got terminated. However, I'm attaching the status of revision.serving resource (screenshot) in the question in hope that it can help in understanding the issue. – Vinay Cheguri Nov 26 '21 at 12:03

2 Answers2

2

Finally, I resolved the issue by removing the ports session in the YAML file. If the container port is included, the application gets started in a container (I have verified the logs) but it never receives the traffic and fails with the ProgressDeadlineExceeded error.

  • 2
    When you set the `containerPort`, Knative should update the `$PORT` environment variable when running the container. If your application doesn't reference this environment variable when setting up the HTTP server, it's likely that health checks (and your application) will fail. – E. Anderson Nov 29 '21 at 18:30
  • 1
    If you don't set `containerPort`, Knative will default to `8080`, which is a common port used by many development servers. – E. Anderson Nov 29 '21 at 18:31
  • I am facing the same issue, but this does not look like a proper solution to me. More like a workaround. If you change the port of your service, wouldn't it impact either the users of the service or the container started by the service which has a specific port exposure? – Alexis.Rolland Nov 23 '22 at 07:57
  • @Alexis.Rolland can you try checking if your application is running on the same port which you specified in the manifest file? – Vinay Cheguri Nov 23 '22 at 12:13
  • @VinayCheguri actually I recreated a question and was able to troubleshoot my problem like this: https://stackoverflow.com/questions/74543499/knative-service-deployment-fails-with-reason-revisionmissing – Alexis.Rolland Nov 24 '22 at 05:39
-1

Due to how docker hub does authentication, you need to follow the procedure of using a private registry, creating secrets and so on. Here are the steps: https://knative.dev/docs/serving/deploying-from-private-registry/

Nader
  • 39
  • 2