eks

package
v0.0.0-...-4c17ca5 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFromFile

func LoadConfigFromFile(configFile string) (*api.ClusterConfig, error)

LoadConfigFromFile loads ClusterConfig from configFile

Types

type Client

type Client struct {
	Config      *clientcmdapi.Config
	ContextName string
	// contains filtered or unexported fields
}

Client stores information about the client config

func (*Client) NewClientSet

func (c *Client) NewClientSet() (*kubernetes.Clientset, error)

NewClientSet creates a new API client

type ClusterProvider

type ClusterProvider struct {
	// core fields used for config and AWS APIs
	Provider api.ClusterProvider
	// informative fields, i.e. used as outputs
	Status *ProviderStatus
}

ClusterProvider stores information about the cluster

func New

func New(spec *api.ProviderConfig, clusterSpec *api.ClusterConfig) *ClusterProvider

New creates a new setup of the used AWS APIs

func (*ClusterProvider) AppendExtraClusterConfigTasks

func (c *ClusterProvider) AppendExtraClusterConfigTasks(cfg *api.ClusterConfig, tasks *manager.TaskTree)

AppendExtraClusterConfigTasks returns all tasks for updating cluster configuration or nil if there are no tasks

func (*ClusterProvider) CanDelete

func (c *ClusterProvider) CanDelete(spec *api.ClusterConfig) (bool, error)

CanDelete return true when a cluster can be deleted, otherwise it returns false along with an error explaining the reason

func (*ClusterProvider) CanOperate

func (c *ClusterProvider) CanOperate(spec *api.ClusterConfig) (bool, error)

CanOperate return true when a cluster can be operated, otherwise it returns false along with an error explaining the reason

func (*ClusterProvider) CanUpdate

func (c *ClusterProvider) CanUpdate(spec *api.ClusterConfig) (bool, error)

CanUpdate return true when a cluster or add-ons can be updated, otherwise it returns false along with an error explaining the reason

func (*ClusterProvider) CheckAuth

func (c *ClusterProvider) CheckAuth() error

CheckAuth checks the AWS authentication

func (*ClusterProvider) ControlPlaneVersion

func (c *ClusterProvider) ControlPlaneVersion() string

ControlPlaneVersion returns cached version (EKS API)

func (*ClusterProvider) DescribeControlPlane

func (c *ClusterProvider) DescribeControlPlane(meta *api.ClusterMeta) (*awseks.Cluster, error)

DescribeControlPlane describes the cluster control plane

func (*ClusterProvider) EnsureAMI

func (c *ClusterProvider) EnsureAMI(version string, ng *api.NodeGroup) error

EnsureAMI ensures that the node AMI is set and is available

func (*ClusterProvider) GetCredentialsEnv

func (c *ClusterProvider) GetCredentialsEnv() ([]string, error)

GetCredentialsEnv returns the AWS credentials for env usage

func (*ClusterProvider) GetCurrentClusterConfigForLogging

func (c *ClusterProvider) GetCurrentClusterConfigForLogging(spec *api.ClusterConfig) (sets.String, sets.String, error)

GetCurrentClusterConfigForLogging fetches current cluster logging configuration as two sets - enabled and disabled types

func (*ClusterProvider) GetNodeGroupIAM

func (c *ClusterProvider) GetNodeGroupIAM(stackManager *manager.StackCollection, spec *api.ClusterConfig, ng *api.NodeGroup) error

GetNodeGroupIAM retrieves the IAM configuration of the given nodegroup

func (*ClusterProvider) GetUsername

func (c *ClusterProvider) GetUsername() string

GetUsername extracts the username part from the IAM role ARN

func (*ClusterProvider) IsSupportedRegion

func (c *ClusterProvider) IsSupportedRegion() bool

IsSupportedRegion check if given region is supported

func (*ClusterProvider) ListClusters

func (c *ClusterProvider) ListClusters(clusterName string, chunkSize int, output string, eachRegion bool) error

ListClusters display details of all the EKS cluster in your account

func (*ClusterProvider) LoadClusterVPC

func (c *ClusterProvider) LoadClusterVPC(spec *api.ClusterConfig) error

LoadClusterVPC loads the VPC configuration

func (*ClusterProvider) NewClient

func (c *ClusterProvider) NewClient(spec *api.ClusterConfig) (*Client, error)

NewClient creates a new client config by embedding the STS token

func (*ClusterProvider) NewOpenIDConnectManager

func (c *ClusterProvider) NewOpenIDConnectManager(spec *api.ClusterConfig) (*iamoidc.OpenIDConnectManager, error)

NewOpenIDConnectManager returns OpenIDConnectManager

func (*ClusterProvider) NewRawClient

func (c *ClusterProvider) NewRawClient(spec *api.ClusterConfig) (*kubewrapper.RawClient, error)

NewRawClient creates a new raw REST client in one go with an embedded STS token

func (*ClusterProvider) NewStackManager

func (c *ClusterProvider) NewStackManager(spec *api.ClusterConfig) *manager.StackCollection

NewStackManager returns a new stack manager

func (*ClusterProvider) NewStdClientSet

func (c *ClusterProvider) NewStdClientSet(spec *api.ClusterConfig) (*kubernetes.Clientset, error)

