controller

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveERdmaDevices

func RemoveERdmaDevices(erdmaClient client.Client, ctx context.Context, nodeName string) (ctrl.Result, error)

Types

type ERdmaDeviceReconciler

type ERdmaDeviceReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	EriClient *EriClient
}

ERdmaDeviceReconciler reconciles a ERdmaDevice object

func (*ERdmaDeviceReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ERdmaDevice object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.0/pkg/reconcile

func (*ERdmaDeviceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type EncryptedCredentialInfo

type EncryptedCredentialInfo struct {
	AccessKeyID     string `json:"access.key.id"`
	AccessKeySecret string `json:"access.key.secret"`
	SecurityToken   string `json:"security.token"`
	Expiration      string `json:"expiration"`
	Keyring         string `json:"keyring"`
}

type EriClient

type EriClient struct {
	ManagedNonOwned bool
	// contains filtered or unexported fields
}

func NewEriClient

func NewEriClient(k8sClient client.Client) (*EriClient, error)

func (*EriClient) ConvertPrimaryENI

func (e *EriClient) ConvertPrimaryENI(primaryENI string, instanceID string, queuePair int) error

func (*EriClient) CreateEriForInstance

func (e *EriClient) CreateEriForInstance(instanceInfo *ecs.DescribeInstancesResponseBodyInstancesInstance, cardIndex []int, queuePair int) ([]*types.ERI, error)

func (*EriClient) EnsureEriForInstance

func (e *EriClient) EnsureEriForInstance(devices []networkv1.DeviceInfo) ([]networkv1.DeviceStatus, error)

func (*EriClient) EnsureEriTags

func (e *EriClient) EnsureEriTags(eniIDs []string, instanceID string) error

EnsureEriTags adds the terway-excluded and instance-id tags to the given ENIs. It deliberately does NOT add the creator tag because this method is called on ENIs that may not have been created by erdma-controller (e.g. ECS-console pre-bound ERDMA NICs or Primary ENIs converted to RDMA). The creator tag is only set at CreateNetworkInterface time for ENIs this controller actually creates. TagResources is idempotent on the cloud side: re-applying the same (key,value) pair is a no-op, so this is safe to call repeatedly. instanceID may be empty, in which case the instance-id tag is skipped.

func (*EriClient) InstanceIDFromNode

func (e *EriClient) InstanceIDFromNode(node *corev1.Node) (string, error)

func (*EriClient) IsJumboFrameEnabled

func (e *EriClient) IsJumboFrameEnabled(instanceID string) (bool, error)

func (*EriClient) SelectERIs

func (e *EriClient) SelectERIs(instanceID string) ([]*types.ERI, error)

func (*EriClient) SelectEriFromExist

func (e *EriClient) SelectEriFromExist(existENIs []*ecs.DescribeNetworkInterfacesResponseBodyNetworkInterfaceSetsNetworkInterfaceSet, queuePairCount, cardCount int) ([]*types.ERI, []int, int, error)

type NodeReconciler

type NodeReconciler struct {
	client.Client
	Scheme     *runtime.Scheme
	EriClient  *EriClient
	CtrlConfig *types.Config
	// contains filtered or unexported fields
}

NodeReconciler reconciles a ERdmaDevice object

func (*NodeReconciler) OwnNode

func (r *NodeReconciler) OwnNode(node *v1.Node) bool

func (*NodeReconciler) PredictNodeUpdate

func (r *NodeReconciler) PredictNodeUpdate(oldNode, newNode *v1.Node) bool

func (*NodeReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ERdmaDevice object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.0/pkg/reconcile

func (*NodeReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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