Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Allow setting env vars on concourse web - #5641

Closed
mattjmcnaughton wants to merge 1 commit into
helm:masterfrom
mattjmcnaughton:mattjmcnaughton/5597-set-env-vars-on-concourse-web-deployment
Closed

mattjmcnaughton wants to merge 1 commit into
helm:masterfrom
mattjmcnaughton:mattjmcnaughton/5597-set-env-vars-on-concourse-web-deployment

Conversation

@mattjmcnaughton

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Previously it was only possible to set additional env vars on the
worker pod. Its conceivable that a user would also want to set
additional env vars on the web pod.

I tested this by uncommenting the added configuration in values.yaml,
running helm install . and verifying kubectl exec -t WEB_POD_NAME env | grep CONCOURSE_LOG_LEVEL
returned a result.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #5597

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 18, 2018
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mattjmcnaughton
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: william-tran

Assign the PR to them by writing /assign @william-tran in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @mattjmcnaughton. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 18, 2018
@k8s-ci-robot
k8s-ci-robot requested a review from william-tran May 18, 2018 13:20
@mattjmcnaughton

Copy link
Copy Markdown
Contributor Author

/assign @william-tran

Thanks!

@timstoop timstoop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the README as well.

Comment thread stable/concourse/Chart.yaml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a new feature, please bump the minor version of the Chart.

@mattjmcnaughton

Copy link
Copy Markdown
Contributor Author

Can do for both :) Thanks @timstoop

Previously it was only possible to set additional env vars on the
`worker` pod. Its conceivable that a user would also want to set
additional env vars on the `web` pod.

I tested this by uncommenting the added configuration in `values.yaml`,
running `helm install .` and verifying `kubectl exec -t WEB_POD_NAME env | grep CONCOURSE_LOG_LEVEL`
returned a result.
@mattjmcnaughton

Copy link
Copy Markdown
Contributor Author

PR updated and ready for another look whenever y'all get a chance :) @timstoop @william-tran

| `web.nameOverride` | Override the Concourse Web components name | `nil` |
| `web.replicas` | Number of Concourse Web replicas | `1` |
| `web.resources` | Concourse Web resource requests and limits | `{requests: {cpu: "100m", memory: "128Mi"}}` |
| `web.env` | Configure additional environment variables for the web container(s) | `[]` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practises are moving towards using extraEnv for this, to make it clear that they are added in addition to the already provided ones (if any).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to know! Updating now :)

@mattjmcnaughton mattjmcnaughton May 21, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, actually, as I think about this more, my concern is that workers.env already exists. So I'm worried about it being confusing that for worker pods you specify env, but for web pods you specify extraEnv.

So I guess the options are:

  1. Use web.extraEnv and worker.env and just accept the discrepancy might be confusing.
  2. Use web.extraEnv and switch worker.env to worker.extraEnv. My concern with that is that it would be a breaking API change, correct? I'm not really sure what best practice for that is in the helm chart community.
  3. Use web.env and worker.env for consistency.

Let me know which option you think is best @timstoop !

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, option 2 looks best. You can signal a breaking change (although I think it's currently still ascetically only, helm users don't get a warning or anything) by bumping the major of the version. I see no reason not to do that, honestly. @frodenas @william-tran As chart owners, what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, that sounds good to me! I'll wait for signoff from @frodenas or @william-tran before updating the pr :)

@william-tran

Copy link
Copy Markdown
Collaborator

@mattjmcnaughton if we go with option 2, I'd like to force users that were using worker.env to migrate those values to extraEnv through some template logic. Or we can just merge worker.env with worker.extraEnv and maintain backwards compatibility

@william-tran

Copy link
Copy Markdown
Collaborator

Superseded by #6441

@william-tran

Copy link
Copy Markdown
Collaborator

/close

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[stable/concourse] set env vars on web deployment

4 participants