Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/google-github-actions/deploy-gke
A GitHub Action to deploy workloads to Google Kubernetes Engine.
https://github.com/google-github-actions/deploy-gke
actions deployment gcp github-actions gke google-cloud google-cloud-platform google-kubernetes-engine kubernetes
Last synced: 7 days ago
JSON representation
A GitHub Action to deploy workloads to Google Kubernetes Engine.
- Host: GitHub
- URL: https://github.com/google-github-actions/deploy-gke
- Owner: google-github-actions
- License: apache-2.0
- Created: 2024-03-12T14:07:54.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-07T01:24:44.000Z (6 months ago)
- Last Synced: 2024-05-07T16:38:02.510Z (6 months ago)
- Topics: actions, deployment, gcp, github-actions, gke, google-cloud, google-cloud-platform, google-kubernetes-engine, kubernetes
- Language: Shell
- Homepage: https://cloud.google.com/kubernetes-engine
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# deploy-gke
This action deploys an existing image to a [GKE cluster](https://cloud.google.com/kubernetes-engine). This container action leverages the [gke-deploy CLI](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gke-deploy) tool image which is a wrapper around `kubectl apply` for deploying images to GKE.
**This is not an officially supported Google product, and it is not covered by a Google Cloud support contract. To report bugs or request features in a Google Cloud product, please contact Google Cloud support.**
# Prerequisites
This action requires:
- Google Cloud credentials that are authorized to view a GKE cluster. You also need to create a [GKE cluster](https://cloud.google.com/kubernetes-engine/docs/deploy-app-cluster).
- Use [google-github-actions/auth](https://github.com/google-github-actions/auth) to authenticate the action. We recommend using [Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation) by specifying the credentials input.- This action runs in a Docker container. It does not support the Windows platform. (See [runner #904](https://github.com/actions/runner/issues/904) for more details).
## Usage
```yaml
jobs:
job_id:
permissions:
contents: 'read'
id-token: 'write'steps:
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'- name: 'deploy with gke-deploy cli'
uses: 'google-github-actions/[email protected]'
with:
image: 'my-image'
app_name: 'my-app'
region: 'us-central1'
cluster_name: 'my-cluster'
project_id: 'my-project'
namespace: 'my-namespace'
expose: '8000'
- name: 'get-deployments'
shell: bash
run: |
kubectl get pods -n my-namespace
kubectl get deployment -n my-namespace
```## Inputs
- `image` - (Required) Image to be deployed.- `app_name` - (Required) Application name of the Kubernetes deployment.
- `region` - (Required) Location (e.g. region or zone) in which the cluster
resides. This value is required unless for the region/zone of GKE cluster
to deploy to.- `cluster_name` - (Required) Name of GKE cluster to deploy to.
- `project_id` - (Required) Project ID where the cluster is deployed.
- `namespace` - (Optional) Namespace of GKE cluster to deploy to.
If not provided, it will not be passed to the binary.- `expose` - (Optional) The port provided will be used to expose the deployed
workload object (i.e., port and targetPort will be set to the value provided
in this flag). If not provided, it will not be passed to the binary.