sigs.k8s.io/cluster-api@v1.7.1/docs/book/src/clusterctl/commands/upgrade.md (about)

     1  # clusterctl upgrade
     2  
     3  The `clusterctl upgrade` command can be used to upgrade the version of the Cluster API providers (CRDs, controllers)
     4  installed into a management cluster.
     5  
     6  # upgrade plan
     7  
     8  The `clusterctl upgrade plan` command can be used to identify possible targets for upgrades.
     9  
    10  ```bash
    11  clusterctl upgrade plan
    12  ```
    13  
    14  Produces an output similar to this:
    15  
    16  ```bash
    17  Checking cert-manager version...
    18  Cert-Manager will be upgraded from "v1.5.0" to "v1.5.3"
    19  
    20  Checking new release availability...
    21  
    22  Management group: capi-system/cluster-api, latest release available for the v1beta1 API Version of Cluster API (contract):
    23  
    24  NAME                    NAMESPACE                           TYPE                     CURRENT VERSION   NEXT VERSION
    25  bootstrap-kubeadm       capi-kubeadm-bootstrap-system       BootstrapProvider        v0.4.0           v1.0.0
    26  control-plane-kubeadm   capi-kubeadm-control-plane-system   ControlPlaneProvider     v0.4.0           v1.0.0
    27  cluster-api             capi-system                         CoreProvider             v0.4.0           v1.0.0
    28  infrastructure-docker   capd-system                         InfrastructureProvider   v0.4.0           v1.0.0
    29  ```
    30  
    31  You can now apply the upgrade by executing the following command:
    32  
    33  ```bash
    34     clusterctl upgrade apply --contract v1beta1
    35  ```
    36  
    37  The output contains the latest release available for each API Version of Cluster API (contract)
    38  available at the moment.
    39  
    40  <aside class="note">
    41  
    42  <h1> Pre-release provider versions </h1>
    43  
    44  `clusterctl upgrade plan` does not display pre-release versions by default. For
    45  example, if a provider has releases `v0.7.0-alpha.0` and `v0.6.6` available, the latest
    46  release available for upgrade will be `v0.6.6`.
    47  
    48  </aside>
    49  
    50  # upgrade apply
    51  
    52  After choosing the desired option for the upgrade, you can run the following
    53  command to upgrade all the providers in the management cluster. This upgrades
    54  all the providers to the latest stable releases.
    55  
    56  ```bash
    57  clusterctl upgrade apply --contract v1beta1
    58  ```
    59  
    60  The upgrade process is composed by three steps:
    61  
    62  * Check the cert-manager version, and if necessary, upgrade it.
    63  * Delete the current version of the provider components, while preserving the namespace where the provider components
    64    are hosted and the provider's CRDs.
    65  * Install the new version of the provider components.
    66  
    67  Please note that clusterctl does not upgrade Cluster API objects (Clusters, MachineDeployments, Machine etc.); upgrading
    68  such objects are the responsibility of the provider's controllers.
    69  
    70  It is also possible to explicitly upgrade one or more components to specific versions.
    71  
    72  ```bash
    73  clusterctl upgrade apply \
    74      --core cluster-api:v1.2.4 \
    75      --infrastructure docker:v1.2.4
    76  ```
    77  
    78  <aside class="note warning">
    79  
    80  <h1>Clusterctl upgrade test coverage</h1>
    81  
    82  Cluster API only tests a subset of possible clusterctl upgrade paths as otherwise the test matrix would be overwhelming.
    83  Untested upgrade paths are not blocked by clusterctl and should work in general, they are just not tested. Users
    84  intending to use an upgrade path not tested by us should do their own validation to ensure the operation works correctly.
    85  
    86  The following is an example of the tested upgrade paths for v1.5:
    87  
    88  | From | To   | Note                                                 |
    89  |------|------|------------------------------------------------------|
    90  | v1.0 | v1.5 | v1.0 is the first release with the v1beta1 contract. |
    91  | v1.3 | v1.5 | v1.3 is v1.5 - 2.                                    |
    92  | v1.4 | v1.5 | v1.4 is v1.5 - 1.                                    |
    93  
    94  The idea is to always test upgrade from v1.0 and the previous two minor releases.
    95  
    96  </aside>
    97  
    98  <aside class="note warning">
    99  
   100  <h1>Warning!</h1>
   101  
   102  The current implementation of the upgrade process does not preserve controllers flags that are not set through the
   103  components YAML/at the installation time.
   104  
   105  User is required to re-apply flag values after the upgrade completes.
   106  
   107  </aside>
   108  
   109  <aside class="note warning">
   110  
   111  <h1> Upgrading to pre-release provider versions </h1>
   112  
   113  In order to upgrade to a provider's pre-release version, we can do
   114  the following:
   115  
   116  ```bash
   117  clusterctl upgrade apply \
   118      --core cluster-api:v1.0.0 \
   119      --bootstrap kubeadm:v1.0.0 \
   120      --control-plane kubeadm:v1.0.0 \
   121      --infrastructure docker:v1.0.0-rc.0
   122  ```
   123  
   124  In this case, all the provider's versions must be explicitly stated.
   125  
   126  </aside>
   127  
   128  <aside class="note warning">
   129  
   130  <h1> Upgrading to Cluster API core components pre-release versions </h1>
   131  
   132  Use `clusterctl` CLI options to target the [desired version](https://github.com/kubernetes-sigs/cluster-api/releases).  
   133  
   134  The following shows an example of upgrading `bootrap`, `kubeadm` and `core` components to version `v1.6.0-rc.1`:
   135  
   136  ```bash
   137  TARGET_VERSION=v1.6.0-rc.1
   138  
   139  clusterctl upgrade apply \
   140      --bootstrap=kubeadm:${TARGET_VERSION} \
   141      --control-plane=kubeadm:${TARGET_VERSION} \
   142      --core=cluster-api:${TARGET_VERSION}
   143  ```
   144  
   145  </aside>
   146  
   147  <aside class="note warning">
   148  
   149  <h1> Deploying nightly release images </h1>
   150  
   151  Cluster API publishes nightly versions of the project componenents' manifests from the `main` branch to a Google storage bucket for user consumption.  The syntax for the URL is: `https://storage.googleapis.com/artifacts.k8s-staging-cluster-api.appspot.com/components/nightly_main_<YYYYMMDD>/<COMPENENT_NAME>-components.yaml`.
   152  
   153  For example, to retrieve the core component manifest published January 1, 2024, the following URL can be used: https://storage.googleapis.com/artifacts.k8s-staging-cluster-api.appspot.com/components/nightly_main_20240101/core-components.yaml.