gke

package
v0.0.0-...-80a9e2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: BSD-3-Clause Imports: 12 Imported by: 24

README

Go Reference

golang.org/x/build/kubernetes/gke

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

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

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

NewClient returns an Kubernetes client to a GKE cluster.

Types

type ClientOpt

type ClientOpt interface {
	// contains filtered or unexported methods
}

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

func OptNamespace

func OptNamespace(namespace string) ClientOpt

OptNamespace sets the Kubernetes namespace to look in.

func OptProject

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 instance.

func OptTokenSource

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 (https://godoc.org/golang.org/x/oauth2/google#DefaultTokenSource).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL