Skip to content

Commit 226c9b4

Browse files
committed
feat: private networking
1 parent 816178f commit 226c9b4

52 files changed

Lines changed: 4503 additions & 465 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e-weekly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ jobs:
3737
- name: Run weekly e2e tests
3838
env:
3939
CLOUDSCALE_API_TOKEN: ${{ secrets.CLOUDSCALE_API_TOKEN }}
40+
CLOUDSCALE_NETWORK_UUID: ${{ secrets.CLOUDSCALE_NETWORK_UUID }}
4041
TAG: e2e-weekly-${{ github.sha }}
4142
run: |
4243
make test-e2e \
43-
GINKGO_LABEL_FILTER="ha || upgrade || self-hosted || kcp-remediation || conformance" \
44+
GINKGO_LABEL_FILTER="ha || upgrade || self-hosted || kcp-remediation || conformance || byo-networking" \
4445
KUBETEST_CONFIGURATION=./data/kubetest/conformance-fast.yaml
4546
4647
- name: Install regctl

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
- test-e2e-upgrade
1919
- test-e2e-self-hosted
2020
- test-e2e-md-remediation
21+
- test-e2e-byo-networking
2122
- test-e2e-conformance
2223
- test-e2e-conformance-fast
2324

@@ -53,6 +54,7 @@ jobs:
5354
- name: Run e2e tests
5455
env:
5556
CLOUDSCALE_API_TOKEN: ${{ secrets.CLOUDSCALE_API_TOKEN }}
57+
CLOUDSCALE_NETWORK_UUID: ${{ secrets.CLOUDSCALE_NETWORK_UUID }}
5658
TAG: e2e-manual-${{ github.sha }}
5759
TEST_TARGET: ${{ github.event.inputs.test_target }}
5860
run: make $TEST_TARGET

Makefile

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,20 @@ generate-e2e-cni: ## Regenerate Cilium CNI manifest from Helm chart
125125
generate-e2e-ccm: ## Regenerate cloudscale CCM manifest
126126
@CCM_VERSION=$(CCM_VERSION) hack/generate-e2e-ccm.sh
127127

128+
E2E_CLUSTER_TEMPLATES := cluster-template \
129+
cluster-template-ha \
130+
cluster-template-upgrades \
131+
cluster-template-md-remediation \
132+
cluster-template-byo-network \
133+
cluster-template-public-lb-private-nodes \
134+
cluster-template-fip
135+
128136
.PHONY: generate-e2e-templates
129137
generate-e2e-templates: $(KUSTOMIZE) generate-e2e-cni generate-e2e-ccm ## Generate e2e cluster templates using kustomize overlays
130138
@mkdir -p $(E2E_TEMPLATES)/main
131-
@echo "Generating cluster-template.yaml..."
132-
@"$(KUSTOMIZE)" build --load-restrictor LoadRestrictionsNone $(E2E_TEMPLATES)/cluster-template > $(E2E_TEMPLATES)/main/cluster-template.yaml
133-
@echo "Generating cluster-template-ha.yaml..."
134-
@"$(KUSTOMIZE)" build --load-restrictor LoadRestrictionsNone $(E2E_TEMPLATES)/cluster-template-ha > $(E2E_TEMPLATES)/main/cluster-template-ha.yaml
135-
@echo "Generating cluster-template-upgrades.yaml..."
136-
@"$(KUSTOMIZE)" build --load-restrictor LoadRestrictionsNone $(E2E_TEMPLATES)/cluster-template-upgrades > $(E2E_TEMPLATES)/main/cluster-template-upgrades.yaml
137-
@echo "Generating cluster-template-md-remediation.yaml..."
138-
@"$(KUSTOMIZE)" build --load-restrictor LoadRestrictionsNone $(E2E_TEMPLATES)/cluster-template-md-remediation > $(E2E_TEMPLATES)/main/cluster-template-md-remediation.yaml
139+
@$(foreach tmpl,$(E2E_CLUSTER_TEMPLATES),\
140+
echo "Generating $(tmpl).yaml..." && \
141+
"$(KUSTOMIZE)" build --load-restrictor LoadRestrictionsNone $(E2E_TEMPLATES)/$(tmpl) > $(E2E_TEMPLATES)/main/$(tmpl).yaml &&) true
139142
@echo "Templates generated successfully."
140143

