Documentation ¶
Index ¶
- func Encode(cfg *Config) ([]byte, error)
- func KINDClusterKey(clusterName string) string
- func RemoveKIND(kindClusterName string, explicitPath string) error
- func WriteMerged(kindConfig *Config, explicitConfigPath string) error
- type Cluster
- type Config
- type Context
- type NamedCluster
- type NamedContext
- type NamedUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KINDClusterKey ¶
KINDClusterKey identifies kind clusters in kubeconfig files
func RemoveKIND ¶
RemoveKIND removes the kind cluster kindClusterName from the KUBECONFIG files at configPaths
func WriteMerged ¶
WriteMerged writes a kind kubeconfig (see KINDFromRawKubeadm) into configPath merging with the existing contents if any and setting the current context to the kind config's current context.
Types ¶
type Cluster ¶
type Cluster struct { // Server is the address of the kubernetes cluster (https://hostname:port). Server string `yaml:"server,omitempty"` // OtherFields contains fields kind does not inspect or modify, these are // read purely for writing back OtherFields map[string]interface{} `yaml:",inline,omitempty"` }
Cluster contains information about how to communicate with a kubernetes cluster
type Config ¶
type Config struct { // Clusters is a map of referenceable names to cluster configs Clusters []NamedCluster `yaml:"clusters,omitempty"` // Users is a map of referenceable names to user configs Users []NamedUser `yaml:"users,omitempty"` // Contexts is a map of referenceable names to context configs Contexts []NamedContext `yaml:"contexts,omitempty"` // CurrentContext is the name of the context that you would like to use by default CurrentContext string `yaml:"current-context,omitempty"` // OtherFields contains fields kind does not inspect or modify, these are // read purely for writing back OtherFields map[string]interface{} `yaml:",inline,omitempty"` }
Config represents a KUBECONFIG, with the fields kind is likely to use Other fields are handled as unstructured data purely read for writing back to disk via the OtherFields field
func KINDFromRawKubeadm ¶
KINDFromRawKubeadm returns a kind kubeconfig derived from the raw kubeadm kubeconfig, the kind clusterName, and the server. server is ignored if unset.
type Context ¶
type Context struct { // Cluster is the name of the cluster for this context Cluster string `yaml:"cluster"` // User is the name of the User for this context User string `yaml:"user"` // OtherFields contains fields kind does not inspect or modify, these are // read purely for writing back OtherFields map[string]interface{} `yaml:",inline,omitempty"` }
Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with)
type NamedCluster ¶
type NamedCluster struct { // Name is the nickname for this Cluster Name string `yaml:"name"` // Cluster holds the cluster information Cluster Cluster `yaml:"cluster"` }
NamedCluster relates nicknames to cluster information
type NamedContext ¶
type NamedContext struct { // Name is the nickname for this Context Name string `yaml:"name"` // Context holds the context information Context Context `yaml:"context"` }
NamedContext relates nicknames to context information