kind: sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig/internal/kubeconfig Index | Files

package kubeconfig

import "sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig/internal/kubeconfig"

Index

Package Files

encode.go helpers.go lock.go merge.go paths.go read.go remove.go types.go write.go

func Encode Uses

func Encode(cfg *Config) ([]byte, error)

Encode encodes the cfg to yaml

func KINDClusterKey Uses

func KINDClusterKey(clusterName string) string

KINDClusterKey identifies kind clusters in kubeconfig files

func RemoveKIND Uses

func RemoveKIND(kindClusterName string, explicitPath string) error

RemoveKIND removes the kind cluster kindClusterName from the KUBECONFIG files at configPaths

func WriteMerged Uses

func WriteMerged(kindConfig *Config, explicitConfigPath string) error

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.

type Cluster Uses

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 Uses

type Config struct {
    // Clusters is a map of referencable names to cluster configs
    Clusters []NamedCluster `yaml:"clusters,omitempty"`
    // Users is a map of referencable names to user configs
    Users []NamedUser `yaml:"users,omitempty"`
    // Contexts is a map of referencable 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 Uses

func KINDFromRawKubeadm(rawKubeadmKubeConfig, clusterName, server string) (*Config, error)

KINDFromRawKubeadm returns a kind kubeconfig derived from the raw kubeadm kubeconfig, the kind clusterName, and the server. server is ignored if unset.

type Context Uses

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 Uses

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 Uses

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

type NamedUser Uses

type NamedUser struct {
    // Name is the nickname for this User
    Name string `yaml:"name"`
    // User holds the user information
    // We do not touch this and merely write it back
    User map[string]interface{} `yaml:"user"`
}

NamedUser relates nicknames to user information

Package kubeconfig imports 10 packages (graph) and is imported by 1 packages. Updated 2020-01-13. Refresh now. Tools for package owners.