-
Notifications
You must be signed in to change notification settings - Fork 596
Update helm upgrade from repo to 0.4 #1318
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
Open
vampire-yuta
wants to merge
12
commits into
tektoncd:main
Choose a base branch
from
vampire-yuta:update-helm-upgrade-from-repo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8447023
Copy task helm-upgrade-from-repo from 0.3 to 0.4
vampire-yuta c50b0c9
add args --create-namespace
vampire-yuta b4b5f94
update README
vampire-yuta 8a9f53b
update app.kubernetes.io/version:
vampire-yuta 723ce2e
fix args feature to upgrade_extra_params
vampire-yuta a5279f0
update README
vampire-yuta c5e4105
update tests upgrade_extra_params
vampire-yuta 6060e6f
Update task/helm-upgrade-from-repo/0.4/helm-upgrade-from-repo.yaml
vampire-yuta 86f9d2c
Update task/helm-upgrade-from-repo/0.4/tests/run.yaml
vampire-yuta cf66868
Update task/helm-upgrade-from-repo/0.4/tests/run.yaml
vampire-yuta a33a6d7
update tekton.dev/pipelines.minVersion to 1.4.0
vampire-yuta 203d90a
update README Install the Task section
vampire-yuta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Helm | ||
|
|
||
| These tasks will install / upgrade a helm chart into your Kubernetes / OpenShift Cluster using [Helm](https://github.com/helm/helm). | ||
|
|
||
| ## Install the Task | ||
|
|
||
| Install `helm-upgrade-from-repo` task: | ||
|
|
||
| ``` | ||
| kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/helm-upgrade-from-repo/0.4/raw | ||
| ``` | ||
|
|
||
| #### Workspaces | ||
|
|
||
| * **source**: A [Workspace](https://github.com/tektoncd/pipeline/blob/main/docs/workspaces.md) volume containing the helm chart. | ||
|
|
||
| ### helm install / upgrade from repo | ||
|
|
||
| ``` | ||
| kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/helm-upgrade-from-repo/0.4/raw | ||
| ``` | ||
|
|
||
| #### Parameters | ||
|
|
||
| - **chart_name**: The directory in the source repository where the installable chart should be found. | ||
| - **release_version**: The version of the release (*default: v1.0.0*) | ||
| - **release_name**: The name of the release (*default: helm-release*) | ||
| - **release_namespace**: The namespace in which the release is to be installed (*default: ""*) | ||
| - **overwrite_values**: The values to be overwritten (*default: ""*) | ||
| - **helm_image**: The helm image which should be used (default: lachlanevenson/k8s-helm:v3.5.0) | ||
| - **upgrade_extra_params**: Extra parameters passed for the helm upgrade command (*default: ""*) | ||
|
|
||
| #### Platforms | ||
|
|
||
| The Task can be run on `linux/amd64`, `linux/s390x`, `linux/arm64` and `linux/ppc64le` platforms. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### PipelineRun | ||
|
|
||
| An example `Pipeline` with a `PipelineRun` can be found in the subdirectory `tests`. | ||
|
|
||
| ### TaskRun | ||
|
|
||
| This `TaskRun` runs the task to retrieve a Git repo and then installs/updates the helm chart that is in the Git repo. | ||
|
|
||
| ```yaml | ||
| # example upgrade from repo | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: TaskRun | ||
| metadata: | ||
| name: example-helm-upgrade-from-repo | ||
| spec: | ||
| taskRef: | ||
| name: helm-upgrade-from-repo | ||
| params: | ||
| - name: helm_repo | ||
| value: https://kubernetes-charts.storage.googleapis.com | ||
| - name: chart_name | ||
| value: stable/envoy | ||
| - name: release_version | ||
| value: v1.0.0 | ||
| - name: release_name | ||
| value: helm-repo-sample | ||
| - name: overwrite_values | ||
| value: autoscaling.enabled=true,autoscaling.maxReplicas=3 | ||
| ``` | ||
54 changes: 54 additions & 0 deletions
54
task/helm-upgrade-from-repo/0.4/helm-upgrade-from-repo.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # This Task will do a helm upgrade based on the given helm repo and chart | ||
| apiVersion: tekton.dev/v1 | ||
| kind: Task | ||
| metadata: | ||
| name: helm-upgrade-from-repo | ||
| labels: | ||
| app.kubernetes.io/version: "0.4" | ||
| annotations: | ||
| tekton.dev/categories: Deployment | ||
| tekton.dev/pipelines.minVersion: "1.4.0" | ||
| tekton.dev/tags: helm | ||
| tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" | ||
| spec: | ||
| description: >- | ||
| These tasks will install / upgrade a helm chart into your Kubernetes / | ||
| OpenShift Cluster using Helm | ||
|
|
||
| params: | ||
| - name: helm_repo | ||
| description: "Specify a specific helm repo" | ||
| - name: chart_name | ||
| description: "Specify chart name that will be deployed" | ||
| - name: release_version | ||
| description: The helm release version in semantic versioning format | ||
| default: "v1.0.0" | ||
| - name: release_name | ||
| description: The helm release name | ||
| default: "helm-release" | ||
| - name: release_namespace | ||
| description: The helm release namespace | ||
| default: "" | ||
| - name: overwrite_values | ||
| description: "Specify the values you want to overwrite, comma separated: autoscaling.enabled=true,replicas=1" | ||
| default: "" | ||
| - name: helm_image | ||
| description: "Specify a specific helm image" | ||
| default: "docker.io/lachlanevenson/k8s-helm@sha256:0a068ae407e21d1836c6a89a1e9e81af1e55fa56890998e33d5caabdbb51e77b" # tag: v3.10.2 | ||
| - name: upgrade_extra_params | ||
| description: "Extra parameters passed for the helm upgrade command" | ||
| default: "" | ||
| steps: | ||
| - name: upgrade-from-repo | ||
| image: $(params.helm_image) | ||
| script: | | ||
| echo current installed helm releases | ||
| helm list --namespace "$(params.release_namespace)" | ||
| echo parsing helms repo name... | ||
| REPO=`echo "$(params.chart_name)" | cut -d "/" -f 1` | ||
| echo adding helm repo... | ||
| helm repo add $REPO "$(params.helm_repo)" | ||
| echo adding updating repo... | ||
| helm repo update | ||
| echo installing helm chart... | ||
| helm upgrade --wait --install --namespace "$(params.release_namespace)" $(params.release_name) $(params.chart_name) --debug --set "$(params.overwrite_values)" $(params.upgrade_extra_params) |
18 changes: 18 additions & 0 deletions
18
task/helm-upgrade-from-repo/0.4/samples/helm-upgrade-from-repo-task-run.yaml.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: TaskRun | ||
| metadata: | ||
| name: example-helm-upgrade-from-repo | ||
| spec: | ||
| taskRef: | ||
| name: helm-upgrade-from-repo | ||
| params: | ||
| - name: helm_repo | ||
| value: https://charts.helm.sh/stable | ||
| - name: chart_name | ||
| value: stable/envoy | ||
| - name: release_version | ||
| value: v1.0.0 | ||
| - name: release_name | ||
| value: helm-repo-sample | ||
| - name: overwrite_values | ||
| value: autoscaling.enabled=true,autoscaling.maxReplicas=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Add service account | ||
| kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa | ||
|
|
||
| # Add edit role to service account | ||
| kubectl -n ${tns} create rolebinding helm-pipeline-run-sa-edit --clusterrole edit --serviceaccount ${tns}:helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| apiVersion: tekton.dev/v1 | ||
| kind: Pipeline | ||
| metadata: | ||
| name: helm-upgrade-test-pipeline | ||
| spec: | ||
| tasks: | ||
| - name: helm-upgrade-from-repo | ||
| taskRef: | ||
| name: helm-upgrade-from-repo | ||
| params: | ||
| - name: helm_repo | ||
| value: https://dunefro.github.io/sample-charts/ | ||
| - name: chart_name | ||
| value: sample-charts/sample-nginx | ||
| - name: release_version | ||
| value: v1.0.0 | ||
| - name: release_name | ||
| value: helm-repo-sample | ||
| - name: overwrite_values | ||
| value: autoscaling.enabled=false,autoscaling.maxReplicas=3 | ||
| - name: upgrade_extra_params | ||
| value: "--force" | ||
| --- | ||
| apiVersion: tekton.dev/v1 | ||
| kind: PipelineRun | ||
| metadata: | ||
| name: helm-upgrade-test-pipeline-run | ||
| spec: | ||
| serviceAccountName: helm-pipeline-run-sa | ||
| pipelineRef: | ||
| name: helm-upgrade-test-pipeline |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 we please update this section or remove as I can see that there is another section which talks about the same thing?
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.
this section is updated.
The following has been added for reference. because this README is recentry added.
https://github.com/tektoncd/catalog/blob/main/task/42crunch-api-security-audit/0.3/README.md?plain=1
catalog/task/helm-upgrade-from-repo/0.4/README.md
Lines 5 to 11 in 203d90a