Back to / pkg / kube / cluster

package cluster

Latest Go to latest
Published: Apr 15, 2019 | License: Apache-2.0 | Module:


func Context

func Context(kuber kube.Kuber) (*api.Context, error)

Context returns the current kube context

func Name

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

Name 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 ShortClusterName

func ShortClusterName(clusterName string) string

ShortClusterName shrinks the cluster name

func ShortName

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

ShortName 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

func ShortNameN

func ShortNameN(clusterName string, maxLen int) string

ShortNameN shrinks the name to a max length

func SimplifiedClusterName

func SimplifiedClusterName(complexClusterName string) string

SimplifiedClusterName 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

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier