0

I have deployed a service on Knative. I iterated on the service code/Docker image and I try to redeploy it at the same address. I proceeded as follow:

  1. Pushed the new Docker image on our private Docker repo
  2. Updated the service YAML file to point to the new Docker image (see YAML below)
  3. Delete the service with the command: kubectl -n myspacename delete -f myservicename.yaml
  4. Recreate the service with the command: kubectl -n myspacename apply -f myservicename.yaml

During the deployment, the service shows READY = Unknown and REASON = RevisionMissing, and after a while, READY = False and REASON = ProgressDeadlineExceeded. When looking at the logs of the pod with the following command kubectl -n myspacename logs revision.serving.knative.dev/myservicename-00001, I get the message:

no kind "Revision" is registered for version "serving.knative.dev/v1" in scheme "pkg/scheme/scheme.go:28"

Here is the YAML file of the service:

---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: myservicename
  namespace: myspacename
spec:
  template:
    metadata:
      annotations:
        autoscaling.knative.dev/class: kpa.autoscaling.knative.dev
        autoscaling.knative.dev/metric: concurrency
        autoscaling.knative.dev/target: '1'
        autoscaling.knative.dev/minScale: '0'
        autoscaling.knative.dev/maxScale: '5'
        autoscaling.knative.dev/scaleDownDelay: 60s
        autoscaling.knative.dev/window: 600s
    spec:
      tolerations:
        - key: nvidia.com/gpu
          operator: Exists
          effect: NoSchedule
      volumes:
        - name: nfs-volume
          persistentVolumeClaim:
            claimName: myspacename-models-pvc
      imagePullSecrets:
        - name: myrobotaccount-pull-secret
      containers:
        - name: myservicename
          image: quay.company.com/project/myservicename:0.4.0
          ports:
            - containerPort: 5000
              name: user-port
              protocol: TCP
          resources:
            limits:
              cpu: "4"
              memory: 36Gi
              nvidia.com/gpu: 1
            requests:
              cpu: "2"
              memory: 32Gi
          volumeMounts:
            - name: nfs-volume
              mountPath: /tmp/static/
          securityContext:
            privileged: true
          env:
            - name: CLOUD_STORAGE_PASSWORD
              valueFrom:
                  secretKeyRef:
                    name: myservicename-cloud-storage-password
                    key: key
          envFrom:
            - configMapRef:
                name: myservicename-config
Alexis.Rolland
  • 5,724
  • 6
  • 50
  • 77

1 Answers1

0

The protocol I followed above is correct, the problem was because of a bug in the code of the Docker image that Knative is serving. I was able to troubleshoot the issue by looking at the logs of the pods as follow:

First run the following command to get the pod name: kubectl -n myspacename get pods. Example of pod name = myservicename-00001-deployment-56595b764f-dl7x6

Then get the logs of the pod with the following command: kubectl -n myspacename logs myservicename-00001-deployment-56595b764f-dl7x6

Alexis.Rolland
  • 5,724
  • 6
  • 50
  • 77