Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates README to enable nodeslice controller by default #566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ git clone https://github.com/k8snetworkplumbingwg/whereabouts && cd whereabouts
kubectl apply \
-f doc/crds/daemonset-install.yaml \
-f doc/crds/whereabouts.cni.cncf.io_ippools.yaml \
-f doc/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml
-f doc/crds/whereabouts.cni.cncf.io_nodeslicepools.yaml \
-f doc/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml \
-f doc/crds/node-slice-controller.yaml
```

The daemonset installation requires Kubernetes Version 1.16 or later.
Expand Down Expand Up @@ -211,8 +213,8 @@ spec:
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "192.168.2.0/24",
"node_slice_size": "/22"
"range": "203.0.113.0/20",
"node_slice_size": "/24"
}
}'
```
Expand Down
8 changes: 7 additions & 1 deletion doc/extended-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ You can compile from this repo (with `./hack/build-go.sh`) and copy the resultin

Not that we're also including a Custom Resource Definition (CRD) to use the `kubernetes` datastore option. This installs the kubernetes CRD specification for the `ippools.whereabouts.cni.k8s.io/v1alpha1` type.

### Example etcd datastore configuration
## Nodename for node slice controller.

The provided example `install-cni.sh` that's built into the image, along with the `daemonset-install.yaml` has a method by which the name of the node is retrieved from [the k8s downward API](https://kubernetes.io/docs/concepts/workloads/pods/downward-api/), and then written to a file named `nodename` in the whereabouts flatfile configuration directory.

This is to standardize the nodename from what's used in the API. You may adjust this to your environments, if you so please.

### Example etcd datastore configuration [DEPRECATED]

If you'll use the etcd datastore option, you'll likely want to install etcd first. Etcd installation suggestions follow below.

Expand Down
4 changes: 4 additions & 0 deletions script/install-cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ WHEREABOUTS_KUBECONFIG=$CNI_CONF_DIR/whereabouts.d/whereabouts.kubeconfig
WHEREABOUTS_CONF_FILE=$CNI_CONF_DIR/whereabouts.d/whereabouts.conf
WHEREABOUTS_KUBECONFIG_LITERAL=$(echo "$WHEREABOUTS_KUBECONFIG" | sed -e s'|/host||')

# Write the nodename to the whereabouts.d directory for standardized hostname from the downward API.
# Sometimes you can't rely on the hostname matching the nodename in the k8s API.
echo $NODENAME > $CNI_CONF_DIR/whereabouts.d/nodename

# ------------------------------- Generate a "kube-config"
SERVICE_ACCOUNT_PATH=/var/run/secrets/kubernetes.io/serviceaccount
KUBE_CA_FILE=${KUBE_CA_FILE:-$SERVICE_ACCOUNT_PATH/ca.crt}
Expand Down
Loading