cybozu-go/moco

Add ability to specify your own image address

Opened this issue · 3 comments

What

I'm deploying moco mysql in air gapped environment with container image proxy. Ideally I want to specify my own repository for images inside CRD.

How

Either allow overriding image or add new field to CRD imageRepository eg:
imageRepository: harbor.local/ghcr.io
turns image field into eg:
harbor.local/ghcr.io/cybozu-go/moco-agent:0.12.1

Checklist

  • Finish implementation of the issue
  • Test all functions
  • Have enough logs to trace activities
  • Notify developers of necessary actions

@boniek83
Thank you for your comment.
You can specify the image addresses not in a MySQLCluster object but as options of moco-controller.
You can use --agent-image, --backup-image, --fluent-bit-image, and --mysql-exporter-image` options.
https://github.com/cybozu-go/moco/blob/v0.24.1/docs/moco-controller.md
I hope this helps.

This is better than nothing, but ideally I don't want to specify the whole image url. I imagine tags will change often with helm chart updates prompting me to basically maintain these changes if done this way. Changing repository by itself would give me what I need without additional maintenance burden.

@boniek83
I agree that tags will change often and it would be good to keep track of version updates automatically. But I don't think we can provide a generalized feature in CRD to transform image name strings.
In your use case harbor.local/ghcr.io is a user-given input and harbor.local/ghcr.io/cybozu-go/moco-agent:0.12.1 is a desired result. Some may want to retrieve harbor.local/ghcr.io/moco-agent:0.12.1. Some may give harbor.local (without ghcr.io) and want to get harbor.local/ghcr.io/moco-agent:0.12.1. The rule of string conversion would vary depending on the user.
It would be better to provide this type of feature in Helm charts. You could give harbor.local/ghcr.io as an argument or you may need to combine strings by yourself before giving an argument harbor.local/ghcr.io/cybozu-go/moco-agent:0.12.1. It depends on the design.