Documentation
Whereabouts Package ¶
This package provides the ability to assign IP addresses dynamically across your Kubernetes cluster using a CNI IPAM plugin named whereabouts.
Components ¶
- Whereabouts Custom Resources
- Whereabouts DaemonSet
- Whereabouts ServiceAccount
- Whereabouts ClusterRoleBinding
- Whereabouts ip-reconciler Cronjob
Configuration ¶
The following configuration values can be set to customize the whereabouts installation.
Global ¶
Value | Required/Optional | Description |
---|---|---|
namespace | Optional | The namespace in which to deploy whereabouts components. Default: kube-system |
whereabouts Configuration ¶
Value | Required/Optional | Description |
---|---|---|
whereabouts.config.resources.limits.cpu | Optional | The limits for CPU resources of whereabouts DeamonSet |
whereabouts.config.resources.limits.memory | Optional | The limits for memory resources of whereabouts DeamonSet |
whereabouts.config.resources.requests.cpu | Optional | The requests for CPU resources of whereabouts DeamonSet |
whereabouts.config.resources.requests.memory | Optional | The requests for memory resources of whereabouts DeamonSet |
ip_reconciler.config.schedule | Optional | The schedule of ip-reconciler CronJob. Default: */5 * * * * |
ip_reconciler.config.resources.requests.cpu | Optional | The requests for memory resources of ip-reconciler CronJob |
ip_reconciler.config.resources.requests.memory | Optional | The requests for memory resources of ip-reconciler CronJob |
Usage ¶
The follow is a basic guide for getting started with whereabouts.
This example guides you about attaching the second network interface to a pod with IP address assigned in the range you specified using whereabouts.
Install TCE Multus CNI package to support multiple network by following doc:
Install TCE whereabouts package through Tanzu CLI
tanzu package install whereabouts --package-name whereabouts.community.tanzu.vmware.com --version ${WHEREABOUTS_PACKAGE_VERSION}
You can get the
${WHEREABOUTS_PACKAGE_VERSION}
from runningtanzu package available list whereabouts.community.tanzu.vmware.com
. Specifying a namespace may be required depending on where your package repository was installed.After the Multus CNI and whereabouts DaemonSet are running, you can define your NetworkAttachmentDefinition to tell
- which CNI plugin will be used for the second network interface, in particular this example uses
ipvlan
CNI plugin - what IP addressed will be assigned for the second network interface, in particular this example uses
whereabouts
CNI IPAM plugin
cat <<EOF | kubectl create -f - apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: ipvlan-conf-1 spec: config: '{ "cniVersion": "0.3.0", "name": "ipvlan-conf-1", "type": "ipvlan", "master": "eth0", "mode": "bridge", "ipam": { "type": "whereabouts", "range": "192.168.20.0/24", "gateway": "192.168.20.1", "range_start": "192.168.20.2", "range_end": "192.168.20.100" } }' EOF
- which CNI plugin will be used for the second network interface, in particular this example uses
Deploy a pod using the NetworkAttachmentDefinition named
ipvlan-conf-1
as above by adding following lines to the podmetadata.annotations
:metadata: annotations: k8s.v1.cni.cncf.io/networks: ipvlan-conf-1
After the pod is running, run following command to describe your pod and there will be an event for adding the second network interface within IP range we specified with whereabouts.
kubectl describe {your-pod} ... ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal AddedInterface 2m1s multus Add eth0 [100.96.1.6/24] Normal AddedInterface 2m1s multus Add net1 [192.168.20.10/24] from default/ipvlan-conf-1
You can also run following command to check more details about the second network interface:
kubectl exec {your-pod} -- ip a