Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Create new dual-stack flavor #241

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Addons](./topics/addons.md)
- [Flavors](./topics/flavors/flavors.md)
- [Default (kubeadm)](./topics/flavors/default.md)
- [Dual-stack (kubeadm)](./topics/flavors/dual-stack.md)
- [ClusterClass kubeadm](./topics/flavors/clusterclass-kubeadm.md)
- [k3s](./topics/flavors/k3s.md)
- [rke2](./topics/flavors/rke2.md)
Expand Down
13 changes: 8 additions & 5 deletions docs/src/topics/flavors/clusterclass-kubeadm.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Kubeadm ClusterClass
## Specification
| Control Plane | CNI | Default OS | Installs ClusterClass |
|---------------|--------|--------------|-----------------------|
| Kubeadm | Cilium | Ubuntu 22.04 | Yes |
| Control Plane | CNI | Default OS | Installs ClusterClass | IPv4 | IPv6 |
|---------------|--------|--------------|-----------------------|------|------|
| Kubeadm | Cilium | Ubuntu 22.04 | Yes | Yes | No |
## Prerequisites
[Quickstart](../getting-started.md) completed
## Usage
### Create clusterClass and first cluster
1. Generate the ClusterClass and cluster manifests
```bash
clusterctl generate cluster test-cluster --infrastructure linode:0.0.0 --flavor clusterclass-kubeadm > test-cluster.yaml
clusterctl generate cluster test-cluster \
--infrastructure linode:0.0.0 \
--flavor clusterclass-kubeadm > test-cluster.yaml
```
2. Apply cluster manifests
```bash
Expand All @@ -18,7 +20,8 @@
### (Optional) Create a second cluster using the existing ClusterClass
1. Generate cluster manifests
```bash
clusterctl generate cluster test-cluster-2 --flavor clusterclass-kubeadm > test-cluster-2.yaml
clusterctl generate cluster test-cluster-2 \
--flavor clusterclass-kubeadm > test-cluster-2.yaml
```
```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand Down
9 changes: 5 additions & 4 deletions docs/src/topics/flavors/default.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Default
## Specification
| Control Plane | CNI | Default OS | Installs ClusterClass |
|---------------|--------|--------------|-----------------------|
| Kubeadm | Cilium | Ubuntu 22.04 | No |
| Control Plane | CNI | Default OS | Installs ClusterClass | IPv4 | IPv6 |
|---------------|--------|--------------|-----------------------|------|------|
| Kubeadm | Cilium | Ubuntu 22.04 | No | Yes | No |
## Prerequisites
[Quickstart](../getting-started.md) completed
## Usage
1. Generate cluster yaml
```bash
clusterctl generate cluster test-cluster --infrastructure linode:0.0.0 > test-cluster.yaml
clusterctl generate cluster test-cluster \
--infrastructure linode:0.0.0 > test-cluster.yaml
```
2. Apply cluster yaml
```bash
Expand Down
18 changes: 18 additions & 0 deletions docs/src/topics/flavors/dual-stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dual-Stack
## Specification
| Control Plane | CNI | Default OS | Installs ClusterClass | IPv4 | IPv6 |
|---------------|--------|--------------|-----------------------|------|------|
| Kubeadm | Cilium | Ubuntu 22.04 | No | Yes | Yes |
## Prerequisites
[Quickstart](../topics/getting-started.md) completed
## Usage
1. Generate cluster yaml
```bash
clusterctl generate cluster test-cluster \
--infrastructure linode:0.0.0 \
--flavor dual-stack > test-cluster.yaml
```
2. Apply cluster yaml
```bash
kubectl apply -f test-cluster.yaml
```
6 changes: 3 additions & 3 deletions docs/src/topics/flavors/etcd-backup-restore.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# etcd-backup-restore

## Specification
| Control Plane | CNI | Default OS | Installs ClusterClass | Installs etcd backup |
|---------------|--------|--------------|-----------------------|----------------------|
| Kubeadm | Cilium | Ubuntu 22.04 | No | Yes |
| Control Plane | CNI | Default OS | Installs ClusterClass | Installs etcd backup | IPv4 | IPv6 |
|---------------|--------|--------------|-----------------------|----------------------|------|------|
| Kubeadm | Cilium | Ubuntu 22.04 | No | Yes | Yes | No |

## Prerequisites
[Quickstart](../topics/getting-started.md) completed
Expand Down
10 changes: 6 additions & 4 deletions docs/src/topics/flavors/k3s.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# K3s
## Specification
| Control Plane | CNI | Default OS | Installs ClusterClass |
|-----------------------------|--------|--------------|-----------------------|
| [k3s](https://docs.k3s.io/) | Cilium | Ubuntu 22.04 | No |
| Control Plane | CNI | Default OS | Installs ClusterClass | IPv4 | IPv6 |
|-----------------------------|--------|--------------|-----------------------|------|------|
| [k3s](https://docs.k3s.io/) | Cilium | Ubuntu 22.04 | No | Yes | No |
## Prerequisites
* [Quickstart](../getting-started.md) completed
* Select a [k3s kubernetes version](https://github.com/k3s-io/k3s/releases) to set for the kubernetes version
Expand All @@ -28,7 +28,9 @@
## Usage
1. Generate cluster yaml
```bash
clusterctl generate cluster test-cluster --infrastructure linode:0.0.0 --flavor k3s > test-k3s-cluster.yaml
clusterctl generate cluster test-cluster \
--infrastructure linode:0.0.0 \
--flavor k3s > test-k3s-cluster.yaml
```
2. Apply cluster yaml
```bash
Expand Down
10 changes: 6 additions & 4 deletions docs/src/topics/flavors/rke2.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# RKE2
## Specification
| Control Plane | CNI | Default OS | Installs ClusterClass |
|-----------------------------|--------|--------------|-----------------------|
| [rke2](https://docs.rke2.io/) | Cilium | Ubuntu 22.04 | No |
| Control Plane | CNI | Default OS | Installs ClusterClass | IPv4 | IPv6 |
|-------------------------------|--------|--------------|-----------------------|------|------|
| [rke2](https://docs.rke2.io/) | Cilium | Ubuntu 22.04 | No | Yes | No |
## Prerequisites
* [Quickstart](../getting-started.md) completed
* Select an [rke2 kubernetes version](https://github.com/rancher/rke2/releases) to set for the kubernetes version
Expand All @@ -16,7 +16,9 @@
## Usage
1. Generate cluster yaml
```bash
clusterctl generate cluster test-cluster --infrastructure linode:0.0.0 --flavor rke2 > test-rke2-cluster.yaml
clusterctl generate cluster test-cluster \
--infrastructure linode:0.0.0 \
--flavor rke2 > test-rke2-cluster.yaml
```
2. Apply cluster yaml
```bash
Expand Down
29 changes: 29 additions & 0 deletions templates/addons/cilium/cilium-ipv6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: addons.cluster.x-k8s.io/v1alpha1
kind: HelmChartProxy
metadata:
name: cilium-ipv6
spec:
clusterSelector:
matchLabels:
cni: cilium
ipv6: "true"
repoURL: https://helm.cilium.io/
chartName: cilium
namespace: kube-system
version: ${CILIUM_VERSION:=1.15.0}
options:
waitForJobs: true
wait: true
timeout: 5m
valuesTemplate: |
ipv6:
enabled: true
ipam:
mode: kubernetes
k8s:
requireIPv4PodCIDR: true
hubble:
relay:
enabled: true
ui:
enabled: true
5 changes: 3 additions & 2 deletions templates/addons/cilium/cilium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: cilium
spec:
clusterSelector:
matchLabels:
cni: cilium
matchExpressions:
- {key: ipv6, operator: DoesNotExist}
- {key: cni, operator: In, values: ['cilium']}
repoURL: https://helm.cilium.io/
chartName: cilium
namespace: kube-system
Expand Down
1 change: 1 addition & 0 deletions templates/addons/cilium/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cilium.yaml
- cilium-ipv6.yaml
1 change: 1 addition & 0 deletions templates/common-init-files/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ stringData:
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
eljohnson92 marked this conversation as resolved.
Show resolved Hide resolved
kubeadm-pre-init.sh: |
#!/bin/bash
set -euo pipefail
Expand Down
42 changes: 42 additions & 0 deletions templates/flavors/dual-stack/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../default

patches:
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
patch: |-
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
labels:
ipv6: "true"
spec:
clusterNetwork:
pods:
cidrBlocks:
- 10.192.0.0/10
- fd02::/80
services:
cidrBlocks:
- 10.96.0.0/12
- fd03::/108
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
kind: KubeadmControlPlane
patch: |-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
metadata:
name: ${CLUSTER_NAME}-control-plane
spec:
kubeadmConfigSpec:
clusterConfiguration:
controllerManager:
extraArgs:
node-cidr-mask-size-ipv6: "96"
Loading