Skip to content

Commit

Permalink
Microk8s update (#3002)
Browse files Browse the repository at this point in the history
* docs: Update the MicroK8s page to reflect 4.4 changes (#2805)

* docs: first draft of the microk8s pack page

* docs: first draft of the new microk8s page

* docs: rename image png->webp

* docs: vale feedback

* Optimised images with calibre/image-actions

* Optimised images with calibre/image-actions

* docs: apply suggestions from code review

* docs: address pcp-2882 and pcp-2886 microk8s limitations

* docs: vale feedback

* docs: add known issues section, clean up upgrade section

* docs: small changes in the known issues section

* docs: small fix

* docs: remove known issues section and reference the global known issues page

* docs: add tech preview to microk8s pack page

* docs: comment out 1.28 tab as this version wont be included in 4.4

* docs: delete partials/index.ts file

---------

Co-authored-by: vault-token-factory-spectrocloud[bot] <133815545+vault-token-factory-spectrocloud[bot]@users.noreply.github.com>

* docs: refactor microk8s page, remove boot commands as it is a 4.4 feature

---------

Co-authored-by: vault-token-factory-spectrocloud[bot] <133815545+vault-token-factory-spectrocloud[bot]@users.noreply.github.com>
(cherry picked from commit 24cb62c)
  • Loading branch information
caroldelwing committed Jun 4, 2024
1 parent 2f140d1 commit ec1fc95
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 51 deletions.
263 changes: 212 additions & 51 deletions docs/docs-content/integrations/microk8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,99 +10,260 @@ logoUrl: "https://registry.spectrocloud.com/v1/kubernetes-microk8s/blobs/sha256:
tags: ["packs", "microk8s", "kubernetes"]
---

MicroK8s is a Cloud Native Computing Foundation (CNCF) certified upstream Kubernetes deployment that runs entirely on
your workstation or edge device. It runs all Kubernetes services natively without virtual machines and packs all the
required libraries and binaries.
[MicroK8s](https://microk8s.io) is a lightweight Cloud Native Computing Foundation (CNCF) certified Kubernetes
distribution developed by [Canonical](https://canonical.com). It deploys all Kubernetes services in a single, fully
contained package, while also offering out-of-the-box [add-ons](https://microk8s.io/docs/addons).

### Support Lifecycle
Palette offers MicroK8s as Kubernetes distribution available for creating clusters. You can use MicroK8s as the
Kubernetes layer when creating [cluster profiles](../profiles/profiles.md) and then use the cluster profiles to deploy
clusters.

We support other Kubernetes distributions such as K3s, Microk8s, and RKE2 until their official EOL. The EOL is set by
the respective owner. Once we stop supporting the minor version, we initiate the deprecation process. Refer to the
[Kubernetes Support Lifecycle](kubernetes-support.md#palette-extended-kubernetes-support) guide to learn more.
### Support Lifecycle

:::warning
We support different Kubernetes distributions, such as MicroK8s, K3s, and RKE2, until their official End-of-Life (EOL).
The EOL is set by the respective owner. Once we stop supporting the minor version, we initiate the deprecation process.
Refer to the [Kubernetes Support Lifecycle](kubernetes-support.md#other-kubernetes-distributions) guide to learn more.

Once you upgrade your cluster to a new Kubernetes version, you will not be able to downgrade. We recommend that, before
upgrading, you review the information provided in the [Kubernetes Upgrades](kubernetes-support.md#kubernetes-upgrades)
section.
:::preview

:::

## Prerequisites
## Versions Supported

- One of the following Ubuntu environments to run commands:
<Tabs queryString="versions">

- 22.04 LTS
- 20.04 LTS
- 18.04 LTS
- 16.04 LTS
<!-- <TabItem label="1.28.x" value="1.28.x">
Or another operating system that supports snapd.
### Prerequisites
- At least 20 GB of disk space and 4 GB of memory.
- An internet connection.
- A minimum of 20 GB of disk space and 4 GB of memory.
:::info
- Operating System (OS) pack layer and infrastructure provider dependencies as listed in the table below.
If your environment doesn't meet these requirements, there are alternative ways to install MicroK8s, including
additional OS support and an offline deployment.
| Infrastructure Platform | OS | Version | Supported? |
| ----------------------- | ------ | ------- | ------------------ |
| AWS | Ubuntu | 22.04 | :white_check_mark: |
| MAAS | Ubuntu | 22.04 | :white_check_mark: |
:::
### Parameters
## Versions Supported
| Parameter | Description |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `microk8sConfig.addons` | A list of [MicroK8s addons](https://microk8s.io/docs/addons) you can set for your cluster. `Ingress` and `DNS` are mandatory and enabled by default. |
| `microk8sConfig.upgradeStrategy` | It describes how to replace existing nodes of your cluster with new ones during upgrades. Values can be `RollingUpgrade` (default), `InPlaceUpgrade`, or `SmartUpgrade`. Refer to the [Usage](#usage) section for guidance. |
<Tabs queryString="versions">
### Usage
<TabItem label="1.25.x" value="1.25.x">
To use MicroK8s, select it as the Kubernetes distribution when choosing the Kubernetes layer during the cluster profile
creation. Remember that the cloud type must be either AWS or MAAS, and the OS layer must be Ubuntu 22.04.
- **1.25.0**
![A view of the cluster profile Kubernetes selection screen](/integrations_microk8s_cluster-profile-view.webp)
</TabItem>
:::info
<TabItem label="1.24.x" value="1.24.x">
MicroK8s clusters use the [Calico CNI](https://microk8s.io/docs/change-cidr) by default. However, this default
installation was disabled due to Palette's requirement for a CNI layer to be present in the cluster profiles. This way,
users can choose their preferred CNI layer during the cluster profile creation.
- **1.24.0**
:::
</TabItem>
</Tabs>
#### Upgrade Strategy
MicroK8s installs a minimal, lightweight Kubernetes you can run and use on almost any machine. When installing MicroK8s
you can specify a channel made up of two components:
The upgrade strategy describes how to replace existing control plane nodes with new ones during upgrades.
- **Track**: denotes the upstream Kubernetes version.
- **Risk level**: indicates the maturity level of the release, such as stable and edge.
You can specify the upgrade strategy during cluster profile creation by editing the value of the `upgradeStrategy`
parameter in the MicroK8s pack YAML file displayed under the **Pack Details** section.
MicroK8s comes with its own packaged version of the `kubectl` command for operating Kubernetes. This avoids interfering
with any version that may already be on the host machine. You can run it in a terminal like this: <br />
:::warning
```yaml
microk8s kubectl
```
Before upgrading your cluster, review the [Known Issues](../release-notes/known-issues.md) and the
[Kubernetes Upgrades](kubernetes-support.md#kubernetes-upgrades) pages to learn about the limitations associated with
MicroK8s upgrades.
If you are using or want to use a different kubectl command, you can configure it for your Linux, Mac, or Windows
operating system.
:::
<br />
The MicroK8s pack supports three types of upgrade strategies:
:::warning
- `InPlaceUpgrade` - Performs an in-place upgrade of the control plane. For clusters with one control plane and one
worker node, `InPlaceUpgrade` temporarily shuts down the API server.
When you deploy AWS EBS pack with MicroK8s, you need to change EBS CSI pack
`node.kubelet`` values from `/var/lib/kubelet`to`/var/snap/microk8s/common/var/lib/kubelet`.
- `RollingUpgrade` - The default upgrade strategy that deletes the current control plane node before creating a new one.
```yaml
- `SmartUpgrade` - Performs an in-place upgrade of the control plane on clusters with fewer than three control plane
nodes, and a rolling upgrade on clusters with three or more control plane nodes.
#### Using MicroK8s with the AWS EBS Pack
When using the [AWS EBS pack](./aws-ebs.md) with MicroK8s, you need to change the EBS CSI pack `node.kubelet` parameter
from `/var/lib/kubelet` to `/var/snap/microk8s/common/var/lib/kubelet`.
```yaml {3}
node:
env: []
kubeletPath: /var/lib/kubelet
```
```yaml
```yaml {3}
node:
env: []
kubeletPath: /var/snap/microk8s/common/var/lib/kubelet
```
</TabItem> -->

<TabItem label="1.27.x" value="1.27.x">

### Prerequisites

- A minimum of 20 GB of disk space and 4 GB of memory.

- Operating System (OS) pack layer and infrastructure provider dependencies as listed in the table below.

| Infrastructure Platform | OS | Version | Supported? |
| ----------------------- | ------ | ------- | ------------------ |
| AWS | Ubuntu | 22.04 | :white_check_mark: |
| MAAS | Ubuntu | 22.04 | :white_check_mark: |

### Parameters

| Parameter | Description |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `microk8sConfig.addons` | A list of [MicroK8s addons](https://microk8s.io/docs/addons) you can set for your cluster. `Ingress` and `DNS` are mandatory and enabled by default. |
| `microk8sConfig.upgradeStrategy` | It describes how to replace existing nodes of your cluster with new ones during upgrades. Values can be `RollingUpgrade` (default), `InPlaceUpgrade`, or `SmartUpgrade`. Refer to the [Usage](#usage) section for guidance. |

### Usage

To use MicroK8s, select it as the Kubernetes distribution when choosing the Kubernetes layer during the cluster profile
creation. Remember that the cloud type must be either AWS or MAAS, and the OS layer must be Ubuntu 22.04.

![A view of the cluster profile Kubernetes selection screen](/integrations_microk8s_cluster-profile-view.webp)

:::info

MicroK8s clusters use the [Calico CNI](https://microk8s.io/docs/change-cidr) by default. However, this default
installation was disabled due to Palette's requirement for a CNI layer to be present in the cluster profiles. This way,
users can choose their preferred CNI layer during the cluster profile creation.

:::

#### Upgrade Strategy

The upgrade strategy describes how to replace existing control plane nodes with new ones during upgrades.

You can specify the upgrade strategy during cluster profile creation by editing the value of the `upgradeStrategy`
parameter in the MicroK8s pack YAML file displayed under the **Pack Details** section.

:::warning

Before upgrading your cluster, review the [Known Issues](../release-notes/known-issues.md) and the
[Kubernetes Upgrades](kubernetes-support.md#kubernetes-upgrades) pages to learn about the limitations associated with
MicroK8s upgrades.

:::

The MicroK8s pack supports three types of upgrade strategies:

- `InPlaceUpgrade` - Performs an in-place upgrade of the control plane. For clusters with one control plane and one
worker node, `InPlaceUpgrade` temporarily shuts down the API server.

- `RollingUpgrade` - The default upgrade strategy that deletes the current control plane node before creating a new one.

- `SmartUpgrade` - Performs an in-place upgrade of the control plane on clusters with fewer than three control plane
nodes, and a rolling upgrade on clusters with three or more control plane nodes.

</TabItem>

<TabItem label="1.26.x" value="1.26.x">

### Prerequisites

- A minimum of 20 GB of disk space and 4 GB of memory.

- Operating System (OS) pack layer and infrastructure provider dependencies as listed in the table below.

| Infrastructure Platform | OS | Version | Supported? |
| ----------------------- | ------ | ------- | ------------------ |
| AWS | Ubuntu | 22.04 | :white_check_mark: |
| MAAS | Ubuntu | 22.04 | :white_check_mark: |

### Parameters

| Parameter | Description |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `microk8sConfig.addons` | A list of [MicroK8s addons](https://microk8s.io/docs/addons) you can set for your cluster. `Ingress` and `DNS` are mandatory and enabled by default. |
| `microk8sConfig.upgradeStrategy` | It describes how to replace existing nodes of your cluster with new ones during upgrades. Values can be `RollingUpgrade` (default), `InPlaceUpgrade`, or `SmartUpgrade`. Refer to the [Usage](#usage) section for guidance. |

### Usage

To use MicroK8s, select it as the Kubernetes distribution when choosing the Kubernetes layer during the cluster profile
creation. Remember that the cloud type must be either AWS or MAAS, and the OS layer must be Ubuntu 22.04.

![A view of the cluster profile Kubernetes selection screen](/integrations_microk8s_cluster-profile-view.webp)

:::info

MicroK8s clusters use the [Calico CNI](https://microk8s.io/docs/change-cidr) by default. However, this default
installation was disabled due to Palette's requirement for a CNI layer to be present in the cluster profiles. This way,
users can choose their preferred CNI layer during the cluster profile creation.

:::

#### Upgrade Strategy

The upgrade strategy describes how to replace existing control plane nodes with new ones during upgrades.

You can specify the upgrade strategy during cluster profile creation by editing the value of the `upgradeStrategy`
parameter in the MicroK8s pack YAML file displayed under the **Pack Details** section.

:::warning

Before upgrading your cluster, review the [Known Issues](../release-notes/known-issues.md) and the
[Kubernetes Upgrades](kubernetes-support.md#kubernetes-upgrades) pages to learn about the limitations associated with
MicroK8s upgrades.

:::

The MicroK8s pack supports three types of upgrade strategies:

- `InPlaceUpgrade` - Performs an in-place upgrade of the control plane. For clusters with one control plane and one
worker node, `InPlaceUpgrade` temporarily shuts down the API server.

- `RollingUpgrade` - The default upgrade strategy that deletes the current control plane node before creating a new one.

- `SmartUpgrade` - Performs an in-place upgrade of the control plane on clusters with fewer than three control plane
nodes, and a rolling upgrade on clusters with three or more control plane nodes.

</TabItem>

<TabItem label="Deprecated" value="Deprecated">

:::warning

All versions less than version 1.26.x are considered deprecated. Upgrade to a newer version to take advantage of new
features.

:::

</TabItem>
</Tabs>

## Terraform

You can reference the MicroK8s pack in Terraform with the following data resource.

```hcl
data "spectrocloud_registry" "public_registry" {
name = "Public Repo"
}
data "spectrocloud_pack" "k8s" {
name = "kubernetes-microk8s"
version = "1.27"
registry_uid = data.spectrocloud_registry.public_registry.id
}
```

## References

- [MicroK8s ](https://microk8s.io/docs)
- [MicroK8s Documentation](https://microk8s.io/docs)
- [MicroK8s GitHub Repository](https://github.com/canonical/microk8s)
Binary file not shown.

0 comments on commit ec1fc95

Please sign in to comment.