package gke
import "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.
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 ¶
- func NewClient(ctx context.Context, clusterName string, location string, opts ...ClientOpt) (*kubernetes.Client, error)
- type ClientOpt
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 ¶
OptNamespace sets the Kubernetes namespace to look in.
func OptProject ¶
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).
Source Files ¶
gke.go
- Version
- v0.0.0-20250421191922-3619c213cff3 (latest)
- Published
- Apr 21, 2025
- Platform
- js/wasm
- Imports
- 12 packages
- Last checked
- 1 second ago –
Tools for package owners.