Skip to content

Commit

Permalink
config: added a migration step to filter interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavan-Gunda committed May 15, 2024
1 parent 47f819d commit e2e0db2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/common/group_vars/k8s_cluster/ck8s-k8s-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -751,3 +751,10 @@ local_volume_provisioner_storage_classes: # Installation via kubespray has no su

local_volume_provisioner_nodelabels: []
local_volume_provisioner_tolerations: []

ntp_filter_interface: true
# Specify the interfaces
# Only takes effect when ntp_filter_interface is true
ntp_interfaces:
- ignore wildcard
- listen ens3
3 changes: 3 additions & 0 deletions migration/v2.25/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
> bin/ck8s-kubespray upgrade wc v2.25 prepare
> ```

> [!NOTE]
> The prepare step ran earlier will set the `ntp_filter_interface` to `true` and the default interface ntp listens on is `ens3` but if the underlying host uses a different interface, add that instead of ens3 under `ntp_interfaces`

1. Download the required files on the nodes

```bash
Expand Down
16 changes: 16 additions & 0 deletions migration/v2.25/prepare/30-ntp-filter-interfaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

HERE="$(dirname "$(readlink -f "${0}")")"
ROOT="$(readlink -f "${HERE}/../../../")"

# shellcheck source=scripts/migration/lib.sh
source "${ROOT}/scripts/migration/lib.sh"

if [[ "${CK8S_CLUSTER}" =~ ^(sc|both)$ ]]; then
yq_add sc k8s_cluster/ck8s-k8s-cluster .ntp_filter_interface "load(\"${ROOT}/config/common/group_vars/k8s_cluster/ck8s-k8s-cluster.yaml\").ntp_filter_interface"
yq_add sc k8s_cluster/ck8s-k8s-cluster .ntp_interfaces "load(\"${ROOT}/config/common/group_vars/k8s_cluster/ck8s-k8s-cluster.yaml\").ntp_interfaces"
fi
if [[ "${CK8S_CLUSTER}" =~ ^(wc|both)$ ]]; then
yq_add wc k8s_cluster/ck8s-k8s-cluster .ntp_filter_interface "load(\"${ROOT}/config/common/group_vars/k8s_cluster/ck8s-k8s-cluster.yaml\").ntp_filter_interface"
yq_add wc k8s_cluster/ck8s-k8s-cluster .ntp_interfaces "load(\"${ROOT}/config/common/group_vars/k8s_cluster/ck8s-k8s-cluster.yaml\").ntp_interfaces"
fi

0 comments on commit e2e0db2

Please sign in to comment.