Skip to content

Commit

Permalink
ignition improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Aug 6, 2024
1 parent 1f40d84 commit d68a527
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 17 deletions.
5 changes: 4 additions & 1 deletion packaging/flavorgen/flavors/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ systemd:
After=containerd.service
[Service]
# Make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*`
EnvironmentFile=/run/metadata/*
# Log to file
StandardOutput=append:/var/log/kubeadm-service.log
StandardError=inherit`
)

func newClusterTopologyCluster(supervisorMode bool) (clusterv1.Cluster, error) {
Expand Down
6 changes: 6 additions & 0 deletions templates/cluster-template-ignition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ spec:
[Service]
# Make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
# Log to file
StandardOutput=append:/var/log/kubeadm-service.log
StandardError=inherit
initConfiguration:
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
Expand Down Expand Up @@ -361,6 +364,9 @@ spec:
[Service]
# Make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
# Log to file
StandardOutput=append:/var/log/kubeadm-service.log
StandardError=inherit
joinConfiguration:
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -55,7 +65,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -87,7 +97,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -58,7 +68,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -90,7 +100,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -61,7 +71,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -93,7 +103,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down Expand Up @@ -136,6 +146,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -181,7 +201,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -213,7 +233,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -55,7 +65,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -87,7 +97,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -58,7 +68,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -90,7 +100,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -61,7 +71,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -93,7 +103,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down Expand Up @@ -136,6 +146,16 @@
set -o nounset
set -o pipefail
set -o errexit
DISTRO="ubuntu"
KUBE_BINARY_DIR="/usr/bin"
source /etc/lsb-release
if [[ "$${DISTRIB_ID}" == *Flatcar* ]]; then
# Overrides for flatcar
DISTRO="flatcar"
KUBE_BINARY_DIR="/opt/bin"
fi
function retry {
attempt=0
Expand Down Expand Up @@ -181,7 +201,7 @@
CONTAINER_EXT="tar"
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$${DISTRO}" == "ubuntu" ]] && [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -213,7 +233,7 @@
echo "* downloading binary: $${CI_URL}/$${CI_PACKAGE}"
wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE}"
chmod +x "$${CI_DIR}/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "/usr/bin/$${CI_PACKAGE}"
mv "$${CI_DIR}/$${CI_PACKAGE}" "$${KUBE_BINARY_DIR}/$${CI_PACKAGE}"
done
systemctl restart kubelet
fi
Expand Down
2 changes: 2 additions & 0 deletions test/framework/log/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func (c *MachineLogCollector) CollectMachineLog(ctx context.Context, _ client.Cl
"sudo", "cat", "/var/log/cloud-init.log"),
captureLogs("cloud-init-output.log",
"sudo", "cat", "/var/log/cloud-init-output.log"),
captureLogs("kubeadm-service.log",
"sudo", "cat", "/var/log/kubeadm-service.log"),
)
}

Expand Down

0 comments on commit d68a527

Please sign in to comment.