eks

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRESTRequest

func HandleRESTRequest(ctx *service.RequestContext, store *Store, locator ServiceLocator) (*service.Response, error)

HandleRESTRequest routes EKS REST-JSON requests based on path and method.

Types

type Addon

type Addon struct {
	Name                  string
	ARN                   string
	ClusterName           string
	AddonVersion          string
	Status                string
	ServiceAccountRoleARN string
	CreatedAt             time.Time
	ModifiedAt            time.Time
	Tags                  map[string]string
	Lifecycle             *lifecycle.Machine
}

Addon represents an EKS addon.

type Cluster

type Cluster struct {
	Name                   string
	ARN                    string
	Version                string
	RoleARN                string
	Status                 string
	Endpoint               string
	CertificateAuthority   string
	OIDCIssuer             string
	PlatformVersion        string
	SubnetIDs              []string
	SecurityGroupIDs       []string
	ClusterSecurityGroupID string
	ServiceCIDR            string
	VPCID                  string
	CreatedAt              time.Time
	Tags                   map[string]string
	Lifecycle              *lifecycle.Machine
}

Cluster represents an EKS cluster.

type EKSService

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

EKSService is the cloudmock implementation of the AWS Elastic Kubernetes Service API.

func New

func New(accountID, region string) *EKSService

New returns a new EKSService for the given AWS account ID and region.

func NewWithLocator

func NewWithLocator(accountID, region string, locator ServiceLocator) *EKSService

NewWithLocator returns a new EKSService with a service locator for cross-service communication.

func (*EKSService) Actions

func (s *EKSService) Actions() []service.Action

Actions returns the list of EKS API actions supported by this service. EKS uses REST-JSON path-based routing, so these are descriptive only.

func (*EKSService) HandleRequest

func (s *EKSService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming EKS request to the appropriate handler. EKS uses REST-JSON path-based routing.

func (*EKSService) HealthCheck

func (s *EKSService) HealthCheck() error

HealthCheck always returns nil (no external dependencies).

func (*EKSService) Name

func (s *EKSService) Name() string

Name returns the AWS service name used for routing.

func (*EKSService) ResourceSchemas

func (s *EKSService) ResourceSchemas() []schema.ResourceSchema

ResourceSchemas returns the schema for EKS resource types.

func (*EKSService) SetLocator

func (s *EKSService) SetLocator(locator ServiceLocator)

SetLocator sets the service locator for cross-service communication (EC2 for node groups).

type FargateProfile

type FargateProfile struct {
	Name                string
	ARN                 string
	ClusterName         string
	PodExecutionRoleARN string
	Status              string
	SubnetIDs           []string
	Selectors           []FargateSelector
	CreatedAt           time.Time
	Tags                map[string]string
	Lifecycle           *lifecycle.Machine
}

FargateProfile represents an EKS Fargate profile.

type FargateSelector

type FargateSelector struct {
	Namespace string
	Labels    map[string]string
}

FargateSelector represents a pod selector for Fargate.

type Nodegroup

type Nodegroup struct {
	Name            string
	ARN             string
	ClusterName     string
	NodeRole        string
	Status          string
	InstanceTypes   []string
	AmiType         string
	DiskSize        int
	ScalingConfig   *NodegroupScalingConfig
	SubnetIDs       []string
	Labels          map[string]string
	Taints          []Taint
	CapacityType    string   // ON_DEMAND, SPOT
	NodeInstanceIDs []string // EC2 instance IDs created for this node group
	CreatedAt       time.Time
	Tags            map[string]string
	Lifecycle       *lifecycle.Machine
}

Nodegroup represents an EKS managed node group.

type NodegroupScalingConfig

type NodegroupScalingConfig struct {
	MinSize     int
	MaxSize     int
	DesiredSize int
}

NodegroupScalingConfig represents scaling configuration for a node group.

type ServiceLocator

type ServiceLocator interface {
	Lookup(name string) (service.Service, error)
}

ServiceLocator provides access to other services for cross-service communication.

type Store

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

Store manages all EKS resources.

func NewStore

func NewStore(accountID, region string) *Store

NewStore returns a new Store for the given account and region.

func (*Store) CreateAddon

func (s *Store) CreateAddon(clusterName, addonName, addonVersion, serviceAccountRoleARN string, tags map[string]string) (*Addon, bool)

func (*Store) CreateCluster

func (s *Store) CreateCluster(name, version, roleARN, vpcID, serviceCIDR string, subnetIDs, sgIDs []string, tags map[string]string) (*Cluster, bool)

func (*Store) CreateFargateProfile

func (s *Store) CreateFargateProfile(clusterName, profileName, podExecRoleARN string, subnetIDs []string, selectors []FargateSelector, tags map[string]string) (*FargateProfile, bool)

func (*Store) CreateNodegroup

func (s *Store) CreateNodegroup(clusterName, ngName, nodeRole, amiType, capacityType string, instanceTypes, subnetIDs []string, diskSize int, scaling *NodegroupScalingConfig, labels map[string]string, taints []Taint, tags map[string]string) (*Nodegroup, bool)

func (*Store) DeleteAddon

func (s *Store) DeleteAddon(clusterName, addonName string) (*Addon, bool)

func (*Store) DeleteCluster

func (s *Store) DeleteCluster(name string) (*Cluster, bool)

func (*Store) DeleteFargateProfile

func (s *Store) DeleteFargateProfile(clusterName, profileName string) (*FargateProfile, bool)

func (*Store) DeleteNodegroup

func (s *Store) DeleteNodegroup(clusterName, ngName string) (*Nodegroup, bool)

func (*Store) GetAddon

func (s *Store) GetAddon(clusterName, addonName string) (*Addon, bool)

func (*Store) GetCluster

func (s *Store) GetCluster(name string) (*Cluster, bool)

func (*Store) GetFargateProfile

func (s *Store) GetFargateProfile(clusterName, profileName string) (*FargateProfile, bool)

func (*Store) GetNodegroup

func (s *Store) GetNodegroup(clusterName, ngName string) (*Nodegroup, bool)

func (*Store) ListAddons

func (s *Store) ListAddons(clusterName string) []string

func (*Store) ListClusters

func (s *Store) ListClusters() []string

func (*Store) ListFargateProfiles

func (s *Store) ListFargateProfiles(clusterName string) []string

func (*Store) ListNodegroups

func (s *Store) ListNodegroups(clusterName string) []string

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(arn string) (map[string]string, bool)

func (*Store) SetLocator

func (s *Store) SetLocator(locator ServiceLocator)

SetLocator sets the service locator for cross-service EC2 instance management.

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string) bool

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, keys []string) bool

func (*Store) UpdateClusterConfig

func (s *Store) UpdateClusterConfig(name, version string, subnetIDs, sgIDs []string) (*Cluster, bool)

func (*Store) UpdateNodegroupConfig

func (s *Store) UpdateNodegroupConfig(clusterName, ngName string, scaling *NodegroupScalingConfig, labels map[string]string, taints []Taint) (*Nodegroup, bool)

type Taint

type Taint struct {
	Key    string
	Value  string
	Effect string // NO_SCHEDULE, NO_EXECUTE, PREFER_NO_SCHEDULE
}

Taint represents a Kubernetes taint on a node group.

Jump to

Keyboard shortcuts

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