podidentityassociation

package
v0.168.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPodIdentityAgentInstalled added in v0.166.0

func IsPodIdentityAgentInstalled(ctx context.Context, eksAPI awsapi.EKS, clusterName string) (bool, error)

func MakeStackName

func MakeStackName(clusterName, namespace, serviceAccountName string) string

MakeStackName creates a stack name for the specified access entry.

Types

type APIDeleter

type APIDeleter interface {
	APILister
	DeletePodIdentityAssociation(ctx context.Context, params *eks.DeletePodIdentityAssociationInput, optFns ...func(*eks.Options)) (*eks.DeletePodIdentityAssociationOutput, error)
}

APIDeleter lists and deletes pod identity associations using the EKS API.

type APILister

type APILister interface {
	ListPodIdentityAssociations(ctx context.Context, params *eks.ListPodIdentityAssociationsInput, optFns ...func(*eks.Options)) (*eks.ListPodIdentityAssociationsOutput, error)
}

APILister lists pod identity associations using the EKS API.

type APIUpdater

type APIUpdater interface {
	APILister
	DescribePodIdentityAssociation(ctx context.Context, params *eks.DescribePodIdentityAssociationInput, optFns ...func(*eks.Options)) (*eks.DescribePodIdentityAssociationOutput, error)
	UpdatePodIdentityAssociation(ctx context.Context, params *eks.UpdatePodIdentityAssociationInput, optFns ...func(*eks.Options)) (*eks.UpdatePodIdentityAssociationOutput, error)
}

APIUpdater updates pod identity associations using the EKS API.

type AddonCreator added in v0.166.0

type AddonCreator interface {
	Create(ctx context.Context, addon *api.Addon, waitTimeout time.Duration) error
}

type Creator

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

func NewCreator

func NewCreator(clusterName string, stackCreator StackCreator, eksAPI awsapi.EKS) *Creator

func (*Creator) CreatePodIdentityAssociations

func (c *Creator) CreatePodIdentityAssociations(ctx context.Context, podIdentityAssociations []api.PodIdentityAssociation) error

func (*Creator) CreateTasks

func (c *Creator) CreateTasks(ctx context.Context, podIdentityAssociations []api.PodIdentityAssociation) *tasks.TaskTree

type Deleter

type Deleter struct {
	// ClusterName is the cluster name.
	ClusterName string
	// StackDeleter is used to delete stacks.
	StackDeleter StackDeleter
	// APIDeleter deletes pod identity associations using the EKS API.
	APIDeleter APIDeleter
}

A Deleter deletes pod identity associations.

func NewDeleter

func NewDeleter(clusterName string, stackDeleter StackDeleter, apiDeleter APIDeleter) *Deleter

func (*Deleter) Delete

func (d *Deleter) Delete(ctx context.Context, podIDs []Identifier) error

Delete deletes the specified podIdentityAssociations.

func (*Deleter) DeleteTasks

func (d *Deleter) DeleteTasks(ctx context.Context, podIDs []Identifier) (*tasks.TaskTree, error)

type Getter

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

func NewGetter

func NewGetter(clusterName string, eksAPI awsapi.EKS) *Getter

func (*Getter) GetPodIdentityAssociations

func (g *Getter) GetPodIdentityAssociations(ctx context.Context, namespace, serviceAccountName string) ([]Summary, error)

type IRSAv1StackNameResolver added in v0.166.0

type IRSAv1StackNameResolver map[string]IRSAv1StackSummary

func (*IRSAv1StackNameResolver) GetStack added in v0.166.0

func (r *IRSAv1StackNameResolver) GetStack(roleARN string) (IRSAv1StackSummary, bool)

func (*IRSAv1StackNameResolver) Populate added in v0.166.0

func (r *IRSAv1StackNameResolver) Populate(
	getIAMServiceAccounts func() ([]*api.ClusterIAMServiceAccount, error),
) error

type IRSAv1StackSummary added in v0.166.0

type IRSAv1StackSummary struct {
	Name         string
	Tags         map[string]string
	Capabilities []string
}

type Identifier

type Identifier struct {
	// Namespace is the namespace the service account belongs to.
	Namespace string
	// ServiceAccountName is the name of the Kubernetes ServiceAccount.
	ServiceAccountName string
}

Identifier represents a pod identity association.

func ToIdentifiers

func ToIdentifiers(podIdentityAssociations []api.PodIdentityAssociation) []Identifier

ToIdentifiers maps a list of PodIdentityAssociations to a list of Identifiers.

func (Identifier) IDString added in v0.166.0

func (i Identifier) IDString() string

func (Identifier) NameString added in v0.166.0

func (i Identifier) NameString() string

type Migrator added in v0.166.0

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

func NewMigrator added in v0.166.0

func NewMigrator(
	clusterName string,
	eksAPI awsapi.EKS,
	iamAPI awsapi.IAM,
	stackUpdater StackUpdater,
	clientSet kubernetes.Interface,
	addonCreator AddonCreator,
) *Migrator

func (*Migrator) MigrateToPodIdentity added in v0.166.0

func (m *Migrator) MigrateToPodIdentity(ctx context.Context, options PodIdentityMigrationOptions) error

type PodIdentityMigrationOptions added in v0.166.0

type PodIdentityMigrationOptions struct {
	RemoveOIDCProviderTrustRelationship bool
	// SkipAgentInstallation               bool
	Approve bool
	Timeout time.Duration
}

type StackCreator added in v0.166.0

type StackCreator interface {
	CreateStack(ctx context.Context, name string, stack builder.ResourceSetReader, tags, parameters map[string]string, errs chan error) error
}

type StackDeleter

type StackDeleter interface {
	StackLister
	DeleteStackBySpecSync(ctx context.Context, stack *cfntypes.Stack, errCh chan error) error
}

A StackDeleter lists and deletes CloudFormation stacks.

type StackLister

type StackLister interface {
	ListPodIdentityStackNames(ctx context.Context) ([]string, error)
	DescribeStack(ctx context.Context, stack *manager.Stack) (*manager.Stack, error)
	GetIAMServiceAccounts(ctx context.Context) ([]*api.ClusterIAMServiceAccount, error)
}

A StackLister lists and describes CloudFormation stacks.

type StackUpdater

type StackUpdater interface {
	StackLister
	// MustUpdateStack updates the CloudFormation stack.
	MustUpdateStack(ctx context.Context, options manager.UpdateStackOptions) error
}

A StackUpdater updates CloudFormation stacks.

type Summary

type Summary struct {
	AssociationARN     string
	Namespace          string
	ServiceAccountName string
	RoleARN            string
}

type Updater

type Updater struct {
	// ClusterName is the cluster name.
	ClusterName string
	// StackUpdater updates stacks.
	StackUpdater StackUpdater
	// APIDeleter updates pod identity associations using the EKS API.
	APIUpdater APIUpdater
}

An Updater updates pod identity associations.

func (*Updater) Update

func (u *Updater) Update(ctx context.Context, podIdentityAssociations []api.PodIdentityAssociation) error

Update updates the specified pod identity associations.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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