Kubipam is a Kubernetes controller that manage network IPs and CIDRs for you. It works with 2 custom resources:
- IPCidr
- IPClaim
IPCidr allows you to create a specific CIDR in the IPAM (IPv4 and IPv6). IPClaim is used to allocate/claim specific or non-specific IPs and child CIDRs in the IPAM.
You’ll need a Kubernetes cluster to run against. You can use KIND to get a local cluster for testing, or run against a remote cluster.
- Install the controller and CRDs:
kubectl apply -f deploy/bundle.yaml
Example definition to create a CIDR in the IPAM:
apiVersion: ipam.didactiklabs.io/v1alpha1
kind: IPCidr
metadata:
name: test
spec:
cidr: 172.16.0.0/16
it works as well in IPv6
Here you can find an example to claim a specific IP address:
apiVersion: ipam.didactiklabs.io/v1alpha1
kind: IPClaim
metadata:
name: my-specific-ip
spec:
type: IP
ipCidrRef:
name: mycidr
specificIPAddress: 172.16.0.1
apiVersion: ipam.didactiklabs.io/v1alpha1
kind: IPClaim
metadata:
name: my-specific-childcidr
spec:
type: CIDR
ipCidrRef:
name: mycidr
specificChildCidr: 172.16.1.0/24
Here you can find an example to claim the next free IP address:
apiVersion: ipam.didactiklabs.io/v1alpha1
kind: IPClaim
metadata:
name: my-ip
spec:
type: IP
ipCidrRef:
name: mycidr
When you claim a child CIDR, you must set the 'length'. You can set the 'ipCidrRef' field and the name of a IPCidr resource if you want to claim the child CIDR from a selected parent, if not set, the controller will claim a child cidr in a parent cidr that has available addresses. Here you can find the example:
apiVersion: ipam.didactiklabs.io/v1alpha1
kind: IPClaim
metadata:
name: my-cidr
spec:
type: CIDR
cidrPrefixLength: 24
or (specific parent)
apiVersion: ipam.didactiklabs.io/v1alpha1
kind: IPClaim
metadata:
name: my-cidr
spec:
type: CIDR
cidrPrefixLength: 24
ipCidrRef:
name: mycidr
Before uninstalling, make sure you do not have any custom resources (IPCidr and IPclaim) applied in your cluster ! To delete the controller and the CRDs from your cluster!
kubectl delete -f deploy/bundle.yaml
If you think you have found a bug please follow the instructions below.
- Open a new issue.
- Please, write a clear title and describe your bug in the description field.
- Get the logs from the controller or resources status and paste it into your issue.
Run:
nix-build -E 'with import <nixpkgs> {}; callPackage ./nix/binaries.nix {}'
Run:
nix-build -E 'with import <nixpkgs> {}; callPackage ./nix/oci.nix {}'