NewStdClientSet creates a new API client in one go with an embedded STS token, this is most commonly used option

func (*ClusterProvider) RefreshClusterStatus

func (c *ClusterProvider) RefreshClusterStatus(spec *api.ClusterConfig) error

RefreshClusterStatus calls c.DescribeControlPlane and caches the results; it parses the credentials (endpoint, CA certificate) and stores them in spec.Status, so that a Kubernetes client can be constructed; additionally it caches Kubernetes version (use ctl.ControlPlaneVersion to retrieve it) and other properties in c.Status.cachedClusterInfo

func (*ClusterProvider) SetAvailabilityZones

func (c *ClusterProvider) SetAvailabilityZones(spec *api.ClusterConfig, given []string) error

SetAvailabilityZones sets the given (or chooses) the availability zones

func (*ClusterProvider) SetNodeLabels

func (c *ClusterProvider) SetNodeLabels(ng *api.NodeGroup, meta *api.ClusterMeta) error

SetNodeLabels initialises and validate node labels based on cluster and nodegroup names

func (*ClusterProvider) UpdateClusterConfigForLogging

func (c *ClusterProvider) UpdateClusterConfigForLogging(cfg *api.ClusterConfig) error

UpdateClusterConfigForLogging calls UpdateClusterConfig to enable logging

func (*ClusterProvider) UpdateClusterVersion

func (c *ClusterProvider) UpdateClusterVersion(cfg *api.ClusterConfig) (*awseks.Update, error)

UpdateClusterVersion calls eks.UpdateClusterVersion and updates to cfg.Metadata.Version, it will return update ID along with an error (if it occurs)

func (*ClusterProvider) UpdateClusterVersionBlocking

func (c *ClusterProvider) UpdateClusterVersionBlocking(cfg *api.ClusterConfig) error

UpdateClusterVersionBlocking calls UpdateClusterVersion and blocks until update operation is successful

func (*ClusterProvider) ValidateClusterForCompatibility

func (c *ClusterProvider) ValidateClusterForCompatibility(cfg *api.ClusterConfig, stackManager *manager.StackCollection) error

ValidateClusterForCompatibility looks at the cluster stack and check if it's compatible with current nodegroup configuration, if it find issues it returns an error

func (*ClusterProvider) ValidateExistingNodeGroupsForCompatibility

func (c *ClusterProvider) ValidateExistingNodeGroupsForCompatibility(cfg *api.ClusterConfig, stackManager *manager.StackCollection) error

ValidateExistingNodeGroupsForCompatibility looks at each of the existing nodegroups and validates configuration, if it find issues it logs messages

func (*ClusterProvider) WaitForControlPlane

func (c *ClusterProvider) WaitForControlPlane(meta *api.ClusterMeta, clientSet *kubernetes.Clientset) error

WaitForControlPlane waits till the control plane is ready

func (*ClusterProvider) WaitForNodes

func (c *ClusterProvider) WaitForNodes(clientSet kubernetes.Interface, ng *api.NodeGroup) error

WaitForNodes waits till the nodes are ready

type LoggingRetryer

type LoggingRetryer struct {
	client.DefaultRetryer
}

LoggingRetryer adds some logging when we are retrying, so we have some idea what is happening Right now it is very basic - e.g. it only logs when we retry (so doesn't log when we fail due to too many retries) It was copied from k8s.io/kops/upup/pkg/fi/cloudup/awsup/logging_retryer.go; the original version used glog, and didn't export the constructor

func (LoggingRetryer) RetryRules

func (l LoggingRetryer) RetryRules(r *request.Request) time.Duration

RetryRules extends on DefaultRetryer.RetryRules

type ProviderServices

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

ProviderServices stores the used APIs

func (ProviderServices) CloudFormation

CloudFormation returns a representation of the CloudFormation API

func (ProviderServices) CloudFormationRoleARN

func (p ProviderServices) CloudFormationRoleARN() string

CloudFormationRoleARN returns, if any, a service role used by CloudFormation to call AWS API on your behalf

func (ProviderServices) CloudTrail

CloudTrail returns a representation of the CloudTrail API

func (ProviderServices) EC2

EC2 returns a representation of the EC2 API

func (ProviderServices) EKS

EKS returns a representation of the EKS API

func (ProviderServices) ELB

ELB returns a representation of the ELB API

func (ProviderServices) ELBV2

ELBV2 returns a representation of the ELBV2 API

func (ProviderServices) IAM

IAM returns a representation of the IAM API

func (ProviderServices) Profile

func (p ProviderServices) Profile() string

Profile returns provider-level profile name

func (ProviderServices) Region

func (p ProviderServices) Region() string

Region returns provider-level region setting

func (ProviderServices) STS

STS returns a representation of the STS API

func (ProviderServices) WaitTimeout

func (p ProviderServices) WaitTimeout() time.Duration

WaitTimeout returns provider-level duration after which any wait operation has to timeout

type ProviderStatus

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

ProviderStatus stores information about the used IAM role and the resulting session

type UnsupportedOIDCError

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

UnsupportedOIDCError represents an unsupported OIDC error

func (*UnsupportedOIDCError) Error

func (u *UnsupportedOIDCError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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