1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00
catalog/task/gke-deploy/0.1
Quan Zhang e294e1246b [TEP-0110] Update Tekton Catalog installation instructions
Prior to this change, the installation instructions directly use the resource urls in the Catalog repo, which results in tight coupling between the organization and how users fetch resources (as described in TEP-0110). This commit updates the installation guide to install Tekton Catalog resources via Tekton Hub Api: https://github.com/tektoncd/hub/pull/539

This change decouples the Tekton Catalog organization from resouces resolution, which enables Tekton Catalog reorganization.
2022-08-16 16:25:52 +01:00
..
samples [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00
gke-deploy.yaml Add linux/amd64 platform annotation to the rest of the tasks 2021-10-29 17:08:38 +01:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

gke-deploy Task

This Task deploys an application to a Google Kubernetes Engine cluster using gke-deploy.

Install the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/gke-deploy/0.1/raw

Parameters

  • ARGS: The arguments to pass to gke-deploy CLI.

    default: ["--help"]

    See here for the arguments to gke-deploy.

Workspaces

  • source: The Git source repository that contains your application's Kubernetes configs.

Platforms

The Task can be run on linux/amd64 platform.

Usage

Authorizing gke-deploy commands

See 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 role, which can be achieved with the command below:

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:

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 for more on how to use the Git Resource.

See here to learn how to access private Git repositories using Tekton.