Skip to content
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
20 changes: 17 additions & 3 deletions .github/workflows/unit-quickstart-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
runs-on: [self-hosted, linux]
needs: [unit]
steps:
- name: 🩹 Safe config for 💩 DNS
run: |
sed 's/options /options use-vc single-request attempts:5 /' < /etc/resolv.conf > /etc/resolv.conf.new
cat /etc/resolv.conf.new > /etc/resolv.conf
- name: ⬇️ Checkout repository
uses: actions/checkout@v4
- name: ⬇️ Install kubectl
Expand All @@ -52,7 +56,8 @@ jobs:
kustomize-version: v4.5.7
- name: 🔎 Check IP
id: ip
run: echo "ip=`curl -s https://api.ipify.org`" | tee $GITHUB_OUTPUT
run: |
echo "ip=`curl -s https://api.ipify.org`" | tee $GITHUB_OUTPUT
- name: 🔐 Set ak/sk name based on runner region
run: .github/scripts/runneraksk.sh
- name: 🧹 Frieza
Expand Down Expand Up @@ -87,10 +92,18 @@ jobs:
sudo apt install -y docker-buildx-plugin
make docker-buildx
make docker-push
docker image prune -a -f
env:
IMG: ${{ vars.REGISTRY }}/outscale/cluster-api-outscale-controllers:${{ github.sha }}
DOCKER_BUILDKIT: 1
- name: 🔎 Preloader snapshot
id: preloader
uses: outscale/k8s-image-preloader/github_actions/preloader_snapshot@main
with:
KUBECONFIG: ${{ steps.management.outputs.KUBECONFIG }}
OSC_ACCESS_KEY: ${{ secrets[env.OSC_ACCESS_KEY_NAME] }}
OSC_SECRET_KEY: ${{ secrets[env.OSC_SECRET_KEY_NAME] }}
OSC_REGION: ${{ env.OSC_REGION }}
CSI: true
- name: 🔐 Create CAPOSC ns and credentials
run: make credential
shell: bash
Expand All @@ -112,10 +125,11 @@ jobs:
KUBECONFIG: "${{ github.workspace }}/${{ steps.management.outputs.KUBECONFIG }}"
CCM_OSC_ACCESS_KEY: ${{ secrets[env.OSC_ACCESS_KEY_NAME] }}
CCM_OSC_SECRET_KEY: ${{ secrets[env.OSC_SECRET_KEY_NAME] }}
CCM_OSC_REGION: $${{ env.OSC_REGION }}
CCM_OSC_REGION: ${{ env.OSC_REGION }}
IMG: ${{ vars.REGISTRY }}/outscale/cluster-api-outscale-controllers:${{ github.sha }}
IMG_UPGRADE_FROM: ${{ vars.IMG_UPGRADE_FROM }}
IMG_UPGRADE_TO: ${{ vars.IMG_UPGRADE_TO }}
PRELOAD_SNAPSHOT_ID: ${{ steps.preloader.outputs.SNAPSHOT_ID }}
- name: 📝 Get CAPOSC state/logs
run: |
echo "**** pod state"
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/oscmachine_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func ValidateIops(path *field.Path, iops, size int32) *field.Error {
return nil
case iops > maxIops || iops < minIops:
return field.Invalid(path, iops, fmt.Sprintf("iops must be between %d and %d", minIops, maxIops))
case iops/size > 300:
case size > 0 && iops/size > 300:
return field.Invalid(path, iops, "iops/size should be lower than 300")
default:
return nil
Expand Down
5 changes: 2 additions & 3 deletions api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,13 @@ type OscImage struct {
type OscVolume struct {
// The volume name.
Name string `json:"name,omitempty"`
// The volume device (/dev/sdX)
// The volume device (/dev/xvdX)
// +kubebuilder:validation:Required
Device string `json:"device"`
// The volume iops (io1 volumes only)
Iops int32 `json:"iops,omitempty"`
// The volume size in gibibytes (GiB)
// +kubebuilder:validation:Required
Size int32 `json:"size"`
Size int32 `json:"size,omitempty"`
// (unused)
SubregionName string `json:"subregionName,omitempty"`
// The volume type (io1, gp2 or standard)
Expand Down
14 changes: 6 additions & 8 deletions capm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: cluster-api-provider-outscale-system/cluster-api-provider-outscale-serving-cert
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
labels:
cluster.x-k8s.io/v1alpha3: v1alpha3
cluster.x-k8s.io/v1beta1: v1beta1
Expand Down Expand Up @@ -879,7 +879,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: cluster-api-provider-outscale-system/cluster-api-provider-outscale-serving-cert
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
labels:
cluster.x-k8s.io/v1alpha3: v1alpha3
cluster.x-k8s.io/v1beta1: v1beta1
Expand Down Expand Up @@ -1588,7 +1588,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: cluster-api-provider-outscale-system/cluster-api-provider-outscale-serving-cert
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
labels:
cluster.x-k8s.io/v1alpha3: v1alpha3
cluster.x-k8s.io/v1beta1: v1beta1
Expand Down Expand Up @@ -1789,7 +1789,7 @@ spec:
items:
properties:
device:
description: The volume device (/dev/sdX)
description: The volume device (/dev/xvdX)
type: string
fromSnapshot:
description: The id of a snapshot to use as a volume source.
Expand All @@ -1816,7 +1816,6 @@ spec:
type: string
required:
- device
- size
type: object
type: array
type: object
Expand Down Expand Up @@ -1994,7 +1993,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
labels:
cluster.x-k8s.io/v1alpha3: v1alpha3
cluster.x-k8s.io/v1beta1: v1beta1
Expand Down Expand Up @@ -2226,7 +2225,7 @@ spec:
items:
properties:
device:
description: The volume device (/dev/sdX)
description: The volume device (/dev/xvdX)
type: string
fromSnapshot:
description: The id of a snapshot to use as a volume
Expand Down Expand Up @@ -2254,7 +2253,6 @@ spec:
type: string
required:
- device
- size
type: object
type: array
type: object
Expand Down
4 changes: 3 additions & 1 deletion cloud/services/compute/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ func (s *Service) CreateVm(ctx context.Context,
for _, vol := range volumes {
bsuVol := osc.BlockDeviceMappingVmCreation{
Bsu: &osc.BsuToCreate{
VolumeSize: &vol.Size,
VolumeType: &vol.VolumeType,
},
DeviceName: &vol.Device,
}
if vol.Size > 0 {
bsuVol.Bsu.VolumeSize = &vol.Size
}
if vol.VolumeType == "io1" {
bsuVol.Bsu.Iops = &vol.Iops
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
name: oscclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
name: oscclustertemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
name: oscmachines.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -191,7 +191,7 @@ spec:
items:
properties:
device:
description: The volume device (/dev/sdX)
description: The volume device (/dev/xvdX)
type: string
fromSnapshot:
description: The id of a snapshot to use as a volume source.
Expand All @@ -218,7 +218,6 @@ spec:
type: string
required:
- device
- size
type: object
type: array
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.1-0.20250924093817-1d67470bef32
controller-gen.kubebuilder.io/version: v0.19.1-0.20251023132335-bf7d6b742e6a
name: oscmachinetemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -232,7 +232,7 @@ spec:
items:
properties:
device:
description: The volume device (/dev/sdX)
description: The volume device (/dev/xvdX)
type: string
fromSnapshot:
description: The id of a snapshot to use as a volume
Expand Down Expand Up @@ -260,7 +260,6 @@ spec:
type: string
required:
- device
- size
type: object
type: array
type: object
Expand Down
4 changes: 2 additions & 2 deletions controllers/osccluster_netpeering.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (r *OscClusterReconciler) reconcileNetPeering(ctx context.Context, clusterS
return reconcile.Result{}, fmt.Errorf("cannot get mgmt credentials: %w", err)
}
mgmtSvc := r.Cloud.NetPeering(mgmt)
log.V(2).Info("Accepting netPeering")
log.V(2).Info("Accepting netPeering", "netPeeringId", np.GetNetPeeringId())
err = mgmtSvc.AcceptNetPeering(ctx, np.GetNetPeeringId())
if err != nil {
return reconcile.Result{}, fmt.Errorf("cannot accept netPeering: %w", err)
Expand Down Expand Up @@ -109,7 +109,7 @@ func (r *OscClusterReconciler) reconcileDeleteNetPeering(ctx context.Context, cl
if np.State.GetName() != "pending-acceptance" && np.State.GetName() != "active" {
continue
}
log.V(2).Info("Deleting netPeering", "subnetId", np.GetNetPeeringId())
log.V(2).Info("Deleting netPeering", "netPeeringId", np.GetNetPeeringId())
err = svc.DeleteNetPeering(ctx, np.GetNetPeeringId())
if err != nil {
return reconcile.Result{}, fmt.Errorf("cannot delete netPeering: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [Multi AZ clusters](./topics/config-multiaz.md)
- [Securing cluster access](./topics/config-security.md)
- [Air-gapped clusters](./topics/config-airgap.md)
- [Omi](./topics/omi.md)
- [Preloading images](./topics/preload.md)
- [Troubleshooting](./topics/troubleshooting.md)
- [Cluster-Autoscaler](./topics/cluster-autoscaler.md)
- [How to upgrade](./topics/upgrade-cluster.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/topics/config-airgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ network:

TBD

## Pre-loaded images
## Preloaded images

TBD
See [Preloading images](preload.md).

## Outscale API access

Expand Down
39 changes: 26 additions & 13 deletions docs/src/topics/config-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,40 @@ In your `OscMachineTemplate` spec, add the list of required volumes:
vm: [...]
volumes:
- name: data
device: /dev/sdb
device: /dev/xvdb
iops: 500
size: 50
volumeType: io1
- name: logs
device: /dev/sdc
device: /dev/xvdc
iops: 500
size: 10
volumeType: io1
[...]
```

> New volumes are unformatted. You will need to partition, format and mount them during cloud-init.

A snapshot can be used as a volume source:
```yaml
- name: images
device: /dev/sdd
size: 5
volumeType: gp2
device: /dev/xvdd
fromSnapshot: snap-xxx
```

> Volumes not created from a snapshot are unformatted. You will need to format newly created volumes during cloud-init.
> By default, the size of the snapshot is used for the new volume.

You will need to mount snapshot-based volumes during cloud-init. In `KubeadmConfigTemplate`/`KubeadmControlPlane` resources:
```yaml
spec:
joinConfiguration:
[...]
mounts:
- - xvdd
- /mnt/example
- ext4
- auto,exec,ro
```

## OscMachineTemplate configuration

Expand Down Expand Up @@ -88,13 +100,14 @@ Outscale Open-Source images are published on the `eu-west-2`, `us-east-2` and `c

`volumes` is a list of additional volumes.

| Name | Required | Description
| --- | --- | ---
| `name` | false | The volume name
| `device` | true | The volume device (`/dev/sdX`)
| `size` | true | The volume size
| `volumeType` | true | The volume type (`io1`, `gp2` or `standard`)
| `iops` | false | The volume iops (only for the `io1` type)
| Name | Default | Required | Description
| --- | --- | --- | ---
| `name` | n/a | false | The volume name
| `device` | n/a | true | The volume device (`/dev/xvdX`)
| `size` | n/a | false | The volume size (required unless the source is a snapshot; if not set, the snapshot size is used)
| `volumeType` | `standard` | false | The volume type (`io1`, `gp2` or `standard`)
| `iops` | n/a | false | The volume iops (only for the `io1` type)
| `fromSnapshot` | n/a | false | The ID of the source snapshot

### Subnet & security group selection

Expand Down
Loading