Documentation ¶
Overview ¶
Package ipam contains helper functions to create, update and delete ipam related resources in a Kubernetes cluster
Index ¶
- Variables
- func InClusterPoolFormat(cluster *infrav1.ProxmoxCluster, format string) string
- type Helper
- func (h *Helper) CreateIPAddressClaim(ctx context.Context, owner client.Object, ...) error
- func (h *Helper) CreateOrUpdateInClusterIPPool(ctx context.Context) error
- func (h *Helper) GetDefaultInClusterIPPool(ctx context.Context, format string) (*ipamicv1.InClusterIPPool, error)
- func (h *Helper) GetGlobalInClusterIPPool(ctx context.Context, ref *corev1.TypedLocalObjectReference) (*ipamicv1.GlobalInClusterIPPool, error)
- func (h *Helper) GetIPAddress(ctx context.Context, key client.ObjectKey) (*ipamv1.IPAddress, error)
- func (h *Helper) GetIPPoolAnnotations(ctx context.Context, ipAddress *ipamv1.IPAddress) (map[string]string, error)
- func (h *Helper) GetInClusterIPPool(ctx context.Context, ref *corev1.TypedLocalObjectReference) (*ipamicv1.InClusterIPPool, error)
Constants ¶
This section is empty.
Variables ¶
var ErrMissingAddresses = errors.New("no valid ip addresses defined for the ip pool")
ErrMissingAddresses is returned when the cluster IPAM config does not contain any addresses.
Functions ¶
func InClusterPoolFormat ¶
func InClusterPoolFormat(cluster *infrav1.ProxmoxCluster, format string) string
InClusterPoolFormat returns the name of the `InClusterIPPool` for a given cluster.
Types ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper provides handling of ipam objects such as, InClusterPool, IPAddressClaim.
func NewHelper ¶
func NewHelper(c client.Client, infraCluster *infrav1.ProxmoxCluster) *Helper
NewHelper creates new Helper.
func (*Helper) CreateIPAddressClaim ¶
func (h *Helper) CreateIPAddressClaim(ctx context.Context, owner client.Object, device, format, clusterNameLabel string, ref *corev1.TypedLocalObjectReference) error
CreateIPAddressClaim creates an IPAddressClaim for a given object.
func (*Helper) CreateOrUpdateInClusterIPPool ¶
CreateOrUpdateInClusterIPPool creates or updates an `InClusterIPPool` which will be used by the `cluster-api-ipam-provider-in-cluster` to provide IP addresses for new nodes. We also need to create this resource to pre-allocate IP addresses which are already in use by Proxmox in order to avoid conflicts.
func (*Helper) GetDefaultInClusterIPPool ¶
func (h *Helper) GetDefaultInClusterIPPool(ctx context.Context, format string) (*ipamicv1.InClusterIPPool, error)
GetDefaultInClusterIPPool attempts to retrieve the `InClusterIPPool` which is managed by the cluster.
func (*Helper) GetGlobalInClusterIPPool ¶
func (h *Helper) GetGlobalInClusterIPPool(ctx context.Context, ref *corev1.TypedLocalObjectReference) (*ipamicv1.GlobalInClusterIPPool, error)
GetGlobalInClusterIPPool attempts to retrieve the referenced `GlobalInClusterIPPool`.
func (*Helper) GetIPAddress ¶
GetIPAddress attempts to retrieve the IPAddress.
func (*Helper) GetIPPoolAnnotations ¶ added in v0.5.0
func (h *Helper) GetIPPoolAnnotations(ctx context.Context, ipAddress *ipamv1.IPAddress) (map[string]string, error)
GetIPPoolAnnotations attempts to retrieve the annotations of an ippool from an ipaddress object.
func (*Helper) GetInClusterIPPool ¶
func (h *Helper) GetInClusterIPPool(ctx context.Context, ref *corev1.TypedLocalObjectReference) (*ipamicv1.InClusterIPPool, error)
GetInClusterIPPool attempts to retrieve the referenced `InClusterIPPool`.