gke

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterKey is the name of the cluster field.
	ClusterKey = "cluster"
	// ProjectKey is the name of the project field.
	ProjectKey = "project"
	// LocationKey is the name of the location field.
	LocationKey = "location"
	// UseInternalIPKey indicates if connecting API server via private endpoint
	UseInternalIPKey = "use_internal_ip"
)

Variables

View Source
var (

	// RequiredFields is the list of required fields to initialize a GKE target.
	RequiredFields = []string{ClusterKey, ProjectKey, LocationKey}
)

Functions

func BuildKubeRestConfDefaultCred

func BuildKubeRestConfDefaultCred(
	ctx context.Context,
	clusterName, location, project, useInternalIP, userAgent string,
) (*rest.Config, error)

BuildKubeRestConfDefaultCred creates a k8s rest.Config using the google application default credential.

func BuildKubeRestConfSACred

func BuildKubeRestConfSACred(
	ctx context.Context,
	clusterName, location, project, useInternalIP, svcAcctKeyFile, userAgent string,
) (*rest.Config, error)

BuildKubeRestConfSACred creates a k8s rest.Config using service account JSON key file. If such key is empty, fall back to using default application cred.

func GoogleCredTokenSourceFromSAKey

func GoogleCredTokenSourceFromSAKey(ctx context.Context, svcAcctKeyFile string) (oauth2.TokenSource, error)

GoogleCredTokenSourceFromSAKey creates a oauth2 token source from google service account key json.

func NewGKEBuiltin

func NewGKEBuiltin(svcAcctKeyFile, userAgent string) *starlark.Builtin

NewGKEBuiltin creates a new GKE built-in.

Types

type GKE

type GKE struct {
	*cloud.AbstractKubeVendor
	// contains filtered or unexported fields
}

GKE represents a GKE cluster. It includes critical information such as the cluster name, location, and project id, as well as other optional info.

func (*GKE) KubeConfig

func (g *GKE) KubeConfig(ctx context.Context) (*rest.Config, error)

KubeConfig is part of the cloud.KubernetesVendor interface.

Jump to

Keyboard shortcuts

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