controllers

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMACAddressLabelPrefix = "metal.ironcore.dev/mac-address-"
	CDefaultAggregateName  = "default"
)
View Source
const (
	CSizeFinalizer = "size.metal.ironcore.dev/finalizer"
	CPageLimit     = 1000
)
View Source
const (
	CAggregateFinalizer = "aggregate.metal.ironcore.dev/finalizer"
)
View Source
const (
	InventoryServiceAccountPrefix = "inventory-"
)

Variables

This section is empty.

Functions

func KubernetesAPIAddressFromEndpoint

func KubernetesAPIAddressFromEndpoint(subset corev1.EndpointSubset) string

func KubernetesAPIPortFromEndpoint

func KubernetesAPIPortFromEndpoint(ports []corev1.EndpointPort) int32

func SanitizeAPIServerEndpointString

func SanitizeAPIServerEndpointString(apiEndpoint APIEndpoint) string

Types

type APIEndpoint

type APIEndpoint struct {
	Address string
	Port    int32
}

type AccessReconciler

type AccessReconciler struct {
	ctrlclient.Client

	BootstrapAPIServer string
	Log                logr.Logger
	Scheme             *k8sruntime.Scheme
}

AccessReconciler reconciles an Inventory object for creating a dedicated kubeconfig.

func (*AccessReconciler) APIServerEndpoint

func (r *AccessReconciler) APIServerEndpoint(ctx context.Context) (string, error)

func (*AccessReconciler) BaseInventoryRoleBinding

func (r *AccessReconciler) BaseInventoryRoleBinding(
	machineInventoryNamespace string,
	machineInventoryServiceAccountName string) *rbacv1.RoleBinding

func (*AccessReconciler) BindInventoryAccountWithPermissions

func (r *AccessReconciler) BindInventoryAccountWithPermissions(
	ctx context.Context,
	machineInventoryServiceAccount *corev1.ServiceAccount,
	machineInventoryNamespace string,
	inventory *metalv1alpha4.Inventory) error

func (*AccessReconciler) BindPermissionsToTheServiceAccount

func (r *AccessReconciler) BindPermissionsToTheServiceAccount(
	ctx context.Context,
	machineInventoryServiceAccount *corev1.ServiceAccount,
	machineInventoryNamespace string,
	inventory *metalv1alpha4.Inventory,
	machineInventoryRole *rbacv1.Role) error

func (*AccessReconciler) ClientKubeconfigSecret

func (r *AccessReconciler) ClientKubeconfigSecret(
	ctx context.Context,
	inventory *metalv1alpha4.Inventory,
	clusterAccessSecret *corev1.Secret,
	inventoryServiceAccountName string,
	targetNamespace string) (*corev1.Secret, error)

func (*AccessReconciler) ClusterName

func (r *AccessReconciler) ClusterName() string

func (*AccessReconciler) CreateAccountForServerToClusterAccess

func (r *AccessReconciler) CreateAccountForServerToClusterAccess(
	ctx context.Context,
	machineInventoryServiceAccount *corev1.ServiceAccount,
	inventory *metalv1alpha4.Inventory) (*corev1.Secret, error)

func (*AccessReconciler) CreateInventoryRoleWithPermissions

func (r *AccessReconciler) CreateInventoryRoleWithPermissions(
	ctx context.Context,
	roleForInventory *rbacv1.Role) error

func (*AccessReconciler) CreateInventoryServiceAccount

func (r *AccessReconciler) CreateInventoryServiceAccount(
	ctx context.Context,
	inventoryServiceAccount *corev1.ServiceAccount) error

func (*AccessReconciler) CreateInventoryServiceAccountBindingRole

func (r *AccessReconciler) CreateInventoryServiceAccountBindingRole(
	ctx context.Context,
	machineRoleBinding *rbacv1.RoleBinding) error

func (*AccessReconciler) CreateInventoryServiceAccountSecret

func (r *AccessReconciler) CreateInventoryServiceAccountSecret(ctx context.Context, secret *corev1.Secret) error

func (*AccessReconciler) CreateNewKubeconfigForClusterAccess

func (r *AccessReconciler) CreateNewKubeconfigForClusterAccess(
	ctx context.Context,
	newKubeconfigSecret *corev1.Secret) error

func (*AccessReconciler) CreateObjectInCluster

func (r *AccessReconciler) CreateObjectInCluster(ctx context.Context, object ctrlclient.Object) error

func (*AccessReconciler) CurrentKubeConfig

func (r *AccessReconciler) CurrentKubeConfig(
	ctx context.Context,
	kubeconfigSecret *corev1.Secret) (*corev1.Secret, error)

func (*AccessReconciler) ExtractInventory

func (r *AccessReconciler) ExtractInventory(ctx context.Context,
	req ctrlruntime.Request) (*metalv1alpha4.Inventory, error)

func (*AccessReconciler) ExtractKubernetesAPIEndpoint

func (r *AccessReconciler) ExtractKubernetesAPIEndpoint(ctx context.Context) (*corev1.Endpoints, error)

func (*AccessReconciler) GetKubernetesObject

func (r *AccessReconciler) GetKubernetesObject(
	ctx context.Context,
	object ctrlclient.Object) error

func (*AccessReconciler) InventoryBaseRole

