Skip to content

Commit

Permalink
Merge pull request k8snetworkplumbingwg#317 from caribbeantiger/ipRec…
Browse files Browse the repository at this point in the history
…oncileCronConfig

Ip reconcile cron config via ENV
  • Loading branch information
maiqueb authored Apr 17, 2023
2 parents 6f2ec9f + f867815 commit e12772b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions doc/extended-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ You'll note that in the `ipam` section there's a lot less parameters than are us

You may want to provide a cron expression to configure how frequently the ip-reconciler runs. This is done via the flatfile.

Look for the following parameter `"reconciler_cron_expression"` located in `script/install-cni.sh` and change to your desired schedule.

You can speficy the `WHEREABOUTS_RECONCILER_CRON` environment variable in your daemonset definition file to override the default cron expression:
```yaml
env:
- name: WHEREABOUTS_RECONCILER_CRON
value: 30 * * * *
```
## Installing etcd. (optional)
etcd installation is optional. By default, we recommend the custom resource backend (given in the first example configuration).
Expand All @@ -156,4 +160,4 @@ kubectl get svc | grep "etcd-cluster-client"

This will give you the service name and the port to use, in this case you'll specify it in the configuration in a `service-name:port` format, the default port for etcd clients is `2379`.

*Note*: It's important to remember that CNI plugins (typically) run directly on the host and not inside pods. This means that if you use the DNS name (which might look something like `example-etcd-cluster-client.default.svc.cluster.local`) for the service (recommended) make sure that you can resolve those hostnames directly from your hosts. You may find some tips regarding that [here](https://blog.heptio.com/configuring-your-linux-host-to-resolve-a-local-kubernetes-clusters-service-urls-a8c7bdb212a7).
*Note*: It's important to remember that CNI plugins (typically) run directly on the host and not inside pods. This means that if you use the DNS name (which might look something like `example-etcd-cluster-client.default.svc.cluster.local`) for the service (recommended) make sure that you can resolve those hostnames directly from your hosts. You may find some tips regarding that [here](https://blog.heptio.com/configuring-your-linux-host-to-resolve-a-local-kubernetes-clusters-service-urls-a8c7bdb212a7).
3 changes: 2 additions & 1 deletion script/install-cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set -u -e
CNI_BIN_DIR=${CNI_BIN_DIR:-"/host/opt/cni/bin/"}
WHEREABOUTS_KUBECONFIG_FILE_HOST=${WHEREABOUTS_KUBECONFIG_FILE_HOST:-"/etc/cni/net.d/whereabouts.d/whereabouts.kubeconfig"}
CNI_CONF_DIR=${CNI_CONF_DIR:-"/host/etc/cni/net.d"}
WHEREABOUTS_RECONCILER_CRON=${WHEREABOUTS_RECONCILER_CRON:-30 4 * * *}

# Make a whereabouts.d directory (for our kubeconfig)

Expand Down Expand Up @@ -103,7 +104,7 @@ EOF
"kubernetes": {
"kubeconfig": "${WHEREABOUTS_KUBECONFIG_LITERAL}"
},
"reconciler_cron_expression": "30 4 * * *"
"reconciler_cron_expression": "${WHEREABOUTS_RECONCILER_CRON}"
}
EOF

Expand Down

0 comments on commit e12772b

Please sign in to comment.