GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.02k stars 1.62k forks source link

skaffold, jib and explicitRegistry #8968

Closed jack1902 closed 1 year ago

jack1902 commented 1 year ago

Expected behavior

skaffold dev should result in the image being built from the gradle project using jib. This works when i use https://skaffold.dev/docs/renderers/helm/#helm-strategy-split-repository-and-tag but when i attempt to use https://skaffold.dev/docs/renderers/helm/#helmexplicitregistry-strategy-split-registry-repository-and-tag it doesn't

Actual behavior

skaffold dev results in an image built without the registry which is pushed into the cluster, but the <key>.registry isn't set either resulting in my defaults kicking in within the helm-chart and the cluster attempts to pull a non-existent image.

If i do skaffold dev --default-repo docker.io for example, it functions but i can't see a way to specify the registry within the skaffold.yaml else i have to ensure that all developers using the skaffold files have a default value set globally (not a biggy but might be worth calling out in the docs that if you intend to use explicitRegistry, one must ensure they set a default repo)

Additionally, if i have:

build:
  artifacts:
    - image: docker.io/someImage
      jib: {}

referring to it seems ugly (and i'm not sure it works?) - prehaps a name on the artifact as image1 would be friendly to refer to it within setValueTemplates as it is really messy otherwise

Information

.

Steps to reproduce the behavior

  1. a clonable repository with the sample skaffold project
  2. skaffold <command>
  3. ...

Additional Context

I'm using the explicit registry as i have to support a multi-pod helm-chart. By making use of global.image.registry i can simply specify different registries for all images in the chart without having to alter each registry one at a time within their values)

jack1902 commented 1 year ago

TL;DR - skaffold config set default-repo anywhere.io will result in things being happy with explicitRegistry. But without a default-repo you can't use explicitRegistry approach

jack1902 commented 1 year ago

Going to close this as I believe it is something the user would need to define to overcome