cluster

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DefaultClusterName is the cluster for the unspecified cluster
	DefaultClusterName = "_default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Name is the cluster name, usually the Cluster resource's name
	Name string
	// Endpoint the apiserver's endpoint of the cluster
	Endpoint string
	// Token is a admin token , it should have all the access to the cluster
	Token string

	// Namespace the namespace which the chart will be installed to
	Namespace string
}

Info represents a Cluster,

func RestConfigToCluster

func RestConfigToCluster(config *rest.Config, generatedName string) *Info

RestConfigToCluster generate a cluster Info from a rest config This method and the Info.ToRestConfig both only support bearer token for now luckily, the in-cluster rest config also use bearer token

func (*Info) GetContext

func (i *Info) GetContext() string

GetContext is the context name for this cluster, this name format is generated from k8s code

func (*Info) ToRestConfig

func (i *Info) ToRestConfig() *rest.Config

ToRestConfig generate rest.Config from cluster info.

Jump to

Keyboard shortcuts

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