build: Index | Files

package gke

import ""

Package gke contains code for interacting with Google Container Engine (GKE), the hosted version of Kubernetes on Google Cloud Platform.

The API is not subject to the Go 1 compatibility promise and may change at any time. Users should vendor this package and deal with API changes.


Package Files


func NewClient Uses

func NewClient(ctx context.Context, clusterName string, opts ...ClientOpt) (*kubernetes.Client, error)

NewClient returns an Kubernetes client to a GKE cluster.

type ClientOpt Uses

type ClientOpt interface {
    // contains filtered or unexported methods

ClientOpt represents an option that can be passed to the Client function.

func OptProject Uses

func OptProject(projectName string) ClientOpt

OptProject returns an option setting the GCE Project ID to projectName. This is the named project ID, not the numeric ID. If unspecified, the current active project ID is used, if the program is running on a GCE intance.

func OptTokenSource Uses

func OptTokenSource(ts oauth2.TokenSource) ClientOpt

OptTokenSource sets the oauth2 token source for making authenticated requests to the GKE API. If unset, the default token source is used (

func OptZone Uses

func OptZone(zoneName string) ClientOpt

OptZone specifies the GCP zone the cluster is located in. This is necessary if and only if there are multiple GKE clusters with the same name in different zones.

Package gke imports 12 packages (graph) and is imported by 4 packages. Updated 2021-01-22. Refresh now. Tools for package owners.