Skip to content

Commit ddda45d

Browse files
committed
chore(readme): add helm chart reference
Signed-off-by: SkalaNetworks <contact@skala.network>
1 parent e342afa commit ddda45d

3 files changed

Lines changed: 43 additions & 8 deletions

File tree

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# VirtualMachine Snapshot Scheduler
22
The **VirtualMachine Snapshot Scheduler** is a Kubernetes operator designed to automate the lifecycle of KubeVirt `VirtualMachineSnapshot` resources. It creates snapshots at defined intervals using cron expressions and manages their retention.
3+
34
## Features
45
- **Cron-based Scheduling**: Automatically creates `VirtualMachineSnapshot` objects at specified intervals.
56
- **Multiple VM Support**: Selects VirtualMachines to snapshot using a `LabelSelector`.
67
- **Retention Management**: Automatically deletes old snapshots based on a maximum count or TTL (Time to Live).
78
- **Disable Schedule**: Disable snapshot creation by setting `disabled: true` while maintaining existing snapshots.
89
- **Leader Election**: Supports high availability with leader election.
10+
911
## Usage
1012
To enable scheduled snapshots for your VirtualMachines, create a `VirtualMachineSnapshotSchedule` resource.
13+
1114
### Single VirtualMachine Snapshot
1215
```yaml
1316
apiVersion: snapscheduler.kubevirt.io/v1alpha1
@@ -21,6 +24,7 @@ spec:
2124
matchLabels:
2225
vm.kubevirt.io/name: my-vm
2326
```
27+
2428
### Multiple VirtualMachines with Selector
2529
```yaml
2630
apiVersion: snapscheduler.kubevirt.io/v1alpha1
@@ -38,20 +42,42 @@ spec:
3842
labels:
3943
backup-type: scheduled
4044
```
45+
4146
## Configuration
42-
The controller can be configured using command-line flags or environment variables:
43-
| Flag | Environment Variable | Default | Description |
44-
|------|----------------------|---------|-------------|
45-
| `--kubeconfig` | - | - | Path to a kubeconfig file. |
46-
| `--leader-elect` | - | `false` | Enable leader election. |
47+
The controller can be configured using command-line flags or through the Helm chart:
48+
49+
### Command-line Flags
50+
| Flag | Default | Description |
51+
|------|---------|-------------|
52+
| `--kubeconfig` | - | Path to a kubeconfig file. |
53+
| `--leader-elect` | `false` | Enable leader election. |
54+
| `--enable-owner-references` | `false` | Enable owner references and finalizers for snapshots. |
55+
56+
## Deployment
57+
58+
### Helm Chart
59+
A Helm chart is provided in the `charts/vmsnapshot-scheduler` directory.
60+
61+
```bash
62+
helm install vmsnapshot-scheduler ./charts/vmsnapshot-scheduler -n vmsnapshot-scheduler --create-namespace
63+
```
64+
65+
Ensure you configure the `namespace` correctly in your values or via `--set`.
66+
67+
Enable `enableOwnerReferences` if you want to use owner references and finalizers for snapshots.
68+
When `VirtualMachineSnapshotSchedule` objects are deleted, all the related `VirtualMachineSnapshot` objects will be deleted as well.
69+
4770
## Build
71+
4872
### Prerequisites
4973
- Go 1.25+
5074
- Docker (optional, for containerized builds)
75+
5176
### Building the binary
5277
```bash
5378
make build
5479
```
80+
5581
### Building the Docker image
5682
```bash
5783
make docker-build IMG=vmsnapshot-scheduler:latest

charts/vmsnapshot-scheduler/templates/manager/manager.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ spec:
5151
- --metrics-bind-address=0
5252
{{- end }}
5353
- --health-probe-bind-address=:8081
54+
{{- if .Values.enableLeaderElection }}
55+
- --leader-elect
56+
{{- end }}
57+
{{- if .Values.enableOwnerReferences }}
58+
- --enable-owner-references
59+
{{- end }}
5460
{{- range .Values.args }}
5561
- {{ . }}
5662
{{- end }}

charts/vmsnapshot-scheduler/values.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ nodeSelector: {}
4646
tolerations: []
4747
affinity: {}
4848

49-
## Arguments for the manager
50-
args:
51-
- --leader-elect
49+
## Manager configuration
50+
enableLeaderElection: true
51+
enableOwnerReferences: false
52+
53+
## Additional arguments for the manager
54+
args: []
5255

5356
## Helper RBAC roles for managing custom resources
5457
##

0 commit comments

Comments
 (0)