forked from tektoncd/catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch splits helm-upgrade-from-source task from the helm directory
Changes include: - moves helm-upgrade-from-source task to the task directory - copies and modifies readme file for helm-upgrade-from-source from helm directory - copies OWNERS,examples and tests directory from helm directory Issue: tektoncd#386 Signed-off-by: Puneet Punamiya <[email protected]>
- Loading branch information
1 parent
d3f1d4b
commit 3ad8a2c
Showing
8 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
approvers: | ||
- fhopfensperger | ||
|
||
reviewers: | ||
- fhopfensperger |
This file contains 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,58 @@ | ||
# Helm | ||
|
||
These tasks will install / upgrade a helm chart into your Kubernetes / OpenShift Cluster using [Helm](https://github.com/helm/helm). | ||
|
||
## Install the Task | ||
|
||
### helm install / upgrade from source code | ||
|
||
``` | ||
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/helm-upgrade-from-source/0.1/helm-upgrade-from-source.yaml | ||
``` | ||
|
||
#### Parameters | ||
|
||
- **charts_dir**: 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_version**: The helm version which should be used (*default: latest*) | ||
|
||
#### Workspaces | ||
|
||
* **source**: A [Workspace](https://github.com/tektoncd/pipeline/blob/master/docs/workspaces.md) volume containing the helm chart. | ||
|
||
## 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 source | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
name: example-helm-upgrade-from-source | ||
spec: | ||
taskRef: | ||
name: helm-upgrade-from-source | ||
params: | ||
- name: charts_dir | ||
value: helm-sample-chart | ||
- name: releases_version | ||
value: v1.0.0 | ||
- name: release_name | ||
value: helm-source-sample | ||
- name: overwrite_values | ||
value: "autoscaling.enabled=true,autoscaling.maxReplicas=3" | ||
workspaces: | ||
- name: source | ||
persistentVolumeClaim: | ||
claimName: my-source | ||
``` |
18 changes: 18 additions & 0 deletions
18
task/helm-upgrade-from-source/0.1/example/helm-upgrade-from-repo-task-run.yaml.tmpl
This file contains 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://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 |
20 changes: 20 additions & 0 deletions
20
task/helm-upgrade-from-source/0.1/example/helm-upgrade-from-source-task-run.yaml.tmpl
This file contains 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,20 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
name: example-helm-upgrade-from-source | ||
spec: | ||
taskRef: | ||
name: helm-upgrade-from-source | ||
params: | ||
- name: charts_dir | ||
value: helm-sample-chart | ||
- name: releases_version | ||
value: v1.0.0 | ||
- name: release_name | ||
value: helm-source-sample | ||
- name: overwrite_values | ||
value: "autoscaling.enabled=true,autoscaling.maxReplicas=3" | ||
workspaces: | ||
- name: source | ||
persistentVolumeClaim: | ||
claimName: my-source |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
task/helm-upgrade-from-source/0.1/tests/pre-apply-task-hook.sh
This file contains 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,10 @@ | ||
#!/bin/bash | ||
|
||
# Add git-clone | ||
kubectl -n ${tns} apply -f ./git/git-clone.yaml | ||
|
||
# Add service account | ||
kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f - | ||
|
||
# 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 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,11 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: helm-source-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 200Mi |
This file contains 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,66 @@ | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: helm-upgrade-test-pipeline | ||
spec: | ||
workspaces: | ||
- name: shared-workspace | ||
tasks: | ||
- name: helm-upgrade-from-repo | ||
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 | ||
- name: fetch-repository | ||
taskRef: | ||
name: git-clone | ||
workspaces: | ||
- name: output | ||
workspace: shared-workspace | ||
params: | ||
- name: url | ||
value: https://github.com/fhopfensperger/tekton-helm-sample.git | ||
- name: subdirectory | ||
value: "" | ||
- name: deleteExisting | ||
value: "true" | ||
- name: helm-upgrade-from-source | ||
taskRef: | ||
name: helm-upgrade-from-source | ||
runAfter: | ||
- fetch-repository | ||
workspaces: | ||
- name: source | ||
workspace: shared-workspace | ||
params: | ||
- name: charts_dir | ||
value: helm-sample-chart | ||
- name: release_version | ||
value: v1.0.0 | ||
- name: release_name | ||
value: helm-source-sample | ||
- name: overwrite_values | ||
value: "autoscaling.enabled=true,autoscaling.maxReplicas=3" | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
name: helm-upgrade-test-pipeline-run | ||
spec: | ||
serviceAccountName: helm-pipeline-run-sa | ||
pipelineRef: | ||
name: helm-upgrade-test-pipeline | ||
workspaces: | ||
- name: shared-workspace | ||
persistentvolumeclaim: | ||
claimName: helm-source-pvc |