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

Ability to bind Workspaces #1283

Open
davissp14 opened this issue Apr 11, 2020 · 28 comments
Open

Ability to bind Workspaces #1283

davissp14 opened this issue Apr 11, 2020 · 28 comments
Labels
area/roadmap Issues that are part of the project (or organization) roadmap (usually an epic) kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@davissp14
Copy link

davissp14 commented Apr 11, 2020

It would be really nice to be able to configure a workspace prior to creating a PipelineRun within the dashboard.

I understand that triggers can be used to do this automatically through events, but for folks who want to manually kick something off through the dashboard, this would be pretty useful.

@AlanGreene AlanGreene added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 11, 2020
@AlanGreene
Copy link
Member

AlanGreene commented Apr 11, 2020

I agree it would be nice to be able to manually create runs using workspaces.

We're currently working on introducing the ability to manually create a TaskRun, similar to the existing functionality for PipelineRuns. As part of this we're likely to revisit some of the PipelineRun pieces.

Some initial thoughts for anyone interested in picking this up...

Adding support for workspaces would require:

  • knowledge of available PVCs, ConfigMaps, changes to how we handle Secrets
    • would it be sufficient to list existing resources of these types without providing the ability to create / edit them?
  • similar logic as we have for resources / params to detect the required workspaces and present them in the create UI
  • possibly more...

Reference:

@davissp14
Copy link
Author

davissp14 commented Apr 11, 2020

It seems a little silly that workspace definitions happen on the PipelineRun/TaskRun resource given how they are used. Basically, you'd have to specify one-to-many workspaces, per run, and hope that the end-user is able to map the bindings correctly when a new run is issued. It's not a very good experience. It also doesn't look like there's a reliable way to determine the workspace specifications/requirements by simply reading the pipeline/task definitions, which makes it even harder.

Seems like there needs to be another level of abstraction that holds the configuration/binding definitions so they can be re-used across runs.

@AlanGreene
Copy link
Member

Depending on your specific use cases, if you're looking for a way to template the creation of runs you may be interested in Tekton Triggers.

Triggers enables users to map fields from an event payload into resource
templates. Put another way, this allows events to both model and instantiate
themselves as Kubernetes resources. In the case of tektoncd/pipeline, this
makes it easy to encapsulate configuration into PipelineRuns and
PipelineResources.

Changes to how Pipelines / Tasks are defined would need to raised against the core Tekton Pipelines and likely raised for discussion at the weekly working group meeting. Since Pipelines and Tasks are intended to be reusable, configuration such as workspaces, service accounts, resources, etc. are considered runtime options. See tektoncd/pipeline#2141 and tektoncd/pipeline#2140 (comment).

@davissp14
Copy link
Author

I actually opened up a related issue shortly after I opened up this one. Thank you!

@davissp14
Copy link
Author

Here's a link to the related issue: tektoncd/pipeline#2372

@tekton-robot
Copy link
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Contributor

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

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.

@tekton-robot tekton-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 14, 2020
@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 14, 2020
@AlanGreene
Copy link
Member

/remove-lifecycle stale
/remove-lifecycle rotten
/reopen

@tekton-robot
Copy link
Contributor

@AlanGreene: Reopened this issue.

In response to this:

/remove-lifecycle stale
/remove-lifecycle rotten
/reopen

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.

@tekton-robot tekton-robot reopened this Aug 14, 2020
@tekton-robot tekton-robot removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Aug 14, 2020
@AlanGreene
Copy link
Member

/assign @ziheng

@tekton-robot
Copy link
Contributor

@AlanGreene: GitHub didn't allow me to assign the following users: ziheng.

Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @ziheng

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.

@AlanGreene
Copy link
Member

Moving the Create TaskRun UI to a full-page experience as we've already done for Create PipelineResource and Create Secret should be happening very soon: #966

Once this is done we'll have more space to work with and may make some further layout changes to the existing Create PipelineRun / TaskRun UI. These would allow us to provide a cleaner and more user friendly experience, especially as we start adding more functionality, e.g. #1722

@AlanGreene AlanGreene changed the title Feature Request - Ability to bind Workspaces Ability to bind Workspaces Mar 6, 2021
@tekton-robot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 4, 2021
@tekton-robot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 4, 2021
@AlanGreene
Copy link
Member

This is still something we want to add, freezing so it doesn't get automatically closed.

/lifecycle frozen

@tekton-robot tekton-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Jul 4, 2021
@morningspace
Copy link

Any update for this issue? Really looking forward to this feature. Without specifying workspace, it looks the manually kicking off PipelineRun or TaskRun feature is not really useful in many cases.

@jasperjonker
Copy link

I am also curious, would be extremely helpful to trigger pipelines from the dashboard

@marniks7
Copy link
Contributor

marniks7 commented Sep 6, 2022

Hi,

  • List of sources to support: PVC, ConfigMap, Secrets, emptyDir, VolumeClaimTemplate, projected (alpha), csi (alpha).
  • Features: subPath for PVC,
    What the use cases for subPath we have? not sure how users should understand what to put there

