Documentation ¶
Index ¶
- Constants
- func AppendAuthenticator(config *clientcmdapi.Config, cluster ClusterInfo, ...)
- func AuthenticatorCommands() []string
- func AutoPath(name string) string
- func DefaultPath() string
- func LookupAuthenticator() (string, bool)
- func MaybeDeleteConfig(meta *api.ClusterMeta)
- func NewForKubectl(cluster ClusterInfo, username, roleARN, profile string) *clientcmdapi.Config
- func NewForUser(cluster ClusterInfo, username string) *clientcmdapi.Config
- func Write(path string, newConfig clientcmdapi.Config, setContext bool) (string, error)
- type AWSAuthenticatorVersionFormat
- type ClusterInfo
- type ConfigBuilder
- type ExecCommandFunc
- type KubectlVersionData
- type KubectlVersionFormat
Constants ¶
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" // AWSIAMAuthenticatorMinimumBetaVersion this is the minimum version at which aws-iam-authenticator uses v1beta1 as APIVersion AWSIAMAuthenticatorMinimumBetaVersion = "0.5.3" // AWSCLIv1MinimumBetaVersion this is the minimum version at which aws-cli v1 uses v1beta1 as APIVersion AWSCLIv1MinimumBetaVersion = "1.23.9" // AWSCLIv2MinimumBetaVersion this is the minimum version at which aws-cli v2 uses v1beta1 as APIVersion AWSCLIv2MinimumBetaVersion = "2.6.3" )
Variables ¶
This section is empty.
Functions ¶
func AppendAuthenticator ¶
func AppendAuthenticator(config *clientcmdapi.Config, cluster ClusterInfo, 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 LookupAuthenticator ¶
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(cluster ClusterInfo, 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(cluster ClusterInfo, username string) *clientcmdapi.Config
NewForUser returns a Config suitable for a user by respecting provider settings
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 ClusterInfo ¶ added in v0.112.0
type ClusterInfo interface { // ID returns the cluster ID. // This can either be the name of the cluster or a UUID. ID() string // Meta returns the cluster metadata. Meta() *api.ClusterMeta // GetStatus returns the cluster status. GetStatus() *api.ClusterStatus }
ClusterInfo holds the cluster info.
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 KubectlVersionData ¶ added in v0.100.0
type KubectlVersionData struct {
Version string `json:"gitVersion"`
}
KubectlVersionFormat is the format used by kubectl version --format=json, example output:
{ "clientVersion": { "major": "1", "minor": "23", "gitVersion": "v1.23.6", "gitCommit": "ad3338546da947756e8a88aa6822e9c11e7eac22", "gitTreeState": "archive", "buildDate": "2022-04-29T06:39:16Z", "goVersion": "go1.18.1", "compiler": "gc", "platform": "linux/amd64" } }
type KubectlVersionFormat ¶ added in v0.100.0
type KubectlVersionFormat struct {
ClientVersion KubectlVersionData `json:"clientVersion"`
}