1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-22 06:02:51 +00:00

This patch splits build-push-gke-deploy from the gke-deploy directory

Changes include:
  - moves the build-push-gke-deploy task to the task directory
  - moves and modifies readme file from gke-deploy
    to build-push-gke-deploy
  - moves examples directory from gke-deploy

Issue : #386

Signed-off-by: Shiv Verma <shverma@redhat.com>
This commit is contained in:
pratap0007 2020-07-03 15:50:10 +05:30 committed by tekton-robot
parent 4b981548a2
commit 57ebef41f9
9 changed files with 3 additions and 81 deletions

View File

@ -1,81 +1,3 @@
# `gke-deploy` `Task`
This Task deploys an application to a Google Kubernetes Engine cluster using [`gke-deploy`](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gke-deploy).
## Install the Task
```
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/gke-deploy/gke-deploy.yaml
```
## Parameters
* **ARGS**: The arguments to pass to `gke-deploy` CLI.
_default_: `["--help"]`
See [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gke-deploy#usage)
for the arguments to `gke-deploy`.
## Workspaces
* **source**: The Git source repository that contains your application's Kubernetes configs.
## Usage
### Authorizing `gke-deploy` commands
See [Authorizing `gcloud`
commands](../gcloud/README.md#authorizing-gcloud-commands) for authorizing the
`gke-deploy` Task using a Google IAM Service Account (the instructions describe
authorizing `gcloud`, but the steps are the same).
In order for the `gke-deploy` Task to deploy to a GKE cluster in your project,
the service account that the Task runs as must have the
[`roles/container.developer`](https://cloud.google.com/iam/docs/understanding-roles#kubernetes-engine-roles) role, which can be achieved with the command below:
```bash
gcloud iam service-accounts [CLUSTER_PROJECT] add-iam-policy-binding \
--role roles/container.developer\
--member "serviceAccount:[SERVICE_ACCOUNT_EMAIL]"
```
### Running the Task
You can invoke `gke-deploy` to deploy manifests in a Git repository by
providing a TaskRun:
```yaml
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: gke-deploy-repo
spec:
serviceAccountName: workload-identity-sa # <-- a SA configured with Workload Identity
taskRef:
name: gke-deploy
workspaces:
- name: source
persistentVolumeClaim:
claimName: my-source
params:
- name: ARGS
value:
- run
- --filename="$(inputs.resources.source-repo.path)/[PATH_TO_KUBERNETES_CONFIGS]"
- --cluster=[CLUSTER_NAME]
- --location=[CLUSTER_LOCATION]
- --project=[CLUSTER_PROJECT]
```
See
[here](https://github.com/tektoncd/pipeline/blob/master/docs/resources.md#git-resource)
for more on how to use the Git Resource.
See
[here](https://github.com/tektoncd/pipeline/blob/master/docs/auth.md#ssh-authentication-git)
to learn how to access private Git repositories using Tekton.
# `build-push-gke-deploy` `Pipeline`
@ -84,7 +6,7 @@ This Pipeline builds, pushes, and deploys your application to a Google Kubernete
## Install the Pipeline
```
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/gke-deploy/build-push-gke-deploy.yaml
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/build-push-gke-deploy/0.1/build-push-gke-deploy.yaml
```
## Workspaces
@ -187,4 +109,4 @@ See
to learn how to access private Git repositories in Tekton.
See
[here](build-push-gke-deploy-example.md) for a full example of using this Pipeline.
[here](build-push-gke-deploy-example.md) for a full example of using this Pipeline.

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -72,4 +72,4 @@ spec:
value: pending
- name: TARGET_URL
value: https://tekon/dashboard/taskrun/log
```
```