senthilrch / kube-fledged

A kubernetes operator for creating and managing a cache of container images directly on the cluster worker nodes, so application pods start almost instantly
Apache License 2.0
1.26k stars 119 forks source link

Feature/Question possible to use kustomize with image transformer on ImageCache? #191

Closed mgeri closed 1 year ago

mgeri commented 2 years ago

We use kustomize for cluster deployment, and we are trying to use the image transformation with ImageCache without success. We tried to add this configuration for image transformation:

images:
- path: spec/cacheSpec/images
  kind: ImageCache

But it fails, because it seems that the image transformer works with ScalarNode and not SequenceNode. We don't know if we are missing something with kustomize or if something similar is needed to make the kustomize image transformer work:

apiVersion: kubefledged.io/v1alpha2
kind: ImageCache
spec:
  cacheSpec:
  - images:
    - name: us.gcr.io/k8s-artifacts-prod/cassandra:v7
    - name: us.gcr.io/k8s-artifacts-prod/etcd:3.5.4-0
    nodeSelector:
      tier: backend
senthilrch commented 2 years ago

Is Kustomize image transformer working fine with the above modified ImageCache manifest?

mgeri commented 2 years ago

It works using the following image transformation configuration, i.e., when name is a ScalarNode:

images:
- path: spec/cacheSpec/images/name
  kind: ImageCache

If the path in the kustomize configuration point to a SequenceNode, it doesn't work. I'm unsure if there is another way to set up a kustomize configuration that works with sequences. I tried to find docs and samples without success.

senthilrch commented 2 years ago

Pls. raise this issue against kustomize project and let's see what they have to say