Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm charts: unexpected image name splicing #2477

Closed
STRRL opened this issue Nov 5, 2021 · 5 comments · Fixed by #2496
Closed

helm charts: unexpected image name splicing #2477

STRRL opened this issue Nov 5, 2021 · 5 comments · Fixed by #2496
Assignees
Milestone

Comments

@STRRL
Copy link
Member

STRRL commented Nov 5, 2021

Feature Request

Is your feature request related to a problem? Please describe:

Yes.

make install could not works well on the current master (bfee629), after #2462 merged.

After we migrated the docker images from dockerhub to ghcr.io, the way to render the image name is not suitable anymore, because the ghcr.io repository domain has been brought by default:

Ref:

image: {{template "registry-prefix" .}}{{ .Values.dashboard.image }}

We are now using {{template "registry-prefix" .}}{{ .Values.dashboard.image }}, but the registry-prefix should already be a part of image name.

Our official image is ghcr.io/chaos-mesh/chaos-mesh/chao-mesh/:latest, if the user has a self-hosted mirror with domain mirror.self.hosted, and the user setup registry in the helm values, the final result is mirror.self.hosted/ghcr.io/chaos-mesh/chaos-mesh/chao-mesh/:latest, which is incorrect.

Describe the feature you'd like:

Updated:

Pattern B with registry, repository, tag is chosen to use.

I'm not sure about which is the most fluency way to configure the image. I would give some available solutions in the comments. :)

Feel free to leave any comments!

Describe alternatives you've considered:

No other alternatives.

Teachability, Documentation, Adoption, Migration Strategy:

@STRRL STRRL added this to the Release 2.1 milestone Nov 5, 2021
@STRRL STRRL added this to To do in Project Kanban via automation Nov 5, 2021
@STRRL STRRL self-assigned this Nov 5, 2021
@STRRL
Copy link
Member Author

STRRL commented Nov 5, 2021

Pattern A:

Remove registry directly, only use image.

If user use

helm upgrade --set registry: mirrors.self.hosted

before, he should use

helm upgrade --set controllerManager.image ghcr.io/chaos-mesh/chaos-mesh:latest \
  --set controllerManager.image ghcr.io/chaos-mesh/chaos-mesh:latest \
  --set chaosDaemon.image ghcr.io/chaos-mesh/chaos-daemon:latest \
  --set dashboard.image ghcr.io/chaos-mesh/chaos-dashboard:latest \
  --set bpfki.image ghcr.io/chaos-mesh/chaos-kernel:latest

after the updates.

Many flags need to be set, but if the user using a values.yaml to setup the helm installation, the operation is not so different.

Well-known projects use this pattern:

Pattern B:

Use three parts (registry, repository, tag) to define the image name, and

  • setup the default registry to ghcr.io
  • setup each repository for each component, like controllerManager.repository, dashboard.repository
  • setup the default tag to the release version

The disadvantage is there is no completed docker image name in the configuration file.

Well-known projects use this pattern:

Pattern C:

Use two parts (repository, tag) to define the image name. It's both similar to pattern A and pattern B. But I think this pattern is not suitable for Chaos Mesh, because:

  • Chaos Mesh Helm Charts's version upgrades with appVersion, so you should switch to another version of charts if you want to upgrade/downgrade, not only replace the image tag
  • As the former says, if tag is consistent, pattern C is extremely the same as pattern A.

Well-known projects use this pattern:

Pattern D(which is not recommended personally):

Replace the repository domain in <component>.image with the given registry.

Input:

Input:
	registry: mirror.self.hosted
	image: ghcr.io/chaos-mesh/chaos-mesh:latest
Output:
	mirror.self.hosted/chaos-mesh/chaos-mesh:latest
Input:
	registry: 
	image: ghcr.io/chaos-mesh/chaos-mesh:latest
Output:
	ghcr.io/chaos-mesh/chaos-mesh:latest

I do not recommend it because it's not simple enough, including replacing and string cutting.

@cwen0
Copy link
Member

cwen0 commented Nov 5, 2021

Pattern A:

Remove registry directly, only use image.

If user use

helm upgrade --set registry: mirrors.self.hosted

before, he should use

helm upgrade --set controllerManager.image ghcr.io/chaos-mesh/chaos-mesh:latest \
  --set controllerManager.image ghcr.io/chaos-mesh/chaos-mesh:latest \
  --set chaosDaemon.image ghcr.io/chaos-mesh/chaos-daemon:latest \
  --set dashboard.image ghcr.io/chaos-mesh/chaos-dashboard:latest \
  --set bpfki.image ghcr.io/chaos-mesh/chaos-kernel:latest

after the updates.

Many flags need to be set, but if the user using a values.yaml to setup the helm installation, the operation is not so different.

Well-known projects use this pattern:

Pattern B:

Use three parts (registry, repository, tag) to define the image name, and

  • setup the default registry to ghcr.io
  • setup each repository for each component, like controllerManager.repository, dashboard.repository
  • setup the default tag to the release version

The disadvantage is there is no completed docker image name in the configuration file.

Well-known projects use this pattern:

Pattern C:

Use two parts (repository, tag) to define the image name. It's both similar to pattern A and pattern B. But I think this pattern is not suitable for Chaos Mesh, because:

  • Chaos Mesh Helm Charts's version upgrades with appVersion, so you should switch to another version of charts if you want to upgrade/downgrade, not only replace the image tag
  • As the former says, if tag is consistent, pattern C is extremely the same as pattern A.

Well-known projects use this pattern:

Pattern D(which is not recommended personally):

Replace the repository domain in <component>.image with the given registry.

Input:

Input:
	registry: mirror.self.hosted
	image: ghcr.io/chaos-mesh/chaos-mesh:latest
Output:
	mirror.self.hosted/chaos-mesh/chaos-mesh:latest
Input:
	registry: 
	image: ghcr.io/chaos-mesh/chaos-mesh:latest
Output:
	ghcr.io/chaos-mesh/chaos-mesh:latest

I do not recommend it because it's not simple enough, including replacing and string cutting.

I prefer pattern A. This pattern is more simple.

@iguoyr
Copy link
Member

iguoyr commented Nov 8, 2021

traefik https://artifacthub.io/packages/helm/bitnami/nginx-ingress-controller?modal=template&template=controller-deployment.yaml
cilium https://artifacthub.io/packages/helm/cilium/cilium?modal=template&template=cilium-nodeinit/daemonset.yaml

@STRRL Hi, it has some errors here, traefik is belong to patternB, and cilium is belong to patternC. BTW, reading the value.yaml and xxx.tpl is the best way to figure it out :)

And about patternA, it's applicable to charts with single service component, while patternB is more applicable to charts with multi-service components. More specifically, when using patternB, users basically only need to --set the registry and tag manually, while patternA needs to specify more parameters which will increase with the increase of service components.

@Hexilee
Copy link
Member

Hexilee commented Nov 8, 2021

I prefer pattern B as registry is an appropriate abstraction. Pattern A or pattern C is more appropriate only when we plan to publish images to different registries.

@STRRL
Copy link
Member Author

STRRL commented Nov 9, 2021

I would work on pattern B from the above comments. :D

Project Kanban automation moved this from To do to Done Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants