From f80b2f4e0bb128cb447cbe9757ee77f459f7aac4 Mon Sep 17 00:00:00 2001 From: JMC <37458935+caribbeantiger@users.noreply.github.com> Date: Fri, 31 Mar 2023 14:29:57 -0400 Subject: [PATCH 1/3] implement env variable WHEREABOUTS_RECONCILER_CRON use env variable WHEREABOUTS_RECONCILER_CRON to configure the ip reconciler cron expression , if not provided leave default Update extended-configuration.md align with rest of script implement env variable WHEREABOUTS_RECONCILER_CRON use env variable WHEREABOUTS_RECONCILER_CRON to configure the ip reconciler cron expression , if not provided leave default --- doc/extended-configuration.md | 10 +++++++++- script/install-cni.sh | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/extended-configuration.md b/doc/extended-configuration.md index 06d1d28e5..0cd52d785 100644 --- a/doc/extended-configuration.md +++ b/doc/extended-configuration.md @@ -140,6 +140,14 @@ You may want to provide a cron expression to configure how frequently the ip-rec Look for the following parameter `"reconciler_cron_expression"` located in `script/install-cni.sh` and change to your desired schedule. +alternatively you can speficy the `WHEREABOUTS_RECONCILER_CRON` environment variable in your daemonset definition file to provide the cron expresion. + +``` + 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). @@ -156,4 +164,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). \ No newline at end of file +*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). diff --git a/script/install-cni.sh b/script/install-cni.sh index 6eab0ff56..9eb2977df 100755 --- a/script/install-cni.sh +++ b/script/install-cni.sh @@ -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) @@ -103,7 +104,7 @@ EOF "kubernetes": { "kubeconfig": "${WHEREABOUTS_KUBECONFIG_LITERAL}" }, - "reconciler_cron_expression": "30 4 * * *" + "reconciler_cron_expression": "${WHEREABOUTS_RECONCILER_CRON}" } EOF From 63f69c0795b16550c9df8c21214c049524e63577 Mon Sep 17 00:00:00 2001 From: JMC <37458935+caribbeantiger@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:04:35 -0400 Subject: [PATCH 2/3] Update doc/extended-configuration.md Co-authored-by: Miguel Duarte Barroso --- doc/extended-configuration.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/extended-configuration.md b/doc/extended-configuration.md index 0cd52d785..6df1b1e67 100644 --- a/doc/extended-configuration.md +++ b/doc/extended-configuration.md @@ -138,15 +138,11 @@ 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. - -alternatively you can speficy the `WHEREABOUTS_RECONCILER_CRON` environment variable in your daemonset definition file to provide the cron expresion. - -``` +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) From f867815d6efaf9eeb9752b43329ec57099e7e308 Mon Sep 17 00:00:00 2001 From: JMC <37458935+caribbeantiger@users.noreply.github.com> Date: Tue, 4 Apr 2023 08:56:28 -0400 Subject: [PATCH 3/3] Update extended-configuration.md --- doc/extended-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/extended-configuration.md b/doc/extended-configuration.md index 6df1b1e67..c42b86e2b 100644 --- a/doc/extended-configuration.md +++ b/doc/extended-configuration.md @@ -143,7 +143,7 @@ You can speficy the `WHEREABOUTS_RECONCILER_CRON` environment variable in your d 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).