Skip to content

Commit 6ec3d7f

Browse files
committed
chore(readme): document full crd
Signed-off-by: SkalaNetworks <contact@skala.network>
1 parent ddda45d commit 6ec3d7f

4 files changed

Lines changed: 41 additions & 20 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ cleanup-test-e2e: ## Tear down the Kind cluster used for e2e tests
9292

9393
.PHONY: lint
9494
lint: golangci-lint ## Run golangci-lint linter
95-
"$(GOLANGCI_LINT)" run
95+
"$(GOLANGCI_LINT)" run --timeout 5m
9696

9797
.PHONY: lint-fix
9898
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
99-
"$(GOLANGCI_LINT)" run --fix
99+
"$(GOLANGCI_LINT)" run --fix --timeout 5m
100100

101101
.PHONY: lint-config
102102
lint-config: golangci-lint ## Verify golangci-lint linter configuration

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,44 @@ The **VirtualMachine Snapshot Scheduler** is a Kubernetes operator designed to a
77
- **Retention Management**: Automatically deletes old snapshots based on a maximum count or TTL (Time to Live).
88
- **Disable Schedule**: Disable snapshot creation by setting `disabled: true` while maintaining existing snapshots.
99
- **Leader Election**: Supports high availability with leader election.
10+
- **CRD Configuration**: Fully configurable with simple YAML manifests.
11+
12+
## Example CRD Configuration
13+
```yaml
14+
apiVersion: snapscheduler.kubevirt.io/v1alpha1
15+
kind: VirtualMachineSnapshotSchedule
16+
metadata:
17+
name: example-schedule
18+
namespace: default
19+
spec:
20+
# Standard cron expression for scheduling snapshots
21+
# Also supports descriptors (@daily, @monthly, @yearly...
22+
schedule: "0 2 * * *"
23+
24+
# Selection of VirtualMachines to snapshot
25+
# Supports both matchLabels and matchExpressions
26+
virtualMachineSelector:
27+
matchLabels:
28+
vm.kubevirt.io/name: my-vm
29+
matchExpressions:
30+
- key: environment
31+
operator: In
32+
values:
33+
- production
34+
35+
# Retention policies (can be used together)
36+
maxCount: 7 # Keep only the last 7 snapshots
37+
ttl: "168h" # Keep snapshots for 7 days (e.g., 24h, 1h, 30m)
38+
39+
# Template for the created VirtualMachineSnapshot objects
40+
snapshotTemplate:
41+
metadata:
42+
labels:
43+
backup-type: scheduled
44+
45+
# Set to true to pause the schedule without deleting it
46+
disabled: false
47+
```
1048
1149
## Usage
1250
To enable scheduled snapshots for your VirtualMachines, create a `VirtualMachineSnapshotSchedule` resource.

charts/vmsnapshot-scheduler/Chart.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,5 @@ apiVersion: v2
22
name: vmsnapshot-scheduler
33
description: A Helm chart to deploy the vmsnapshot-scheduler
44
type: application
5-
65
version: 0.1.0
7-
appVersion: "0.1.0"
8-
9-
keywords:
10-
- kubernetes
11-
- operator
12-
13-
annotations:
14-
kubebuilder.io/generated-by: kubebuilder
6+
appVersion: "0.1.0"

charts/vmsnapshot-scheduler/values.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,14 @@ enableOwnerReferences: false
5353
## Additional arguments for the manager
5454
args: []
5555

56-
## Helper RBAC roles for managing custom resources
57-
##
58-
rbacHelpers:
59-
# Install convenience admin/editor/viewer roles for CRDs
60-
enable: false
61-
6256
## Controller metrics endpoint.
6357
## Enable to expose /metrics endpoint with RBAC protection.
64-
##
6558
metrics:
6659
enable: true
6760
# Metrics server port
6861
port: 8443
6962

7063
## Custom Resource Definitions
71-
##
7264
crd:
7365
# Install CRDs with the chart
7466
enable: true
@@ -77,7 +69,6 @@ crd:
7769

7870
## Prometheus ServiceMonitor for metrics scraping.
7971
## Requires prometheus-operator to be installed in the cluster.
80-
##
8172
serviceMonitor:
8273
enable: false
8374

0 commit comments

Comments
 (0)