-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
406 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package files exposes embedded files as strings. | ||
package files | ||
|
||
import _ "embed" | ||
|
||
// KubeVIPPrepare contains the kube-vip-prepare.sh script | ||
Check failure on line 22 in packaging/flavorgen/flavors/files/embed.go GitHub Actions / lint
|
||
// | ||
//go:embed kube-vip-prepare.sh | ||
var KubeVipPrepare string | ||
|
||
// KubeVIPCleanup contains the kube-vip-cleanup.sh script | ||
Check failure on line 27 in packaging/flavorgen/flavors/files/embed.go GitHub Actions / lint
|
||
// | ||
//go:embed kube-vip-cleanup.sh | ||
var KubeVipCleanup string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Reset the workaround required for kubeadm init with kube-vip: | ||
# xref: https://github.com/kube-vip/kube-vip/issues/684 | ||
|
||
sed -i 's#path: /etc/kubernetes/super-admin.conf#path: /etc/kubernetes/admin.conf#' \ | ||
/etc/kubernetes/manifests/kube-vip.yaml || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Configure the workaround required for kubeadm init with kube-vip: | ||
# xref: https://github.com/kube-vip/kube-vip/issues/684 | ||
|
||
# Nothing to do for kubernetes < v1.29 | ||
KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" | ||
if [[ "${KUBEADM_MINOR}" -lt "29" ]]; then | ||
return | ||
fi | ||
|
||
IS_KUBEADM_INIT="false" | ||
|
||
# cloud-init kubeadm init | ||
if [[ -f /run/kubeadm/kubeadm.yaml ]]; then | ||
IS_KUBEADM_INIT="true" | ||
fi | ||
|
||
# ignition kubeadm init | ||
if [[ -f /etc/kubeadm.sh ]] && grep -q -e "kubeadm init" /etc/kubeadm.sh; then | ||
IS_KUBEADM_INIT="true" | ||
fi | ||
|
||
if [[ "$IS_KUBEADM_INIT" == "true" ]]; then | ||
sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' \ | ||
/etc/kubernetes/manifests/kube-vip.yaml | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.