diff --git a/CHANGELOG.md b/CHANGELOG.md index 44eff9a59..4472208e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,84 @@ +## v0.6.1 - 2021-02-12 + +This is a patch release which includes mainly bug fixes. + +> **NOTE**: Please read the updating guidelines [here](https://github.com/kinvolk/lokomotive/blob/v0.6.1/CHANGELOG.md#updating-from-v060). + +### Changes in v0.6.1 + +#### Development + +- Velero: Add tolerations to Restic plugin ([#1348](https://github.com/kinvolk/lokomotive/pull/1348)). +- Velero: Add e2e tests ([#1353](https://github.com/kinvolk/lokomotive/pull/1353)). +- Update all Go dependencies ([#1358](https://github.com/kinvolk/lokomotive/pull/1358)). + +#### Terraform Provider Updates +- Update Packet (Equinux Metal) Terraform provider to 3.2.1 that fixes the provisioning failures of + `n2.xlarge.x86` machines ([#1349](https://github.com/kinvolk/lokomotive/pull/1349)). + +#### Bug fixes + +- Prefix `ETCD_` for standard etcd environment variables only ([#1308](https://github.com/kinvolk/lokomotive/pull/1308)). +- Update Restic TolerationSeconds type to integer and add conditional checks ([#1365](https://github.com/kinvolk/lokomotive/pull/1365)). + +#### Docs +- Add missing `provider` parameter ([#1354](https://github.com/kinvolk/lokomotive/pull/1354)). +- Update RELEASING document to add steps to update the documentation website entry ([#1326](https://github.com/kinvolk/lokomotive/pull/1326)). +- Improvements to the Lokomotive release process documentation ([#1341](https://github.com/kinvolk/lokomotive/pull/1341)). + +### Updating from v0.6.0 + +#### Cluster update steps + +> **NOTE:** Updating multiple Lokomotive versions at a time is not supported. If your cluster is running a +> version older than `v0.6.0`, update to `v0.6.0` first and only then proceed with the update to `v0.6.1`. + +Please perform the following manual steps in your cluster configuration directory. + +1. Download and install the lokoctl binary by following the [v0.6.1 installation + guide](https://github.com/kinvolk/lokomotive/blob/v0.6.1/docs/installer/lokoctl.md). + + ```bash + lokoctl version + v0.6.1 + ``` + +2. Update control plane. + + ```bash + lokoctl cluster apply --skip-components -v + ``` + + > **NOTE:** If the update process gets interrupted, rerun above command. + + The update process typically takes about 10 minutes. + After the update, running `lokoctl health` should result in an output similar to the following: + + ```bash + Node Ready Reason Message + + lokomotive-controller-0 True KubeletReady kubelet is posting ready status + lokomotive-1-worker-0 True KubeletReady kubelet is posting ready status + lokomotive-1-worker-1 True KubeletReady kubelet is posting ready status + lokomotive-1-worker-2 True KubeletReady kubelet is posting ready status + Name Status Message Error + + etcd-0 True {"health":"true"} + ``` + +3. Download the release bundle. + + ```bash + curl -LO https://github.com/kinvolk/lokomotive/archive/v0.6.1.tar.gz + tar -xvzf v0.6.1.tar.gz + ``` + +4. Run update script + + ```bash + ./lokomotive-0.6.1/scripts/update/0.6.0-0.6.1/update.sh + ``` + ## v0.6.0 - 2021-01-22 We're happy to announce the release of Lokomotive v0.6.0 (Flying Scotsman). diff --git a/docs/installer/lokoctl.md b/docs/installer/lokoctl.md index 8294a2326..b847f2e94 100644 --- a/docs/installer/lokoctl.md +++ b/docs/installer/lokoctl.md @@ -20,19 +20,26 @@ These binaries can be manually downloaded and installed. keys](https://github.com/kinvolk/lokomotive/blob/master/docs/KEYS.md). ```console -gpg --verify lokoctl_0.5.0_linux_amd64.tar.gz.sig +gpg --verify lokoctl_0.6.1_linux_amd64.tar.gz.sig ``` 3. Unpack it ```console -tar xvf lokoctl_0.5.0_linux_amd64.tar.gz +tar xvf lokoctl_0.6.1_linux_amd64.tar.gz ``` 4. Find the lokoctl binary in the unpacked directory and move it to its desired location ```console -mv lokoctl_0.5.0_linux_amd64/lokoctl ~/.local/bin/lokoctl +mv lokoctl_0.6.1_linux_amd64/lokoctl ~/.local/bin/lokoctl +``` + +5. Verify the version of `lokoctl` + +```console +lokoctl version +v0.6.1 ``` ### Using 'go get' diff --git a/pkg/version/version.go b/pkg/version/version.go index cae22605d..0c4d27b91 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -15,4 +15,4 @@ package version // This variable is used by the "version" command and is set during build. -var Version = "0.6.0+git" +var Version = "0.6.1+git" diff --git a/scripts/update/0.6.0-0.6.1/cluster.sh b/scripts/update/0.6.0-0.6.1/cluster.sh new file mode 100644 index 000000000..f9979994c --- /dev/null +++ b/scripts/update/0.6.0-0.6.1/cluster.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -euo pipefail + +mode="${1}" + +function run_on_host() { + nsenter -a -t 1 /bin/sh -c "${1}" +} + +function update_etcd() { + if [ "${mode}" != "controller" ]; then + echo "Nothing to do. Not a controller node." + return + fi + + rkt_etcd_cfg="/etc/systemd/system/etcd-member.service.d/40-etcd-cluster.conf" + docker_etcd_cfg="/etc/kubernetes/etcd.env" + docker_etcd_svc="/etc/systemd/system/etcd.service" + + if [ -f "${rkt_etcd_cfg}" ]; then + echo "Nothing to do. Rkt based etcd node." + return + fi + + if grep "^IMAGE_TAG" "${docker_etcd_cfg}" >/dev/null; then + echo "etcd env var file ${docker_etcd_cfg} is already updated." + return + fi + + echo -e "\nUpdating etcd file...\nOld etcd config file:\n" + cat "${docker_etcd_cfg}" + sed 's|ETCD_IMAGE_TAG|IMAGE_TAG|g; s|ETCD_IMAGE_URL|IMAGE_URL|g; s|ETCD_SSL_DIR|SSL_DIR|g; s|ETCD_USER|USER|g' ${docker_etcd_cfg} >/tmp/etcd.env + cat /tmp/etcd.env >"${docker_etcd_cfg}" + echo -e "\nNew etcd config file:\n" + cat "${docker_etcd_cfg}" + + echo -e "\nOld etcd service file:\n" + cat "${docker_etcd_svc}" + sed 's|ETCD_IMAGE_TAG|IMAGE_TAG|g; s|ETCD_IMAGE_URL|IMAGE_URL|g; s|ETCD_SSL_DIR|SSL_DIR|g; s|ETCD_USER|USER|g' ${docker_etcd_svc} >/tmp/etcd.service + cat /tmp/etcd.service >"${docker_etcd_svc}" + echo -e "\nNew etcd service file:\n" + cat "${docker_etcd_svc}" + + echo -e "\nRestarting etcd...\n" + run_on_host "systemctl daemon-reload && systemctl is-active etcd && systemctl restart etcd && systemctl status --no-pager etcd" +} + +update_etcd diff --git a/scripts/update/0.6.0-0.6.1/update.sh b/scripts/update/0.6.0-0.6.1/update.sh new file mode 100755 index 000000000..94ed92ee4 --- /dev/null +++ b/scripts/update/0.6.0-0.6.1/update.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +set -euo pipefail + +readonly script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) +readonly namespace="update-host-files" + +kubectl create ns "${namespace}" --dry-run=client -o yaml | kubectl apply -f - +kubectl label ns "${namespace}" "lokomotive.kinvolk.io/name=${namespace}" +kubectl create -n "${namespace}" cm script --from-file "${script_dir}"/cluster.sh --dry-run=client -o yaml | kubectl apply -f - + +function update_node_files() { + nodename=$1 + mode=$2 + + podname="uhf-$nodename-$RANDOM" + + echo " +apiVersion: v1 +kind: Pod +metadata: + labels: + run: ${podname} + name: ${podname} + namespace: ${namespace} +spec: + containers: + - image: registry.fedoraproject.org/fedora:32 + name: update-host-files + imagePullPolicy: IfNotPresent + securityContext: + privileged: true + args: + - sh + - -c + - bash /tmp/script/cluster.sh ${mode} + volumeMounts: + - name: etc-kubernetes + mountPath: /etc/kubernetes/ + - name: script + mountPath: /tmp/script/ + - name: rkt-etcd + mountPath: /etc/systemd/system/etcd-member.service.d/ + - name: etcd-service + mountPath: /etc/systemd/system/etcd.service + nodeName: ${nodename} + restartPolicy: Never + hostPID: true + serviceAccountName: default + volumes: + - name: etc-kubernetes + hostPath: + path: /etc/kubernetes/ + - name: etcd-service + hostPath: + path: /etc/systemd/system/etcd.service + - name: script + configMap: + name: script + - name: rkt-etcd + hostPath: + path: /etc/systemd/system/etcd-member.service.d/ +" | kubectl apply -f - + + echo -e "\n\nLogs: ${podname}\n\n" + + # Wait until pod exits. Show logs to the user. + while ! kubectl -n "${namespace}" logs -f "${podname}" 2>/dev/null; do + sleep 1 + done + + echo '-------------------------------------------------------------------------------------------' +} + +function update_controller_nodes() { + for nodename in $(kubectl get nodes -l node.kubernetes.io/master -ojsonpath='{.items[*].metadata.name}'); do + update_node_files "${nodename}" "controller" + done +} + +update_controller_nodes