func (r *AccessReconciler) InventoryBaseRole(
	machineInventoryNamespace string,
	machineInventoryServiceAccountName string) *rbacv1.Role

func (*AccessReconciler) InventoryBindingRoleForServiceAccount

func (r *AccessReconciler) InventoryBindingRoleForServiceAccount(machineInventoryRole *rbacv1.Role,
	machineInventoryNamespace string,
	machineInventoryServiceAccount *corev1.ServiceAccount,
	inventory *metalv1alpha4.Inventory) *rbacv1.RoleBinding

func (*AccessReconciler) InventoryRoleBinding

func (r *AccessReconciler) InventoryRoleBinding(
	machineInventoryNamespace string,
	inventory *metalv1alpha4.Inventory,
	machineInventoryServiceAccount *corev1.ServiceAccount,
	machineInventoryRole *rbacv1.Role) *rbacv1.RoleBinding

func (*AccessReconciler) InventorySecret

func (r *AccessReconciler) InventorySecret(inventoryServiceAccount *corev1.ServiceAccount) *corev1.Secret

func (*AccessReconciler) InventorySecretForServiceAccount

func (r *AccessReconciler) InventorySecretForServiceAccount(
	ctx context.Context, machineInventoryServiceAccount *corev1.ServiceAccount) (*corev1.Secret, error)

func (*AccessReconciler) InventoryServiceAccount

func (r *AccessReconciler) InventoryServiceAccount(
	inventory *metalv1alpha4.Inventory) *corev1.ServiceAccount

func (*AccessReconciler) InventoryServiceAccountExist

func (r *AccessReconciler) InventoryServiceAccountExist(
	ctx context.Context,
	machineInventoryServiceAccount *corev1.ServiceAccount) (bool, error)

func (*AccessReconciler) InventoryServiceAccountRoleBindingExist

func (r *AccessReconciler) InventoryServiceAccountRoleBindingExist(
	ctx context.Context, roleBinding *rbacv1.RoleBinding) (bool, error)

func (*AccessReconciler) InventoryServiceAccountRoleExist

func (r *AccessReconciler) InventoryServiceAccountRoleExist(ctx context.Context, role *rbacv1.Role) (bool, error)

func (*AccessReconciler) InventoryServiceAccountSecretExist

func (r *AccessReconciler) InventoryServiceAccountSecretExist(
	ctx context.Context,
	secret *corev1.Secret) (bool, error)

func (*AccessReconciler) InventoryServiceAccountSecretToken

func (r *AccessReconciler) InventoryServiceAccountSecretToken(
	machineInventoryNamespace string,
	machineInventoryServiceAccountName string,
	inventory *metalv1alpha4.Inventory) *corev1.Secret

func (*AccessReconciler) KubeconfigForServer

func (r *AccessReconciler) KubeconfigForServer(
	ctx context.Context,
	inventoryTokenSecret *corev1.Secret,
	inventoryServiceAccountName string,
	targetNamespace string) (clientcmdapi.Config, error)

func (*AccessReconciler) Reconcile

func (*AccessReconciler) RetrieveServerAddressAndPortFromCluster

func (r *AccessReconciler) RetrieveServerAddressAndPortFromCluster(ctx context.Context) (APIEndpoint, error)

func (*AccessReconciler) RoleForInventoryWithPermissions

func (r *AccessReconciler) RoleForInventoryWithPermissions(
	machineInventoryNamespace string,
	machineInventoryServiceAccountName string,
	inventory *metalv1alpha4.Inventory) *rbacv1.Role

func (*AccessReconciler) SetupWithManager

func (r *AccessReconciler) SetupWithManager(mgr ctrlruntime.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*AccessReconciler) UpdateExistingKubeconfigForClusterAccess

func (r *AccessReconciler) UpdateExistingKubeconfigForClusterAccess(
	ctx context.Context,
	currentKubeconfigSecret *corev1.Secret,
	kubeconfigSecret *corev1.Secret) error

func (*AccessReconciler) UpdateNeeded

func (r *AccessReconciler) UpdateNeeded(
	currentKubeconfigSecret, newkubeconfigSecret *corev1.Secret) bool

type AggregateReconciler

type AggregateReconciler struct {
	client.Client

	Log    logr.Logger
	Scheme *runtime.Scheme
}

AggregateReconciler reconciles a Aggregate object.

func (*AggregateReconciler) Reconcile

func (r *AggregateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*AggregateReconciler) SetupWithManager

func (r *AggregateReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type InventoryReconciler

type InventoryReconciler struct {
	client.Client

	Log    logr.Logger
	Scheme *runtime.Scheme
}

InventoryReconciler reconciles an Inventory object.

func (*InventoryReconciler) Reconcile

func (r *InventoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

todo: refactor Reconcile function nolint:gocyclo

func (*InventoryReconciler) SetupWithManager

func (r *InventoryReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type SizeReconciler

type SizeReconciler struct {
	client.Client

	Log            logr.Logger
	Scheme         *runtime.Scheme
	EventPublisher events.DomainEventPublisher
}

SizeReconciler reconciles a Size object.

func (*SizeReconciler) Reconcile

func (r *SizeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*SizeReconciler) SetupWithManager

func (r *SizeReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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