Skip to content
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d0b5130
PCP-5890 CAPI Maas Changes to support hypershift (#307)
guyni Jan 22, 2026
0941a4f
go mod tidy and fix dependency in machine.go
Kun483 Jun 4, 2026
93b9dc2
fix kube-rbac-proxy image
Kun483 Jun 4, 2026
a131820
fix govuln
Kun483 Jun 4, 2026
817d26c
add pr, gh issue, and contributing templates
Kun483 Jun 4, 2026
0749cc3
PCP-5029 [Palette] [CAPMaas] Support for the Hosted control plane. (#…
AmitSahastra Aug 19, 2025
44abe2a
go mod tidy && go mod download
Kun483 Jun 8, 2026
547b3a6
PCP-5043: [Palette] [CAPMaas] Support for the Dynamic LXD creation (#…
AmitSahastra Aug 20, 2025
967f7d0
PCP-5017: MAAS static ip implementation (#177)
Kun483 Aug 21, 2025
a6f718d
PCP-5088: Storage input configuration (#184)
AmitSahastra Aug 21, 2025
77886d4
PCP-5088: Storage input configuration (#186)
AmitSahastra Aug 22, 2025
ee9f8a3
PCP-5089: Resolved issue that lxd-initializer daemonset is running in…
Kun483 Aug 26, 2025
06c8b1d
resolved racing condition between registering lxd host to maas consol…
Kun483 Aug 26, 2025
5f258e5
PCP-5124: HCP cluster deletion, Deregister KVM Host (#192)
AmitSahastra Aug 26, 2025
8725b4d
PCP-5118: auto detect resource pool, zone, and storage (#195)
Kun483 Aug 28, 2025
50bf335
add zone as param when composing lxd (#198)
Kun483 Aug 29, 2025
a4ce9d9
handle lxd vm deletion after releasing (#199)
Kun483 Aug 29, 2025
f82659d
PCP-5115: Test: Removal of host controlplane node while workload clus…
AmitSahastra Sep 1, 2025
780711e
handle lxd host selection (#210)
Kun483 Sep 3, 2025
63b9907
Fix lxd-initilizer docker build (#205)
AmitSahastra Sep 3, 2025
5351ea7
PCP-5154: In palette upgrade env - node repave is seen in MAAS PCG cl…
AmitSahastra Sep 4, 2025
e71d216
make minDiskSize optional (#217)
Kun483 Sep 5, 2025
0fd45d1
PCP-5160: Enforce BM provisioning in the HCP cluster (#219)
AmitSahastra Sep 8, 2025
7068aec
PCP-5197: added resourcePool as filter when composing lxd vm (#222)
Kun483 Sep 12, 2025
48f9d6b
PCP-5178: Release LXD VM during the upgrade of the hosted control pla…
AmitSahastra Sep 13, 2025
03545d8
PCP-5152: Multiple node HCP cluster losing interface reference (#243)
AmitSahastra Sep 17, 2025
0cac30a
release IP if it's in user reserved and unknown state (#249)
Kun483 Sep 23, 2025
1f9d95b
PCP-5221: Patch: Added number of interfaces check before releasing IP…
Kun483 Sep 24, 2025
06882fc
Reduce the timming for host registration (#255)
AmitSahastra Sep 25, 2025
b4d115b
PCP-5211: Add maintenance-mode contracts and controller scaffolding (…
AmitSahastra Nov 3, 2025
c76f8ff
lxd-initializer image change (#276)
AmitSahastra Nov 3, 2025
77f045a
PCP-5472: During HCP cluster upgrade , one of the machine is stuck in…
AmitSahastra Nov 7, 2025
0b9cefd
PCP-5482: Propagate HCP gating events (#280)
jayesh-srivastava Nov 7, 2025
2b16e53
exclude systemd installation/update to make it needrestart not show u…
Kun483 Nov 7, 2025
325d108
PCP-5489: Allow worker nodes to be checked for lxd initialization (#286)
jayesh-srivastava Nov 7, 2025
6783253
PCP-5484: Replacement CP LXD VM created in a different resource pool …
AmitSahastra Nov 8, 2025
5385f24
Update LXD image (#289)
jayesh-srivastava Nov 8, 2025
4e8d654
PCP-5506: In EC Vertex env, in Maas HCP cluster lxd-initializer pods …
AmitSahastra Nov 12, 2025
db3fe1e
PCP-5586: Use Ubuntu base image from Spectro registry for lxd-init co…
AmitSahastra Dec 3, 2025
9dcf80c
remove spectro-release.yaml
Kun483 Jun 9, 2026
45e9d18
Fix capmaas service account (#313)
AmitSahastra Feb 9, 2026
33ecece
PCP-6077: vm placement selection with resource and distribution aware…
kpiyush17 Feb 28, 2026
fb29ab9
Update security contexts and permissions in MAAS CRDs (#320)
Kun483 Mar 11, 2026
9c99b41
Add MinDiskSizeGB option to SelectOptions and implement storage check…
Kun483 Mar 16, 2026
ada2bd9
PCP-6344: Maas HCP cluster upgrade is stuck (#327)
AmitSahastra Mar 31, 2026
4385d91
PCP-6119: feat: add AUTO link mode and LinkSubnetWithMode for MAAS li…
AmitSahastra Apr 16, 2026
d7cbe6d
Merge branch 'main' into feat/lxd-hcp
Kun483 Jun 9, 2026
d705fc7
add spectro-release.yaml and hcp/lxd templates
Kun483 Jun 9, 2026
a4e69b9
Merge branch 'feat/lxd-hcp' of ssh://github.com/spectrocloud/cluster-…
Kun483 Jun 9, 2026
040ddb8
remove namespace in hcp cluster template
Kun483 Jun 9, 2026
09ba03d
fix docker push in makefile
Kun483 Jun 9, 2026
6092661
remove dual NICs feature
Kun483 Jun 10, 2026
6af054d
remove static IP config feature
Kun483 Jun 11, 2026
0acf107
fix make docker-push-all, remove spectro folder, add FD in lxd cluste…
Kun483 Jun 11, 2026
d4af1e7
add FD to hcp cluster template and move hcp/lxd features to exp folder
Kun483 Jun 11, 2026
e213a41
make cluster-role can be customized
Kun483 Jun 15, 2026
66b00d1
Unified Design implementation for HCP
Kun483 Jun 17, 2026
c345aeb
Update HCP and WLC user guide
Kun483 Jun 18, 2026
9feda71
Enhance documentation and templates for HCP and LXD clusters. Updated…
Kun483 Jun 18, 2026
788ff0e
register HMC and VEC unconditionally
Kun483 Jun 19, 2026
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
61 changes: 0 additions & 61 deletions .github/workflows/spectro-release.yaml

This file was deleted.

12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bin
# Kubernetes Generated files - skip generated files, except for vendored files

!vendor/**/zz_generated.*

vendor
# editor and IDE paraphernalia
.idea
*.swp
Expand All @@ -26,4 +26,12 @@ bin
maas-credentials.env

_build
vendor/

# Generated processed templates (created by envsubst during build)
controllers/templates/*.processed

# LXD test directory
lxd-test-tmp/
utils/maas/lxd-test/.netrc
.netrc
vendor/
255 changes: 255 additions & 0 deletions LXD_TESTING_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
# LXD Integration Testing Guide

This guide provides instructions for testing the LXD integration in the CAPMAAS controller.

## Prerequisites

1. A running MAAS server with API access
2. A Kubernetes cluster with Cluster API installed
3. The newly built CAPMAAS controller image:
```
gcr.io/spectro-dev-public/release/cluster-api/cluster-api-provider-maas-controller-amd64:v0.6.0-spectro-4.0.0-dev-10052025
```

## Setup

### 1. Create MAAS Credentials Secret

Create a Kubernetes secret containing your MAAS credentials:

```bash
kubectl create namespace capmaas-system
kubectl create secret generic maas-credentials \
--namespace capmaas-system \
--from-literal=url=http://your-maas-server:5240/MAAS \
--from-literal=token=your-maas-api-token
```

### 2. Deploy CAPMAAS Controller

Create a file named `capmaas-deployment.yaml` with the following content:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: capmaas-controller-manager
namespace: capmaas-system
labels:
control-plane: capmaas-controller-manager
spec:
selector:
matchLabels:
control-plane: capmaas-controller-manager
replicas: 1
template:
metadata:
labels:
control-plane: capmaas-controller-manager
spec:
containers:
- name: manager
image: gcr.io/spectro-dev-public/release/cluster-api/cluster-api-provider-maas-controller-amd64:v0.6.0-spectro-4.0.0-dev-10052025
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
env:
- name: MAAS_API_URL
valueFrom:
secretKeyRef:
name: maas-credentials
key: url
optional: true
- name: MAAS_API_TOKEN
valueFrom:
secretKeyRef:
name: maas-credentials
key: token
optional: true
```

Apply the deployment:

```bash
kubectl apply -f capmaas-deployment.yaml
```

### 3. Create an Infrastructure Cluster with LXD Support

Create a file named `infrastructure-cluster.yaml` with the following content:

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: infra-cluster
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
services:
cidrBlocks: ["10.96.0.0/12"]
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasCluster
name: infra-cluster
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasCluster
metadata:
name: infra-cluster
namespace: default
spec:
dnsDomain: "maas"
lxdControlPlaneCluster: true
lxdConfig:
enabled: true
storageBackend: "zfs"
storageSize: "50"
networkBridge: "br0"
resourcePool: "default"
skipNetworkUpdate: true
```

Apply the cluster configuration:

```bash
kubectl apply -f infrastructure-cluster.yaml
```

### 4. Create Control Plane Machines

Create a file named `control-plane.yaml` with the following content:

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
kind: Machine
metadata:
name: infra-cluster-cp-0
namespace: default
labels:
cluster.x-k8s.io/cluster-name: infra-cluster
cluster.x-k8s.io/control-plane: "true"
spec:
clusterName: infra-cluster
bootstrap:
dataSecretName: "bootstrap-data" # This would normally be created by a bootstrap provider
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasMachine
name: infra-cluster-cp-0
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasMachine
metadata:
name: infra-cluster-cp-0
namespace: default
labels:
cluster.x-k8s.io/cluster-name: infra-cluster
cluster.x-k8s.io/control-plane: "true"
spec:
minCPU: 2
minMemory: 4096
image: "ubuntu/focal"
```

Apply the control plane configuration:

```bash
kubectl apply -f control-plane.yaml
```

## Monitoring and Verification

### 1. Monitor the CAPMAAS Controller Logs

```bash
kubectl logs -f -n capmaas-system deployment/capmaas-controller-manager
```

### 2. Check the Status of the MaasCluster

```bash
kubectl get maascluster infra-cluster -o yaml
```

Look for the `LXDReadyCondition` in the status section.

### 3. Check MAAS for LXD Host Registration

1. Log in to your MAAS web interface
2. Go to the "KVM" section
3. Verify that your control plane machine has been registered as an LXD host

## Testing Workload Clusters

Once your infrastructure cluster is ready, you can create a workload cluster that uses LXD VMs:

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: workload-cluster
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
services:
cidrBlocks: ["10.96.0.0/12"]
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasCluster
name: workload-cluster
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasCluster
metadata:
name: workload-cluster
namespace: default
spec:
dnsDomain: "maas"
infrastructureClusterRef:
name: infra-cluster
workloadClusterConfig:
controlPlanePool:
name: "cp-pool"
useLXD: true
```

## Troubleshooting

### Common Issues

1. **MAAS Credentials Not Found**
- Check that the `maas-credentials` secret exists and contains the correct keys
- Verify that the environment variables are set correctly

2. **LXD Host Registration Fails**
- Check that the control plane machine has been provisioned correctly
- Verify that the machine has network connectivity to the MAAS server
- Check that the LXD service is running on the machine

3. **VM Creation Fails**
- Check that the LXD host has been registered correctly
- Verify that the LXD host has enough resources to create VMs
- Check that the storage pool and network bridge exist on the LXD host

## Cleanup

To clean up the resources:

```bash
kubectl delete -f control-plane.yaml
kubectl delete -f infrastructure-cluster.yaml
kubectl delete -f capmaas-deployment.yaml
kubectl delete secret -n capmaas-system maas-credentials
kubectl delete namespace capmaas-system
```
Loading