Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Release v0.6.1 #1368

Merged
merged 5 commits into from
Feb 12, 2021
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
81 changes: 81 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)).
ipochi marked this conversation as resolved.
Show resolved Hide resolved

#### 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).
Expand Down
13 changes: 10 additions & 3 deletions docs/installer/lokoctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
49 changes: 49 additions & 0 deletions scripts/update/0.6.0-0.6.1/cluster.sh
Original file line number Diff line number Diff line change
@@ -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
81 changes: 81 additions & 0 deletions scripts/update/0.6.0-0.6.1/update.sh
Original file line number Diff line number Diff line change
@@ -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