gke

package
v1.3.616 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const KmsLocation = "global"

Variables

View Source
var PROJECT_LIST_HEADER = "PROJECT_ID"
View Source
var (
	REQUIRED_SERVICE_ACCOUNT_ROLES = []string{"roles/compute.instanceAdmin.v1",
		"roles/iam.serviceAccountActor",
		"roles/container.clusterAdmin",
		"roles/container.admin",
		"roles/container.developer",
		"roles/storage.objectAdmin",
		"roles/editor"}
)

Functions

func BucketExists

func BucketExists(projectId string, bucketName string) (bool, error)

func CheckPermission

func CheckPermission(perm string, projectId string) (bool, error)

func ClusterName

func ClusterName(kuber kube.Kuber) (string, error)

ClusterName gets the cluster name from the current context Note that this just reads the ClusterName from the local kube config, which can be renamed (but is unlikely to happen)

func CreateBucket

func CreateBucket(projectId string, bucketName string, location string) error

func CreateKmsKey

func CreateKmsKey(keyName string, keyringName string, projectId string) error

CreateKmsKey creates a new KMS key in the given keyring

func CreateKmsKeyring

func CreateKmsKeyring(keyringName string, projectId string) error

CreateKmsKeyring creates a new KMS keyring

func DeleteAllObjectsInBucket

func DeleteAllObjectsInBucket(bucketName string) error

func DeleteBucket

func DeleteBucket(bucketName string) error

func DeleteServiceAccount

func DeleteServiceAccount(serviceAccount string, projectId string, roles []string) error

func EnableApis added in v1.3.40

func EnableApis(projectId string, apis ...string) error

func FindBucket

func FindBucket(bucketName string) bool

func FindServiceAccount

func FindServiceAccount(serviceAccount string, projectId string) bool

func GetEnabledApis

func GetEnabledApis(projectId string) ([]string, error)

func GetGoogleMachineTypes

func GetGoogleMachineTypes() []string

func GetGoogleProjects

func GetGoogleProjects() ([]string, error)

func GetGoogleZones

func GetGoogleZones(project string) ([]string, error)

func GetOrCreateServiceAccount

func GetOrCreateServiceAccount(serviceAccount string, projectId string, clusterConfigDir string, roles []string) (string, error)

func GetRegionFromZone

func GetRegionFromZone(zone string) string

func GetSimplifiedClusterName

func GetSimplifiedClusterName(complexClusterName string) string

GetSimplifiedClusterName get the simplified cluster name from the long-winded context cluster name that gets generated GKE cluster names as defined in the kube config are of the form gke_<projectname>_<region>_<clustername> This method will return <clustername> in the above

func IsKmsKeyAvailable

func IsKmsKeyAvailable(keyName string, keyringName string, projectId string) bool

IsKmsKeyAvailable cheks if the KMS key is already available

func IsKmsKeyringAvailable

func IsKmsKeyringAvailable(keyringName string, projectId string) bool

IsKmsKeyringAvailable checks if the KMS keyring is already available

func Login

func Login(serviceAccountKeyPath string, skipLogin bool) error

func ShortClusterName

func ShortClusterName(kuber kube.Kuber) (string, error)

ShortClusterName returns a short clusters name. Eg, if ClusterName would return tweetypie-jenkinsx-dev, ShortClusterName would return tweetypie. This is needed because GCP has character limits on things like service accounts (6-30 chars) and combining a long cluster name and a long vault name exceeds this limit

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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