Documentation ¶
Index ¶
- Constants
- Variables
- func BuildKubeRestConfDefaultCred(ctx context.Context, ...) (*rest.Config, error)
- func BuildKubeRestConfSACred(ctx context.Context, ...) (*rest.Config, error)
- func GoogleCredTokenSourceFromSAKey(ctx context.Context, svcAcctKeyFile string) (oauth2.TokenSource, error)
- func NewGKEBuiltin(svcAcctKeyFile, userAgent string) *starlark.Builtin
- type GKE
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.