-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
allow default system namespace to be overridden using an env var #427
allow default system namespace to be overridden using an env var #427
Conversation
I probably ought to add the new env var to the docs somewhere too, in https://github.com/knative/build-pipeline/blob/master/DEVELOPMENT.md#environment-setup maybe? Though that would complicate things as the current |
Thanks for this @rawlingsj !! 🎉
Definitely agree! I think what we really need is some docs about how to setup and configure pipelines, which we don't have yet 🤔 (kind of related to #385) So some options:
What do you think about configuring the namespace in a config-map instead of an environment variable? Just wondering cuz we already have a config-map for some other controller config. Maybe this doesn't make sense tho b/c the controller wouldn't even know what namespace to look for the namespace in 🤔 |
@shashwathi and @imjasonh pointed out that there have been similar changes to serving: knative/serving#2708 <-- so as long as we do pretty much the same thing as that, we should be good! and it looks I think like this configuration also ends up using an env var |
FWIW and in addition to what @bobcatfish already pointed out, a generalized version of the serving bit was added to knative/pkg recently. I think all projects should be able to use that? knative/pkg#235 |
/ok-to-test |
ok great - thanks @bobcatfish @markusthoemmes - will take a look |
nice, thanks @markusthoemmes !! |
sorry for the delay but juggling lots of things ATM, so we're suggesting we
If that's all correct and folks are happy I can close this PR and create a new with above? |
Hmm - just started and suspect there's going to be a problem updating the I'm not sure how we can use https://github.com/knative/pkg/blob/8e50d82/system/names.go#L30 from this repo and keep the current approach of installing via Any other thoughts or ideas? |
Might be nice to avoid the |
Good question - @bobcatfish, do you know re ^^^? |
Yeah this is weird, im looking at knative/serving to see how they've done it, since they seem to be using Looking at the PR where this was added knative/serving#2708 I get the impression there was no good story at that point either about how to handle those yamls, it seems like the assumption is that a user will change them manually 🤔 My only recommendation is to leave the namespace hard-coded in our .yaml files for now, and add some docs about how folks can change them manually (and use the downward api) - not sure there are any better options (maybe @imjasonh has some ideas) |
@bobcatfish's suggestion about leaving hard-coded values in YAML and documenting changing it SGTM, especially if that's what Serving has today. When in doubt we should go along with what the other repos do to solve these problems, even if those solutions are half-baked. |
Ok great, that all sounds good to me. I'll get onto it in the morning. |
@imjasonh @bobcatfish @abayer I was tempted to submit a few PR options for this but figured I'd start simple. I've force pushed to this existing PR but to explain I've rebased which includes the tekton rename but doesn't include the knative/pkg#235 package as suggested in an earlier comment. My thinking is to keep the current If you want me to vendor the |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left comments on doc changes. I had trouble following instructions so thats my feedback.
DEVELOPMENT.md
Outdated
@@ -118,6 +118,22 @@ kubectl create clusterrolebinding cluster-admin-binding \ | |||
--user="${USER}" | |||
``` | |||
|
|||
### Install in custom namespace | |||
1. To install into a different namespace you will need to modify resources in the `./config` | |||
- remove all `namespace: tekton` resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can you update this to "remove all namespace: tekton
references"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DEVELOPMENT.md
Outdated
### Install in custom namespace | ||
1. To install into a different namespace you will need to modify resources in the `./config` | ||
- remove all `namespace: tekton` resources | ||
- delete the `namespace.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing "`" at end of file name. Also can you link the config namespace file here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DEVELOPMENT.md
Outdated
1. To install into a different namespace you will need to modify resources in the `./config` | ||
- remove all `namespace: tekton` resources | ||
- delete the `namespace.yaml | ||
- modify the `subjects.namespace` value to the desired namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again can you link clusterrolebinding
yaml here? I think thats what you are referring here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DEVELOPMENT.md
Outdated
- remove all `namespace: tekton` resources | ||
- delete the `namespace.yaml | ||
- modify the `subjects.namespace` value to the desired namespace | ||
- add `downwardapi` entry to webhook and controller `deployment` resources and set current namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide an example of how to add downwardapi
entry to both deployment resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
- add `downwardapi` entry to webhook and controller `deployment` resources and set current namespace. | ||
|
||
e.g. | ||
```yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the additional space in yaml example. Markdown render looks bit weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@shashwathi thanks for the comments. Think I just resolved them, hopefully it now reads better. |
@@ -118,6 +118,20 @@ kubectl create clusterrolebinding cluster-admin-binding \ | |||
--user="${USER}" | |||
``` | |||
|
|||
### Install in custom namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have one completely minor piece of feedback: usually we have an extra newline after a header.
i'm also happy to lgtm
and let @mattmoor-sockpuppet fix that tho XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool - thanks, I just added the extra newline anyways.
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abayer, rawlingsj, shashwathi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
oh wait I don't have approve rights. heh. |
I'd like to install Build Pipeline in namespace other than
tekton-pipelines
. This change still usestekton-pipelines
as the default but allows folks to set an environment variable to override. As an example I've hacked a Helm chart for easy install while integrating with Build Pipeline, this uses the downward api to set the new env var to the current namespace.If it's of interest this is the chart and override the new env var here.
Also deleted unused
pkg/names.go
as I think it was duplicated inpkg/system/names.go
.