kubeconfig

package
v0.87.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 15 Imported by: 19

Documentation

Index

Constants

View Source
const (
	// AWSIAMAuthenticator defines the name of the AWS IAM authenticator
	AWSIAMAuthenticator = "aws-iam-authenticator"
	// HeptioAuthenticatorAWS defines the old name of AWS IAM authenticator
	HeptioAuthenticatorAWS = "heptio-authenticator-aws"
	// AWSEKSAuthenticator defines the recently added `aws eks get-token` command
	AWSEKSAuthenticator = "aws"
	// Shadowing the default kubeconfig path environment variable
	RecommendedConfigPathEnvVar = clientcmd.RecommendedConfigPathEnvVar
	// AWSIAMAuthenticatorMinimumBetaVersion this is the minimum version at which aws-iam-authenticator uses v1beta1 as APIVersion
	AWSIAMAuthenticatorMinimumBetaVersion = "0.5.3"
)

Variables

This section is empty.

Functions

func AppendAuthenticator

func AppendAuthenticator(config *clientcmdapi.Config, clusterMeta *api.ClusterMeta, authenticatorCMD, roleARN, profile string)

AppendAuthenticator appends the AWS IAM authenticator, and if profile is non-empty string it sets AWS_PROFILE environment variable also

func AuthenticatorCommands

func AuthenticatorCommands() []string

AuthenticatorCommands returns all of authenticator commands

func AutoPath

func AutoPath(name string) string

AutoPath returns the path for the auto-generated kubeconfig

func DefaultPath

func DefaultPath() string

DefaultPath defines the default path

func LookupAuthenticator

func LookupAuthenticator() (string, bool)

LookupAuthenticator looks up an available authenticator

func MaybeDeleteConfig

func MaybeDeleteConfig(meta *api.ClusterMeta)

MaybeDeleteConfig will delete the auto-generated kubeconfig, if it exists

func NewForKubectl

func NewForKubectl(spec *api.ClusterConfig, username, roleARN, profile string) *clientcmdapi.Config

NewForKubectl creates configuration for a user with kubectl by configuring a suitable authenticator and respecting provider settings

func NewForUser

func NewForUser(spec *api.ClusterConfig, username string) *clientcmdapi.Config

NewForUser returns a Config suitable for a user by respecting provider settings

func Write

func Write(path string, newConfig clientcmdapi.Config, setContext bool) (string, error)

Write will write Kubernetes client configuration to a file. If path isn't specified then the path will be determined by client-go. If file pointed to by path doesn't exist it will be created. If the file already exists then the configuration will be merged with the existing file.

Types

type AWSAuthenticatorVersionFormat added in v0.86.0

type AWSAuthenticatorVersionFormat struct {
	Version string `json:"Version"`
}

AWSAuthenticatorVersionFormat is the format in which aws-iam-authenticator displays version information: {"Version":"0.5.5","Commit":"85e50980d9d916ae95882176c18f14ae145f916f"}

type ConfigBuilder

type ConfigBuilder struct {
	// contains filtered or unexported fields
}

ConfigBuilder can create a client-go clientcmd Config

func NewBuilder

func NewBuilder(metadata *api.ClusterMeta, status *api.ClusterStatus, username string) *ConfigBuilder

NewBuilder returns a minimal ConfigBuilder

func (*ConfigBuilder) Build

func (cb *ConfigBuilder) Build() *clientcmdapi.Config

Build creates the Config with the ConfigBuilder settings

func (*ConfigBuilder) UseCertificateAuthorityFile

func (cb *ConfigBuilder) UseCertificateAuthorityFile(path string) *ConfigBuilder

UseCertificateAuthorityFile sets the config to use CA from file for TLS communication instead of the CA retrieved from EKS

func (*ConfigBuilder) UseSystemCA

func (cb *ConfigBuilder) UseSystemCA() *ConfigBuilder

UseSystemCA sets the config to use the system CAs for TLS communication instead of the CA retrieved from EKS

type ExecCommandFunc added in v0.86.0

type ExecCommandFunc func(name string, arg ...string) *exec.Cmd

Jump to

Keyboard shortcuts

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