Skip to content

Commit

Permalink
update release-1.18 with latest patch (#665)
Browse files Browse the repository at this point in the history
* update release-1.18 with latest patch
  • Loading branch information
briandowns authored Jan 15, 2021
1 parent 328b729 commit 44a0b3f
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ RUN echo ${CACHEBUST}>/dev/null
RUN CHART_VERSION="v3.13.3" CHART_FILE=/charts/rke2-canal.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.10.101" CHART_FILE=/charts/rke2-coredns.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.36.300" CHART_FILE=/charts/rke2-ingress-nginx.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="v1.18.13" CHART_FILE=/charts/rke2-kube-proxy.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v1.18.15" CHART_FILE=/charts/rke2-kube-proxy.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="2.11.100" CHART_FILE=/charts/rke2-metrics-server.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN rm -vf /charts/*.sh /charts/*.md

# rke-runtime image
# This image includes any host level programs that we might need. All binaries
# must be placed in bin/ of the file image and subdirectories of bin/ will be flattened during installation.
# This means bin/foo/bar will become bin/bar when rke2 installs this to the host
FROM rancher/k3s:v1.18.13-k3s1 AS k3s
FROM rancher/k3s:v1.18.15-k3s1 AS k3s
FROM rancher/hardened-containerd:v1.3.9-k3s1 AS containerd
FROM rancher/hardened-crictl:v1.18.0 AS crictl
FROM rancher/hardened-runc:v1.0.0-rc92 AS runc
Expand Down
2 changes: 1 addition & 1 deletion contrib/custom-image-kubelet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Installing
On an Ubuntu host:

```bash
curl -sfL https://get.rke2.io | INSTALL_RKE2_VERSION=v1.18.13+rke2r1 sh -
curl -sfL https://get.rke2.io | INSTALL_RKE2_VERSION=v1.18.15+rke2r1 sh -

sudo apt update
sudo apt install -y python3-venv python3-wheel python3-pip
Expand Down
91 changes: 84 additions & 7 deletions developer-docs/upgrading_kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,94 @@ From time to time we need to update the version of Kubernetes used by RKE2. This

### Container Image

Create a new release tag at https://github.com/rancher/image-build-kube-proxy
Create a new release tag at the [image-build-kube-proxy](https://github.com/rancher/image-build-kube-proxy) repo.

* Click "Releases"
* Click "Draft a new release"
* Enter the new release version (the new k8s version) into the "Tag version" box
* Click the "Publish release" button.

This will take a few minutes for CI to run but upon completion, a new image will be available in [Dockerhub](https://hub.docker.com/r/rancher/hardened-kube-proxy).

### Helm Chart

Create a new release asset for in the [rke2-charts](github.com/rancher/rke2-charts) repository. Instructions for doing so can be found in the repo. This is necessary as the RKE2 build process will check for that chart and source it into one of its build artifacts.
RKE2 depends on it's [Helm Charts](https://github.com/rancher/rke2-charts) being up-to-date with the expected versions for the Kubernetes components. The build process downloads these charts and bundles them into the runtime image.

Create a PR in [rke2-charts](https://github.com/rancher/rke2-charts) that updates the version of the `kube-proxy` image in both the `image.tag` field of `packages/rke2-kube-proxy/charts/values.yaml`, and also in `packages/rke2-kube-proxy/charts/Chart.yaml`. Upon getting 2 approvals and merging, CI will create the needed build artifact that RKE2 will use.

## Update RKE2

The following files have references that will need to be updated in the respective locations. Replace the found version with the desired version.
Since we're now working from a branch model for releases, we'll check out `release-1.18`. Run the commands below:

```bash
git checkout release-1.18
git checkout -b "update-k8s-v1.18.15"
```

The following files have references that will need to be updated in the respective locations. Replace the found version with the desired version. There are also references in documentation that should be updated and kept in sync.

* Dockerfile: `RUN CHART_VERSION="v1.18.15" CHART_FILE=/charts/rke2-kube-proxy.yaml`
* Dockerfile: `FROM rancher/k3s:v1.18.15-k3s1 AS k3s`
* images.go: `KubernetesVersion = "v1.18.15"`
* version.sh: `KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.18.15}`

Once these changes are made, submit a PR for review and let CI complete. When CI is finished and 2 approvals are had, merge the PR. CI will run for the master merge.

## RKE2 Release RC

Next, we need to create a release candidate (RC).

* Click "Releases"
* Click "Draft new release"
* Enter the desired version into the "Tag version" box.
* Example tag: `v1.18.15-rc1+rke2r1`

CI will run and build the release assets as well as kick off an image build for [RKE2 Upgrade images](https://hub.docker.com/r/rancher/rke2-upgrade/tags?page=1&ordering=last_updated).

### RKE2 Packaging

Along with creating a new RKE2 release, we need to trigger a new build of the associated RPM. These are found in the [rke2-packaging](https://github.com/rancher/rke2-packaging) repository. We need to create a new release here and the process is nearly identical to the above steps.

* Click "Releases"
* Click "Draft new release"
* Enter the desired version into the "Tag version" box.
* Example tag: `v1.18.15-rc1+rke2r1.testing.0`
* The first part of the tag here must match the tag created in the RKE2 repo.

When CI completes, let QA know so they can perform testing.

### Primary Release

Once QA signs off on the RC, it's time to cut the primary release. Go to the [rke2](https://github.com/rancher/rke2) repository.

* Click "Releases"
* Click "Draft new release"
* Enter the desired version into the "Tag version" box.
* Example tag: `v1.18.15+rke2r1`

Leave the release as "prerelease". This will be unchecked as soon as CI completes successfully.

Once complete, the process is repeated in the [rke2-packaging](https://github.com/rancher/rke2-packaging) repository.

* Click "Releases"
* Click "Draft new release"
* Enter the desired version into the "Tag version" box.
* Example tag: `v1.18.15+rke2r1.testing.0`
* The first part of the tag here must match the tag created in the RKE2 repo.

Make sure that CI passes. This is for RPM availability in the testing channel.

Once complete, perform the steps above again however this time, use the tag "latest" tag. E.g. `v1.18.15+rke2r1.latest.0`.

We choose "latest" here since we want to wait at least 24 hours in case the community finds an issue. Patches will need at least 24 hours. We'll then wait up to 7 days until marking the release as "stable".

### Updating Channel Server

After all of the builds are complete and QA has signed off on the release, we need to update the channel server. This is done by editing the `channels.yaml` file at the root of the [rke2](https://github.com/rancher/rke2) repository.

* Update the line: `latest: <release>` to be the recent release. e.g. `v1.18.15+rke2r1`.
* Verify updated in the JSON output from a call [here](https://update.rke2.io/).

### Promoting to Stable

* Dockerfile: `RUN CHART_VERSION="v1.18.13" CHART_FILE=/charts/rke2-kube-proxy.yaml`
* Dockerfile: `FROM rancher/k3s:v1.18.13-k3s1 AS k3s`
* images.go: `KubernetesVersion = "v1.18.13"`
* version.sh: `KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.18.13}`
After 24 hours, we'll promote the release to stable by updating the channel server's config as we did at above, however this time changing "latest" to "stable". We need to do the same thing for RPM's too. This involves the same steps for RPM releases but changing "latest" to "stable" in the release name. E.g. `v1.18.15+rke2r1.stable.0`.
4 changes: 2 additions & 2 deletions docs/upgrade/automated_upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
# force: true
upgrade:
image: rancher/rke2-upgrade
version: v1.18.13+rke2r1
version: v1.18.15+rke2r1
---
# Agent plan
apiVersion: upgrade.cattle.io/v1
Expand Down Expand Up @@ -85,7 +85,7 @@ spec:
force: true
upgrade:
image: rancher/rke2-upgrade
version: v1.18.13+rke2r1
version: v1.18.15+rke2r1
```

Expand Down
2 changes: 1 addition & 1 deletion pkg/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
)

var (
KubernetesVersion = "v1.18.13" // make sure this matches what is in the scripts/version.sh script
KubernetesVersion = "v1.18.15" // make sure this matches what is in the scripts/version.sh script
PauseVersion = "3.2" // make sure this matches what is in the scripts/build-images script
EtcdVersion = "v3.4.13-k3s1" // make sure this matches what is in the scripts/build-images script
RuntimeImageName = "rke2-runtime"
Expand Down
2 changes: 1 addition & 1 deletion scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ REVISION=$(git rev-parse HEAD)$(if ! git diff --no-ext-diff --quiet --exit-code;
PLATFORM=${GOOS}-${GOARCH}
RELEASE=${PROG}.${PLATFORM}
# hardcode k8s version unless its set specifically
KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.18.13}
KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.18.15}

if [ -d .git ]; then
if [ -z "$GIT_TAG" ]; then
Expand Down

0 comments on commit 44a0b3f

Please sign in to comment.