141144
.PHONY: generate-e2e-config
@@ -222,6 +225,19 @@ test-e2e-md-remediation: $(GINKGO) generate-e2e-templates generate-e2e-config do
222225
-e2e.skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) \
223226
-e2e.use-existing-cluster=$(USE_EXISTING_CLUSTER)
224227

228+
.PHONY: test-e2e-byo-networking
229+
test-e2e-byo-networking: $(GINKGO) generate-e2e-templates generate-e2e-config docker-build ## Run BYO networking e2e tests
230+
$(GINKGO) -v --trace --tags=e2e \
231+
--nodes=$(GINKGO_NODES) \
232+
--label-filter="byo-networking" \
233+
--timeout=90m \
234+
--output-dir="$(E2E_ARTIFACTS_FOLDER)" --junit-report="junit.e2e_byo_networking.xml" \
235+
./test/e2e -- \
236+
-e2e.config=$(E2E_CONF_FILE) \
237+
-e2e.artifacts-folder=$(E2E_ARTIFACTS_FOLDER) \
238+
-e2e.skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) \
239+
-e2e.use-existing-cluster=$(USE_EXISTING_CLUSTER)
240+
225241
.PHONY: test-e2e-conformance
226242
test-e2e-conformance: $(GINKGO) generate-e2e-templates generate-e2e-config docker-build ## Run K8s conformance e2e tests
227243
$(GINKGO) -v --trace --tags=e2e \

README.md

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ for [cloudscale.ch](https://www.cloudscale.ch).
88

99
## Features
1010

11-
- **CloudscaleCluster**: Network, Subnet, Load Balancer management
12-
- **CloudscaleMachine**: Server provisioning with cloud-init
11+
- **CloudscaleCluster**: Multi-network management (managed or BYO), Load Balancer (public or private VIP), Floating IP
12+
support
13+
- **CloudscaleMachine**: Server provisioning with cloud-init and configurable network interfaces
1314
- **CloudscaleMachineTemplate**: Immutable machine templates for KubeadmControlPlane/MachineDeployment
1415

1516
## Prerequisites
@@ -42,6 +43,9 @@ clusterctl generate cluster my-cluster \
4243
| kubectl apply -f -
4344
```
4445

46+
This uses the default template (public nodes, managed network). See [Cluster Templates](#cluster-templates) for other
47+
network topologies.
48+
4549
Watch the cluster come up:
4650

4751
```bash
@@ -50,15 +54,40 @@ clusterctl describe cluster my-cluster
5054

5155
## Environment Variables
5256

53-
| Variable | Description | Example |
54-
|-------------------------------------------|--------------------------------|-----------------------------------|
55-
| `CLOUDSCALE_API_TOKEN` | cloudscale.ch API token | `abc123...` |
56-
| `CLOUDSCALE_SSH_PUBLIC_KEY` | SSH public key added to nodes | `ssh-ed25519 AAAA...` |
57-
| `CLOUDSCALE_REGION` | cloudscale.ch region | `lpg` or `rma` |
58-
| `CLOUDSCALE_MACHINE_IMAGE` | Server image for nodes | `custom:ubuntu-2404-kube-v1.xx.x` |
59-
| `CLOUDSCALE_CONTROL_PLANE_MACHINE_FLAVOR` | Flavor for control plane nodes | `flex-4-2` |
60-
| `CLOUDSCALE_WORKER_MACHINE_FLAVOR` | Flavor for worker nodes | `flex-4-2` |
61-
| `CLOUDSCALE_ROOT_VOLUME_SIZE` | Root volume size in GB | `50` |
57+
| Variable | Description | Example |
58+
|-------------------------------------------|-------------------------------------------|-----------------------------------|
59+
| `CLOUDSCALE_API_TOKEN` | cloudscale.ch API token | `abc123...` |
60+
| `CLOUDSCALE_SSH_PUBLIC_KEY` | SSH public key added to nodes | `ssh-ed25519 AAAA...` |
61+
| `CLOUDSCALE_REGION` | cloudscale.ch region | `lpg` or `rma` |
62+
| `CLOUDSCALE_MACHINE_IMAGE` | Server image for nodes | `custom:ubuntu-2404-kube-v1.xx.x` |
63+
| `CLOUDSCALE_CONTROL_PLANE_MACHINE_FLAVOR` | Flavor for control plane nodes | `flex-4-2` |
64+
| `CLOUDSCALE_WORKER_MACHINE_FLAVOR` | Flavor for worker nodes | `flex-4-2` |
65+
| `CLOUDSCALE_ROOT_VOLUME_SIZE` | Root volume size in GB | `50` |
66+
| `CLOUDSCALE_NETWORK_UUID` | Existing cloudscale.ch network UUID (BYO) | `2db69ba3-...` |
67+
68+
> **Note:** `CLOUDSCALE_NETWORK_UUID` is required by the `fip`, `public-lb-private-nodes`, and `byo-network`
69+
> template flavors. It is not needed for the default template.
70+
71+
## Cluster Templates
72+
73+
CAPCS ships several cluster templates for different network topologies. Use `clusterctl generate cluster` with the
74+
`--flavor` flag to select one:
75+
76+
```bash
77+
clusterctl generate cluster my-cluster \
78+
--kubernetes-version v1.32.0 \
79+
--control-plane-machine-count 1 \
80+
--worker-machine-count 2 \
81+
--flavor <flavor-name> \
82+
| kubectl apply -f -
83+
```
84+
85+
| Flavor | Network | CP Endpoint | Node Connectivity | Extra Env Vars | Notes |
86+
|---------------------------|---------------------------|-----------------------|-------------------|---------------------------|----------------------|
87+
| *(default)* | Managed (`10.100.0.0/24`) | Public LB (DualStack) | Public + cluster || |
88+
| `fip` | BYO | Floating IP (IPv4) | Public + cluster | `CLOUDSCALE_NETWORK_UUID` | |
89+
| `public-lb-private-nodes` | BYO + NAT | Public LB | Private only | `CLOUDSCALE_NETWORK_UUID` | Requires NAT gateway |
90+
| `byo-network` | BYO | Public LB (DualStack) | Public + cluster | `CLOUDSCALE_NETWORK_UUID` | |
6291

6392
## Development
6493

@@ -92,14 +121,16 @@ filtering and are split into suites of increasing cost, scheduled accordingly:
92121
| Cluster upgrade | `upgrade` | Rolling K8s version upgrade (v1.34 → v1.35) | < 10 min | Weekly | `test-e2e-upgrade` |
93122
| Self-hosted | `self-hosted` | clusterctl move (pivot) to workload cluster. Requires container image in public registry | < 15 min | Weekly | `test-e2e-self-hosted` |
94123
| MD remediation | `md-remediation` | MachineHealthCheck auto-replacement of unhealthy workers | < 10 min | Weekly | `test-e2e-md-remediation` |
124+
| BYO networking | `byo-networking` | BYO network: public-LB + private-nodes and floating-IP variants | < 10 min | Weekly | `test-e2e-byo-networking` |
95125
| Conformance (fast) | `conformance` | K8s conformance, skip Serial tests | < 60 min | Weekly | `test-e2e-conformance-fast` |
96126
| Conformance (full) | `conformance` | Full K8s conformance including Serial tests | < 120 min | Biweekly | `test-e2e-conformance` |
97127

98128
Durations are approximate from a real CI run; conformance varies with cluster size.
99129

100130
**Why this split?** The single-CP lifecycle test is the cheapest smoke test and runs
101131
nightly to catch regressions early. HA, upgrade, self-hosted, and remediation tests are more
102-
resource-intensive and run weekly. Full K8s conformance is the most expensive and runs biweekly
132+
resource-intensive and run weekly. Private networking tests require `CLOUDSCALE_NETWORK_UUID` to be set and are
133+
skipped otherwise. Full K8s conformance is the most expensive and runs biweekly
103134
(1st + 15th of month). All suites can be triggered manually via the `test-e2e.yml` workflow
104135
dispatch. E2E tests share a concurrency group so only one suite runs at a time.
105136

@@ -143,6 +174,8 @@ kustomize_substitutions:
143174
CLOUDSCALE_WORKER_MACHINE_FLAVOR: "flex-4-2"
144175
CLOUDSCALE_MACHINE_IMAGE: "IMAGE_NAME"
145176
CLOUDSCALE_ROOT_VOLUME_SIZE: "50"
177+
# Required for BYO network flavors (fip, public-lb-private-nodes, byo-network):
178+
# CLOUDSCALE_NETWORK_UUID: "UUID_HERE"
146179
extra_args:
147180
cloudscale:
148181
- "--zap-log-level=5"

0 commit comments

Comments
 (0)