-
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
Feature Request: Using ConfigMap Values For Params #1744
Comments
/kind feature |
+1, we should make this change. This makes configuring the controller more standard, and could let users update the support images to use (git-init, creds-init, etc.) without requiring a restart of the controller pod. |
Thinking through this a bit more: Luckily at least some of the groundwork is already done: support images are parsed from flags and set as fields on the These fields should become methods that return the current value, and some background process could monitor the ConfigMap and update the values returned by that method. As a first step we can update one image to use the ConfigMap style, then prove it works, then update the rest. It probably wouldn't be a very hard change at all. |
Knative configures their queue proxy image using a ConfigMap: https://github.com/knative/serving/blob/b3079512daae9708f11c7b8ea41ef54023c91725/config/config-deployment.yaml#L26 Their Their "deployment config" object is effectively the same as our " |
sigh -- and after I just closed #1197 . The case can be made for this feature however I can say that I really thought I wanted this feature but in practice found I never needed it. |
I'm not sure I understand how these are related? That issue seems to be about letting users declare TaskRun/PipelineRun values as coming from a ConfigMap (which I admit does sound useful?). This issue is about letting operators specify/update controller args using ConfigMaps, which is more of an operator concern and not really exposed to end users. Am I misunderstanding? |
Hmm... maybe I'm the one misunderstanding. @tomfrenken Is this issue for something like an install time kustomization of a Task and Pipeline. e.g. not something at runtime? Can you maybe describe a bit more what you're looking for. |
if no one's working on it, I can take a look @imjasonh |
I’m really interested in that feature. I don’t know if it’s out of scope here but I think it could be great to be able to get the default value from the ConfigMap. It would mean having a way to deploy Tasks and Pipelines which could be invoked by operators via ConfigMaps and also by user via the CLI. |
Hey folks, I'm coming late to this issue but I was wondering if someone could clearly articulate use-cases and scope of this change. The description sounds to me exactly like @skaegi 's
But then we seem to says this is not what's being asked for:
And now I'm really confused. I see no mention of the controller or its arguments anywhere in the initial issue description. This issue really reads to me as precisely So before we move ahead could somebody write out one or two clearly defined user-facing use cases and a description of what's in-scope / out-of-scope? It would be excellent to see what the intended final syntax looks like as well in the context of a Task / TaskRun / Pipeline / PipelineRun. I don't mind if it's a short design doc or just a comment here with some code blocks. |
Also: the title of this issue is literally "Feature Request: Using ConfigMap Values For Params". I am so confused. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
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. |
Any update on this? |
I just discovered this issue, for me this comes into play when I do not control the task, i.e. it's a ClusterTask or a Task being sourced from elsewhere. This task is essentially a black box that specifies parameters x,y,z and I would like to source them from a configmap or a secret, passing environment variables here isn't helpfull since the task is specifically expecting parameters. The only way I can see to achieve this is to write a pre-task that sources the configmap or secret and outputs the values as results which can then be referenced as parameters. This feels overly convoluted and awkward, the original syntax that is being proposed here fits the bill of what I i'm looking for, i.e.:
|
/reopen |
@vdemeester: Reopened this issue. In response to this:
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. |
I can provide a use case we are facing that this feature would solve. We have a pipeline Task that builds a Java application using Gradle. In order to have a speedy execution, we have built an image containing all Gradle dependencies that we use in this Task. The Task looks like this now: apiVersion: tekton.dev/v1beta1
kind: Task
...
spec:
steps:
image: "our.image.registry/gradle-cached-image:1.4.5"
... Since the dependencies of our Java application regularly change, we automatically re-build this image and update the Task definition by hand. It would be super useful if we could just update a ConfigMap in k8s, containing the new image name, and in the Task put something like: kind: Task
spec:
params:
- name: gradle-image
valueFrom:
configMapKeyRef:
name: gradle-image
key: image
steps:
image: "$(params.gradle-image)" |
@chengjoey @vdemeester @lbernick Hi, I ran into this issue and it seems the first attempt to implement the feature stopped due to the lack of TEP. May I take it over from there and start writing a TEP? 🙂 |
Definitely, thanks @shuheiktgw! You can find more info on the TEP process and how to create one here |
Actually, it looks like there's an existing TEP for this: tektoncd/community#868 |
I would really like this feature, use-case as follows. We're trying to inject a SONARQUBE_TOKEN into the default (installed by the openshift-pipelines operator) s2i-java ClusterTask as a parameter. We do not want to hard-code the token into the pipeline params as we want to keep the repo containing the pipeline free from secrets. And we also do not want to fork the ClusterTask just to be able to add a
|
Hi, I am new-ish to Tekton and have started looking at this issue to work on it. I have a few questions:
|
@JohanNordlinder I don't know if this is still relevant- the problem with passing secrets into parameters is that resolved parameters may end-up into the status. If this feature is implemented for secrets, we should take extra care about this. There was some discussion about this on the TEP tektoncd/community#868. Would mounting the secret via a workspace work for you? This is possible today |
Hi, welcome to Tekton!
If it is implemented for one resource, it might as well be implemented for all.
I think it should only be possible to define a config map at runtime. but we could explore use cases for using this as Task level.
Subscribing for updates does not sound like a good idea,
|
Thanks Andrea for the detailed answer! I have one more question.
I agree with you (if I understood correctly) that it's better to define My question about overridability is for the following usecase. Should the TaskRun fail because the user is trying to set the value during TaskRun or should the TaskRun not fail and allow the user to override the value that would be obtained from the configmap by the value defined in the TaskRun? Task
TaskRun
|
Yes @afrittoli it's still relevant for us, right now I'm using the workaround proposed above by @gnunn1 with a pre-task that exposes the token as a task result which I then pass as the param value to the task. Mounting the secret via a workspace is an interesting alternative, but I see two reasons this isn't a perfect fit;
Bottom line; tasks would be so much easier to reuse if it was possible to reference a ConfigMap or Secret in the param declaration of a taskRef. |
Each of type Param struct {
Name string `json:"name"`
Value ParamValue `json:"value"`
} so I can just a add a new field to this struct (would start with ConfigMap only and not SecretKeyRef for now) Will try to have a TEP and a PR up by end of next week |
Apologies for the delay:
|
Expected Behavior
When defining parameters for a
Task
in myPipeline
, I would like to use values for the parameters which I defined in aConfigMap
, instead of hardcoding them in thePipeline
.A cool solution would look like the use of
ConfigMaps
when defining environment variables in aPod
, there I am able to do this:if params could work the same way it would be like this:
Actual Behavior
If I want to use a
ConfigMap
I can only use it on aStep
level, and I can't directly access its values, this becomes an issue in the followingTask
:in this example, I want to have the possibility configure the entire
Step
based on theConfigMap
, but currently it would look like this:Note that this wouldn't work for the
image
since I'm only able to use variable substitution there.The text was updated successfully, but these errors were encountered: