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

appVersion, tag, and repository changes #132

Open
ytjohn opened this issue May 13, 2020 · 3 comments
Open

appVersion, tag, and repository changes #132

ytjohn opened this issue May 13, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@ytjohn
Copy link
Contributor

ytjohn commented May 13, 2020

In #131 we added image.repository. I'd also like to add an optional image.tag, while defaulting to Chart.AppVersion. However, before I make the PR, I am seeing that st2chatops and st2sensorcontainer (which is really the user-provided custom st2packs container) both have their own "image.tag" and "image.repository" sections.

I see three paths to take:

  1. Make the small change to Values.image.tag and leave st2chatops/st2sensorcontainer alone
  2. Leave st2sensorcontainer alone and update st2chatops to default to top-level [image] section
  3. Add standardized image.repository + image.tag to each st2* section in values.yaml, while defaulting to the top-level [images] section.

image: "{{ template "imageRepository" . }}/st2actionrunner{{ template "enterpriseSuffix" . }}:{{ default .Chart.AppVersion .Values.image.tag }}"

image:
  ...
  # custom tag for st2 docker images.
  # tag: "3.2dev-custom"

The end result would work like so:

$ helm template --set st2chatops.enabled=true . | grep 'image: .*/st2'
    image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2auth:3.2dev"
        image: "stackstorm/st2auth:3.2dev"
        image: "stackstorm/st2api:3.2dev"
        image: "stackstorm/st2stream:3.2dev"
        image: "stackstorm/st2web:3.2dev"
        image: "stackstorm/st2rulesengine:3.2dev"
        image: "stackstorm/st2timersengine:3.2dev"
        image: "stackstorm/st2workflowengine:3.2dev"
        image: "stackstorm/st2scheduler:3.2dev"
        image: "stackstorm/st2notifier:3.2dev"
        image: "stackstorm/st2sensorcontainer:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2garbagecollector:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2chatops:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
        image: "stackstorm/st2actionrunner:3.2dev"
helm template --set st2chatops.enabled=true --set image.tag=3.2-custom --set image.repository=privaterepo . | grep 'image: .*/st2'    image: "privaterepo/st2actionrunner:3.2dev"
        image: "privaterepo/st2auth:3.2-custom"
        image: "privaterepo/st2auth:3.2-custom"
        image: "privaterepo/st2api:3.2-custom"
        image: "privaterepo/st2stream:3.2-custom"
        image: "privaterepo/st2web:3.2-custom"
        image: "privaterepo/st2rulesengine:3.2-custom"
        image: "privaterepo/st2timersengine:3.2-custom"
        image: "privaterepo/st2workflowengine:3.2-custom"
        image: "privaterepo/st2scheduler:3.2-custom"
        image: "privaterepo/st2notifier:3.2-custom"
        image: "privaterepo/st2sensorcontainer:3.2dev"
        image: "privaterepo/st2actionrunner:3.2-custom"
        image: "privaterepo/st2garbagecollector:3.2-custom"
        image: "privaterepo/st2actionrunner:3.2-custom"
        image: "privaterepo/st2actionrunner:3.2-custom"
        image: "stackstorm/st2chatops:3.2dev"
        image: "privaterepo/st2actionrunner:3.2-custom"
        image: "privaterepo/st2actionrunner:3.2-custom"
        image: "privaterepo/st2actionrunner:3.2-custom"
        image: "privaterepo/st2actionrunner:3.2-custom"
        image: "privaterepo/st2actionrunner:3.2-custom"
@arm4b
Copy link
Member

arm4b commented May 13, 2020

I think it's just a matter of time when someone would want to rely on specific docker image for something like st2actionrunner, st2sensorcontainer or any other st2 service and so adding this configuration per container makes perfect sense to me long term.

https://github.com/StackStorm/stackstorm-ha/blob/00705503e72841ae5ee043468b0d3c0d801b1d4f/values.yaml#L395-L402

@arm4b arm4b added the enhancement New feature or request label May 13, 2020
@cognifloyd
Copy link
Member

cognifloyd commented Jun 18, 2021

  1. Make the small change to Values.image.tag and leave st2chatops/st2sensorcontainer alone
  2. Leave st2sensorcontainer alone and update st2chatops to default to top-level [image] section
  3. Add standardized image.repository + image.tag to each st2* section in values.yaml, while defaulting to the top-level [images] section.

I think a PR that does option 2 would be a good first step.

We could set st2.image.tag to {{ .Chart.AppVersion }} and then rely on that to provide the default (or the override) wherever we need it. So, st2chatops could be changed like this:

-{{ tpl (.Values.st2chatops.image.tag | default .Chart.AppVersion) . }}
+{{ tpl (.Values.st2chatops.image.tag | default .Values.image.tag) . }}

And then all the other apps could get similar treatment like you described in option 3.

ps: I looked at creating a imageTag template, but it gets pretty ugly because the template would access to both .Chart.AppVersion and .st2___.image where .st2___ is .st2chatops or whatever section is needed.

@cognifloyd
Copy link
Member

cognifloyd commented Jun 18, 2021

I just pushed #200 to add image.tags to all of the pods (so option 3).

I only added image.tags in #200, not image.repository. I'm happy to push all of the images to a private registry and just change the tag for them, so I don't need per-pod image.repository settings. If someone really wants to grab the images from separate repos, then they'll need to adjust, replace, or inline the imageRepository template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants