Documentation ¶
Index ¶
- Constants
- func AddIPAddressClaimReconciler(ctx context.Context, mgr manager.Manager, watchFilter string) error
- func AddressReferencesPoolKind(gk metav1.GroupKind) predicate.Funcs
- func ClaimReferencesPoolKind(gk metav1.GroupKind) predicate.Funcs
- func NewIPAddress(claim *ipamv1.IPAddressClaim, pool client.Object) ipamv1.IPAddress
- type ClaimHandler
- type IPAddressClaimHandler
- func (h *IPAddressClaimHandler) EnsureAddress(ctx context.Context, address *ipamv1.IPAddress) (*ctrl.Result, error)
- func (h *IPAddressClaimHandler) FetchPool(ctx context.Context) (client.Object, *ctrl.Result, error)
- func (h *IPAddressClaimHandler) ReleaseAddress(_ context.Context) (*ctrl.Result, error)
- type IPAddressClaimReconciler
- type NetboxProviderAdapter
- type ProviderAdapter
Constants ¶
View Source
const ( // ReleaseAddressFinalizer is used to release an IP address before cleaning up the claim. ReleaseAddressFinalizer = "netbox.ipam.cluster.x-k8s.io/ReleaseAddress" // ProtectAddressFinalizer is used to prevent deletion of an IPAddress object while its claim is not deleted. ProtectAddressFinalizer = "netbox.ipam.cluster.x-k8s.io/ProtectAddress" )
Variables ¶
This section is empty.
Functions ¶
func AddressReferencesPoolKind ¶
AddressReferencesPoolKind is a predicate that ensures an ipamv1.IPAddress references a specified pool kind.
func NewIPAddress ¶
NewIPAddress creates a new ipamv1.IPAddress with references to a pool and claim.
Types ¶
type ClaimHandler ¶
type ClaimHandler interface { // FetchPool is called to fetch the pool referenced by the claim. The pool needs to be stored by the handler. FetchPool(ctx context.Context) (client.Object, *ctrl.Result, error) // EnsureAddress is called to make sure that the IPAddress.Spec is correct and the address is allocated. EnsureAddress(ctx context.Context, address *ipamv1.IPAddress) (*ctrl.Result, error) // ReleaseAddress is called to release the ip address that was allocated for the claim. ReleaseAddress(ctx context.Context) (*ctrl.Result, error) }
ClaimHandler knows how to allocate and release IP addresses for a specific provider.
type IPAddressClaimHandler ¶
IPAddressClaimHandler reconciles a InClusterIPPool object.
func (*IPAddressClaimHandler) EnsureAddress ¶
func (h *IPAddressClaimHandler) EnsureAddress(ctx context.Context, address *ipamv1.IPAddress) (*ctrl.Result, error)
EnsureAddress ensures that the IPAddress contains a valid address.
func (*IPAddressClaimHandler) ReleaseAddress ¶
type IPAddressClaimReconciler ¶
type IPAddressClaimReconciler struct { client.Client Scheme *runtime.Scheme WatchFilterValue string Adapter ProviderAdapter }
IPAddressClaimReconciler reconciles a IPAddressClaim object
type NetboxProviderAdapter ¶
NetboxProviderAdapter is used as middle layer for provider integration.
func (*NetboxProviderAdapter) ClaimHandlerFor ¶
func (a *NetboxProviderAdapter) ClaimHandlerFor(_ client.Client, claim *ipamv1.IPAddressClaim) ClaimHandler
func (*NetboxProviderAdapter) SetupWithManager ¶
type ProviderAdapter ¶
type ProviderAdapter interface { // SetupWithManager will be called during the setup of the controller for the ClaimReconciler to allow the provider // implementation to extend the controller configuration. SetupWithManager(context.Context, *ctrl.Builder) error // ClaimHandlerFor is called during reconciliation to get a ClaimHandler for the reconciled [ipamv1.IPAddressClaim]. ClaimHandlerFor(client.Client, *ipamv1.IPAddressClaim) ClaimHandler }
ProviderAdapter is an interface that must be implemented by the IPAM provider.
Click to show internal directories.
Click to hide internal directories.