Code Monkey home page Code Monkey logo

cluster-api-upgrade-tool's Introduction

cluster-api-upgrade-tool

WARNING

This tool is a work in progress. It may have bugs. DO NOT use it on a production Kubernetes cluster or any cluster you can't live without.

To date, we have only tested this with Cluster API Provider for AWS (CAPA)

Overview

This is a standalone tool to orchestrate upgrading Kubernetes clusters created by Cluster API v0.1.x / API version v1alpha1.

Our goal is to ultimately add this upgrade logic to Cluster API itself, but given that v1alpha1 doesn't easily lend itself to handling upgrades of control plane machines, we decided to build a temporarily tool that can fill that gap. Once Cluster API supports full lifecycle management of both control planes and worker nodes, we plan to deprecate this tool.

Try it out

Build: Run make bin from the root directory of this project.

Run bin/cluster-api-upgrade-tool against an existing cluster.

The following examples assume you have $KUBECONFIG set.

Control plane upgrade

./bin/cluster-api-upgrade-tool \
  --cluster-namespace <Target cluster namespace> \
  --cluster-name <Target cluster name> \
  --kubernetes-version <Desired kubernetes version> \
  --scope control-plane

Worker upgrade - all MachineDeployments

./bin/cluster-api-upgrade-tool \
  --cluster-namespace <Target cluster namespace> \
  --cluster-name <Target cluster name> \
  --kubernetes-version <Desired kubernetes version> \
  --scope machine-deployment

Worker upgrade - single MachineDeployment, by name

./bin/cluster-api-upgrade-tool \
  --cluster-namespace <Target cluster namespace> \
  --cluster-name <Target cluster name> \
  --kubernetes-version <Desired kubernetes version> \
  --scope machine-deployment \
  --machine-deployment-name <Desired MachineDeployment name>

Worker upgrade - multiple MachineDeployments, by label selector

./bin/cluster-api-upgrade-tool \
  --cluster-namespace <Target cluster namespace> \
  --cluster-name <Target cluster name> \
  --kubernetes-version <Desired kubernetes version> \
  --scope machine-deployment \
  --machine-deployment-selector <Desired MachineDeployment label selector>

Prerequisites

  • Cluster created using Cluster API v0.2.x / API version v1alpha2
  • Nodes bootstrapped with kubeadm
  • Control plane Machine resources have the following labels:
    • cluster.k8s.io/cluster-name=<cluster name>
    • cluster.x-k8s.io/control-plane=true
  • Control plane is comprised of individual Machines
  • Worker nodes are from MachineDeployments

Documentation

Usage

Usage:
  ./bin/cluster-api-upgrade-tool [flags]

Flags:
      --cluster-name string                  The name of target cluster (required)
      --cluster-namespace string             The namespace of target cluster (required)
  -h, --help                                 help for ./bin/cluster-api-upgrade-tool
      --image-field string                   The image identifier field in provider manifests (optional)
      --image-id string                      The provider-specific image identifier to use when booting a machine (optional)
      --kubeconfig string                    The kubeconfig path for the management cluster
      --kubernetes-version string            Desired kubernetes version to upgrade to (required)
      --machine-deployment-name string       Name of a single machine deployment to upgrade
      --machine-deployment-selector string   Label selector used to find machine deployments to upgrade
      --scope string                         Scope of upgrade - [control-plane | machine-deployment] (required)
      --upgrade-id string                    Unique identifier used to resume a partial upgrade (optional)

Contributing

The cluster-api-upgrade-tool project team welcomes contributions from the community. If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will update the issue when you open a Pull Request. For any questions about the CLA process, please refer to our FAQ.

License

Apache 2.0

cluster-api-upgrade-tool's People

Contributors

ajwdev avatar chuckha avatar detiber avatar liztio avatar ncdc avatar noamran avatar phenixblue avatar vincepri avatar vmwsrpbot avatar xiangfeiz avatar

Stargazers

 avatar

Watchers

 avatar  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.