Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFromToken ¶
func CreateFromToken(serverURL, clusterName, userName string, caCert, token []byte) *clientcmdapi.Config
Types ¶
type Kubeconfig ¶
type Kubeconfig struct { Config *clientcmdapi.Config UserName string // contains filtered or unexported fields }
func LoadFromFile ¶
func LoadFromFile(filename string) (*Kubeconfig, error)
Create a new Kubeconfig object based on a kubeconfig file.
func NewFromToken ¶
func NewFromToken(userName, clusterName, serverURL, tokenFile, rootCAFile string) (*Kubeconfig, error)
Create a new Kubeconfig object based on a token and CA cert.
func (*Kubeconfig) Refresh ¶
func (kc *Kubeconfig) Refresh() error
Update our kubeconfig in case the token has changed. Note: Kubernetes will probably transition to serviceaccount tokens with limited lifetime. This function can be called periodically to update the config.
func (*Kubeconfig) WriteToFile ¶
func (kc *Kubeconfig) WriteToFile(filename string) error
Save kubeconfig to a file.
Click to show internal directories.
Click to hide internal directories.