Basic Solution

PVC, ConfigMap, Secrets, emptyDir only

  • Basic solution is to show dropdown with names of configMaps, Secrets and PVC
    image

  • Also, it is possible to add types before names, like secret: default-token-6q424, configmap: kube-root-ca.crt

  • I am surprised to see router.go as api proxy for kubernetes API(s) allowing to list everything with related clusterrole access. In order to work with secrets, api should expose only required endpoints without providing access to secrets itself. Unfortunately, there is no RBAC access in k8s to read only secret metadata. (list access will allow to read everything). As of now idk how to solve this problem on security level... admins will need to give list access for secrets to tekton-dashboard-backend.

subPath

  • subPath (but should be displayed only for PVC) :
    image

More complex

VolumeClaimTemplate, projected (alpha), csi (alpha) not analyzed

@AlanGreene
Copy link
Member

I am surprised to see router.go as api proxy for kubernetes API(s) allowing to list everything with related clusterrole access. In order to work with secrets, api should expose only required endpoints without providing access to secrets itself.

Yes we would need to either apply a filter to the Secret endpoints to return only the basic metadata, provide a custom endpoint specifically for this purpose (and block the default endpoint), or provide free-text input for the Secret name in the UI instead of providing a dropdown list from which the user would select.

@dgsfor
Copy link

dgsfor commented Oct 12, 2022

Hi,

  • List of sources to support: PVC, ConfigMap, Secrets, emptyDir, VolumeClaimTemplate, projected (alpha), csi (alpha).
  • Features: subPath for PVC,
    What the use cases for subPath we have? not sure how users should understand what to put there

Basic Solution

PVC, ConfigMap, Secrets, emptyDir only

  • Basic solution is to show dropdown with names of configMaps, Secrets and PVC
    image
  • Also, it is possible to add types before names, like secret: default-token-6q424, configmap: kube-root-ca.crt
  • I am surprised to see router.go as api proxy for kubernetes API(s) allowing to list everything with related clusterrole access. In order to work with secrets, api should expose only required endpoints without providing access to secrets itself. Unfortunately, there is no RBAC access in k8s to read only secret metadata. (list access will allow to read everything). As of now idk how to solve this problem on security level... admins will need to give list access for secrets to tekton-dashboard-backend.

subPath

  • subPath (but should be displayed only for PVC) :
    image

More complex

VolumeClaimTemplate, projected (alpha), csi (alpha) not analyzed

In my pipeline, different tasks use different workspaces and serviceaccounts, so hopefully UI will be able to support it as well.
like this:

      apiVersion: tekton.dev/v1beta1
      kind: PipelineRun
      metadata:
        generateName: my-pipelinerun-
        namespace: tekton-run
      spec:
        taskRunSpecs:
          - pipelineTaskName: fetch-ops-git
            taskServiceAccountName: sa-gitlab-clone
          - pipelineTaskName: fetch-app-git
            taskServiceAccountName: sa-gitlab-clone
          - pipelineTaskName: azure-git-action
            taskServiceAccountName: sa-azure-git-action
        pipelineRef:
          name: php-pipeline-pre
        workspaces:
          - name: git-clone-workspace
            persistentVolumeClaim:
              claimName: pvc-tekton
            subPath: pvc-$(uid)
          - name: image-secret-workspace
            secret:
              secretName: swr-image-secret
          - name: azure-git-action-workspace
            emptyDir: {}

@marniks7
Copy link
Contributor

With new YAML mode any user-specific cases are supported now, and we may continue discussion.

@AlanGreene, I agree that secrets should not be allowed to read by dashboard UI for those who are concerned with security and we can support both options:

  1. Provide ability to specify secret name without dropdown (less user friendly, since user will need to know somehow the name, but better for those concerned about security)
  2. In case if access to secrets provided for specific namespace and specific user - show dropdown

@AlanGreene
Copy link
Member

/area roadmap

@tekton-robot tekton-robot added the area/roadmap Issues that are part of the project (or organization) roadmap (usually an epic) label Feb 15, 2023
@dgsfor
Copy link

dgsfor commented Feb 16, 2023

Been looking forward to this feature for a long time

@dgsfor
Copy link

dgsfor commented Feb 20, 2023

Been looking forward to this feature for a long time

YAML mode, no problem for SRE, but compared to ordinary R&D personnel, the threshold is a bit high, they just want to perform simple operations through the dashboard. @AlanGreene

@ileixe
Copy link

ileixe commented Nov 15, 2023

+1 from user perspective. This would be an import issue to use dashboard as frontend workflow while the workspace is the very first primitive for pipeline.

@fpt-dylan-datnt305
Copy link

+1 here. The issue seems to exists for a long time but no possible solution seems to be addressed. Currently running pipeline from UI always encounter error due to lacking of workspace. YAML mode can be an alternative but not user-friendly and require much overhead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/roadmap Issues that are part of the project (or organization) roadmap (usually an epic) kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
Status: Todo
Development

No branches or pull requests

10 participants