-
Notifications
You must be signed in to change notification settings - Fork 112
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
Migrate our Tekton CD folder away from PipelineResources #887
Comments
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/lifecycle frozen This is something that need to do in light of the deprecation of pipeline resources |
/lifecycle frozen |
Current cluster resources in use:
An alternative approach could be to generate a kubeconfig for each of these resources and store it in a secret on the cluster. If any of the clusters or service accounts is recreated, the secrets will have to be refreshed, which is true today as well. |
Tekton resources to convert: apiVersion: v1
kind: ServiceAccount
metadata:
name: resource-converter
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: secret-creator
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch", "create", "patch", "update"]
- apiGroups: ["tekton.dev"]
resources: ["PipelineResources"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: resource-converter-secret-creator
subjects:
- kind: ServiceAccount
name: resource-converter
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: secret-creator
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: resource-to-secret
spec:
params:
- name: targetSecret
resources:
inputs:
- name: sourceResource
type: cluster
stepTemplate:
env:
- name: TARGET_SECRET
value: $(params.targetSecret)
- name: KUBECONFIG_PATH
value: /workspace/$(resources.inputs.sourceResource.name)
steps:
- name: create-secret
image: gcr.io/tekton-releases/dogfooding/kubectl
script: |
#!/bin/sh
set -ex
kubectl create secret generic "${TARGET_SECRET}" \
--from-file="${KUBECONFIG_PATH}/kubeconfig" \
--type=kubeconfig
kubectl label "secret/${TARGET_SECRET}" app=tekton.cd |
Script to convert all resources: #!/bin/sh
tkn resource list -t cluster | awk '/cluster/{ print $1 }' | while read aa; do
tkn task start resource-to-secret -s resource-converter -i sourceResource=${aa} -p targetSecret=tektoncd-${aa};
done Resulting secrets:
|
Folder template relies on the cluster PipelineResource to target deployments of resources and git PipelineResource to clone the git repository. Migrate that to workspaces: - the git-clone task from the catalog is used to clone the repo - a secret stored in the cluster bound through a workspace is used to target the deployment Secrets have been preprovisioned on the cluster, their name is tektoncd-<pipeline-resource-name>, their type is kubeconfig. See tektoncd#887 for more details. Signed-off-by: Andrea Frittoli <[email protected]>
Folder template relies on the cluster PipelineResource to target deployments of resources and git PipelineResource to clone the git repository. Migrate that to workspaces: - the git-clone task from the catalog is used to clone the repo - a secret stored in the cluster bound through a workspace is used to target the deployment Secrets have been preprovisioned on the cluster, their name is tektoncd-<pipeline-resource-name>, their type is kubeconfig. See tektoncd#887 for more details. The interface of the trigger template is untouched, so existing cronjobs will continue to work as they are. Signed-off-by: Andrea Frittoli <[email protected]>
Folder template relies on the cluster PipelineResource to target deployments of resources and git PipelineResource to clone the git repository. Migrate that to workspaces: - the git-clone task from the catalog is used to clone the repo - a secret stored in the cluster bound through a workspace is used to target the deployment Secrets have been preprovisioned on the cluster, their name is tektoncd-<pipeline-resource-name>, their type is kubeconfig. See #887 for more details. The interface of the trigger template is untouched, so existing cronjobs will continue to work as they are. Signed-off-by: Andrea Frittoli <[email protected]>
Namespace cleanup template relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Configmap CD relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Configmap CD relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Configmap CD relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Configmap CD relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Namespace cleanup template relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See #887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Configmap CD relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Configmap CD relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See #887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Helm chart deployment relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Helm chart deployment relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Install Tekton release relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid as well as the deployment script. Signed-off-by: Andrea Frittoli <[email protected]>
Helm chart deployment relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See #887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid. Signed-off-by: Andrea Frittoli <[email protected]>
Install Tekton release relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid as well as the deployment script. Signed-off-by: Andrea Frittoli <[email protected]>
Install Tekton release relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid as well as the deployment script. Signed-off-by: Andrea Frittoli <[email protected]>
Install Tekton release relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid as well as the deployment script. Signed-off-by: Andrea Frittoli <[email protected]>
Install Tekton release relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid as well as the deployment script. Signed-off-by: Andrea Frittoli <[email protected]>
Install Tekton release relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See tektoncd#887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid as well as the deployment script. Signed-off-by: Andrea Frittoli <[email protected]>
Install Tekton release relies on the cluster PipelineResource to target deployments of resources. Migrate that to workspaces: a secret stored in the cluster bound through a workspace is used to target the deployment. Secrets have been preprovisioned on the cluster, their name is tektoncd-, their type is kubeconfig. See #887 for more details. The change is implemented so that the template interface does not change and thus all existing cronjobs are still valid as well as the deployment script. Signed-off-by: Andrea Frittoli <[email protected]>
Feature request
The Tasks and Pipelines we currently have in our
cd
directory utilize Cluster PipelineResources because they provide a way to include cluster secrets that won't expose them in logs.This issue is to capture work to move away from PipelineResources in the resources from that directory. The current best alternative to the Cluster PipelineResource might be https://github.com/tektoncd/catalog/blob/main/task/kubeconfig-creator/0.1/kubeconfig-creator.yaml although that currently accepts credentials via param which is definitely not a secure approach.
The text was updated successfully, but these errors were encountered: