Coder Social home page Coder Social logo

k3s-upgrade's Introduction

k3s-upgrade

k3s-upgrade is an image that is responsible of upgrading k3s version via the System Upgrade Controller, it does that by doing the following:

  • Replace the k3s binary with the new version
  • Kill the old k3s process allowing the supervisor to restart k3s with the new version

Build

To build the k3s-upgrade image locally, you can run the following:

export ARCH=amd64 TAG=v1.17.2+k3s1
docker build --build-arg ARCH --build-arg TAG --tag ${REPO:=rancher}/k3s-upgrade:${TAG/+/-} .

Usage

Prerequisites

  • K3s has to be installed using the install script using the curl command:
curl -sfL https://get.k3s.io | sh -

Example

1- To use the image with the system-upgrade-controller, you have first to run the controller either directly or deploy it on the k3s cluster:

kubectl apply -f https://raw.githubusercontent.com/rancher/system-upgrade-controller/master/manifests/system-upgrade-controller.yaml

You should see the upgrade controller starting in system-upgrade namespace.

2- Label the nodes you want to upgrade with the right label:

kubectl label node <node-name> k3s-upgrade=true

3- Run the upgrade plan in the k3s cluster

---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
  name: k3s-latest
  namespace: system-upgrade
spec:
  concurrency: 1
  version: v1.17.2-k3s1
  nodeSelector:
    matchExpressions:
      - {key: k3s-upgrade, operator: Exists}
  serviceAccountName: system-upgrade
  drain:
    force: true
  upgrade:
    image: rancher/k3s-upgrade

The upgrade controller should watch for this plan and execute the upgrade on the labeled nodes. For more information about system-upgrade-controller and plan options please visit system-upgrade-controller official repo.

Contact

For bugs, questions, comments, corrections, suggestions, etc., open an issue in k3s-io/k3s with a title starting with [k3s-upgrade] .

k3s-upgrade's People

Contributors

briandowns avatar davidnuzik avatar dweomer avatar erikwilson avatar galal-hussein avatar monzelmasry avatar tobru avatar zdzichu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.