Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/GoogleCloudPlatform/cloud-builders/gke-deploy

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/GoogleCloudPlatform/cloud-builders/gke-deploy

  • v0.0.0-20241020122610-88de3665c77e
  • Source
  • Go
  • Socket score

Version published
Created
Source

GKE Deploy

This tool deploys an application to a Kubernetes Engine cluster, following Google's recommended best practices.

gke-deploy vs kubectl

Using gke-deploy to deploy an application to Kubernetes Engine differs from kubectl in that gke-deploy is a wrapper around a kubectl apply deployment that follows Google's recommended best practices by...

  • Modifying a set of Kubernetes configuration files to use a container image's digest instead of a tag

  • Adding several recommended labels to the set of Kubernetes configuration files

  • Getting authorized to access a GKE cluster

  • Applying the set of Kubernetes configuration files that were modified in the prepare step, using kubectl apply

  • Waiting for applied Kubernetes configuration to be ready

Usage

gke-deploy run [flags]

This command executes all of the best practices mentioned above, in sequence.

gke-deploy prepare [flags]

This command executes the steps to modify and add labels to a set of Kubernetes configuration files, and skips the steps to get authorized to access a GKE cluster, apply configuration, and wait.

gke-deploy apply [flags]

This command skips the steps to modify and add labels to a set of Kubernetes configuration files, and executes the steps to get authorized to access a GKE cluster, apply configuration, and wait.

Deploying with Cloud Build

View this page for examples on how to use gke-deploy with Cloud Build.

Automated Deployments with Cloud Build

Follow these instructions to set up continuous deployment.

Application CR

You can deploy an Application Custom Resource for your application:

  1. Follow the instructions here to create or update a GKE cluster to install Application Delivery, which supports the Application CRD.

    You can also install the CRD manually by following the instructions here.

  2. Use the --create-application-cr flag with gke-deploy prepare or gke-deploy apply to create an Application CR for your application.

Testing Locally

Although gke-deploy is meant to be used as a build step with Cloud Build, you can run it locally for testing.

  1. First, install kubectl as a dependency.

  2. Next, install gke-deploy:

    go install github.com/GoogleCloudPlatform/cloud-builders/gke-deploy@latest
    gke-deploy -h
    
  3. If your kubectl is pointing to a cluster, you can test out a deployment by deploying an application with one simple command:

    # Deploy an nginx Deployment with a load balancer exposing port 80.
    gke-deploy run -i nginx -x 80
    
  4. After the command finishes successfully, gke-deploy will print a table displaying deployed resources. You can visit the IP address printed in the Service row.

    e.g.,

    deployed-resources

    curl 35.196.67.253
    

FAQs

Package last updated on 20 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc