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

config: added a migration step to filter interfaces #365

Merged
merged 1 commit into from
May 15, 2024
Merged
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
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:
Comment on lines +755 to +758
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these depend on an updated kubespray submodule?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does.

This config is a feature in an upcoming kubespray release 2.25. See here

- 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
Loading