canonical / knative-operators

Charmed Knative Operators
Apache License 2.0
1 stars 1 forks source link

default value of `custom_images` config in `knative-serving` and `knative-eventing` charms is missing some images #185

Closed NohaIhab closed 3 weeks ago

NohaIhab commented 3 weeks ago

Bug Description

knative-serving

The default value of custom_images config in knative-serving charm currently is: https://github.com/canonical/knative-operators/blob/6ab4fcd49a92035816480e4e33a861cc33443f85/charms/knative-serving/config.yaml#L25-L34 These image keys are missing some configurable images that are deployed by knative-serving. We can see what the missing images are when deploying knative-serving in air-gapped and setting the images for the names in the default config in the permalink above. The following pods in knative-serving namespace are then failing to start with image pull error:

domain-mapping-89bf96888-qb64k                           0/1     ErrImagePull   0          56s
domainmapping-webhook-5b5bbf7588-zn976                   0/1     ErrImagePull   0          56s
storage-version-migration-serving-serving-1.10.2-tfr85   0/1     ErrImagePull   0          9s

knative-eventing

The default value of custom_images config in knative-eventing charm currently is: https://github.com/canonical/knative-operators/blob/26993c2478a3a1cfce417570c35f0a1bdd9fd888/charms/knative-eventing/config.yaml#L13-L19 These image keys are missing some configurable images that are deployed by knative-eventing. We can see what the missing images are when deploying knative-eventing in air-gapped and setting the images for the names in the default config in the permalink above. The following pods in knative-eventing namespace are then failing to start with image pull error:

kubectl get deploy -n knative-eventing | grep 0/1
mt-broker-filter        0/1     1            0           4m27s
mt-broker-ingress       0/1     1            0           4m26s
mt-broker-controller    0/1     1            0           4m26s

To Reproduce

  1. Setup an airgapped environment with local registry
  2. Deploy knative-operator, knative-eventing, and knative-serving while setting the custom images that have their names in the default config only
  3. Check the pods in knative-serving and knative-eventing namespace

Environment

microk8s 1.25-strict/stable juju 3.1/stable Airgapped environment

Relevant Log Output

See in the bug description

Additional Context

No response

syncronize-issues-to-jira[bot] commented 3 weeks ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5812.

This message was autogenerated

NohaIhab commented 3 weeks ago

From #140 we know that in order to set the images for these deployments owned by knative-serving we need to:

  1. find the name of the container inside a pod that is using the image
  2. set in the KnativeServing the image key and value under .registry.override, where the image key is the same as the container name found in 1. -> this is handled by the custom_images config. So basically we just need to add to the custom_images config:
    <container_name>: <local_image_name>

    for every image that is missing in the config

The same applies for knative-eventing

NohaIhab commented 3 weeks ago

By looking at the description of the pods failing with ErrImagePull:

  1. domainmapping-webhook pod
    
    kubectl describe po -n knative-serving domainmapping-webhook-5b5bbf7588-zn976

Containers: domainmapping-webhook: Container ID:
Image: gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping-webhook@sha256:7368aaddf2be8d8784dc7195f5bc272ecfe49d429697f48de0ddc44f278167aa ... ... Events: Type Reason Age From Message


Normal BackOff 3m57s (x39 over 13m) kubelet Back-off pulling image "gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping-webhook@sha256:7368aaddf2be8d8784dc7195f5bc272ecfe49d429697f48de0ddc44f278167aa"

2. `domain-mapping` pod

Containers: domain-mapping: Container ID:
Image: gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping@sha256:f66c41ad7a73f5d4f4bdfec4294d5459c477f09f3ce52934d1a215e32316b59b ... ... Events: Type Reason Age From Message


Normal BackOff 2m48s (x60 over 17m) kubelet Back-off pulling image "gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping@sha256:f66c41ad7a73f5d4f4bdfec4294d5459c477f09f3ce52934d1a215e32316b59b"

3. `storage-version-migration-serving-serving-1.10.2` pod

Containers: migrate: Container ID:
Image: gcr.io/knative-releases/knative.dev/pkg/apiextensions/storageversion/cmd/migrate@sha256:bc91e1fdaf3b67876ca33de1ce15b1268ed0ca8da203102b7699286fae97cf58 ... ... Events: Type Reason Age From Message


Normal BackOff 3m36s (x62 over 18m) kubelet Back-off pulling image "gcr.io/knative-releases/knative.dev/pkg/apiextensions/storageversion/cmd/migrate@sha256:bc91e1fdaf3b67876ca33de1ce15b1268ed0ca8da203102b7699286fae97cf58"


We can conclude that the containers with missing images are:

domainmapping-webhook domain-mapping migrate


Hence, these are the keys which we are missing from the `custom_images` config default
NohaIhab commented 3 weeks ago

For knative-eventing the missing images are:

mt-broker-controller/mt-broker-controller
mt-broker-filter/filter
mt-broker-ingress/ingress
pingsource-mt-adapter/dispatcher

The format is <deployment_name>/<container_name> as indicated in the Knative upstream docs

NohaIhab commented 3 weeks ago

closed by #187