Kubevirt operator for creating virtual machines
This project has dependencies on private repositories. To build locally:
# Using SSH (recommended)
make docker-build-with-ssh
# Using Docker secrets (secure token method)
export GITHUB_TOKEN=your_token_here
make docker-build-with-secrets
# Using build args (legacy token method)
export GITHUB_TOKEN=your_token_here
make docker-build-with-tokenUsing https://kubebuilder.io and https://kubevirt.io/user-guide/
The operator can be configured using environment variables:
-
PVC_VOLUME_MODE: Set the volume mode for PersistentVolumeClaims (default:Block)Block: Raw block device access for better performance (default)Filesystem: Traditional filesystem access
Example:
export PVC_VOLUME_MODE=Filesystem
CPU_MODEL: CPU model for VMs (default:host-modelfor x86_64,host-passthroughfor ARM)VM_NAME_PREFIX: Prefix for VM names (default:vm-)
NETWORK_ATTACHMENT_DEFINITION_CNI_VERSION: CNI version for NetworkAttachmentDefinitions (default:1.0.0)
MANAGED_BY: Label value for managed resources (default:kubevirt-operator)DEFAULT_KUBEVIRT_CONFIG: Name of the default KubevirtConfig to use
Note: KubevirtConfig is a cluster-scoped resource. Each KubevirtConfig specifies its own
spec.secretNamespacewhere the kubeconfig secret is stored.
LOG_LEVEL: Logging level (default:info)LOG_JSON: Enable JSON logging (default:true)LOG_ADD_CALLER: Add caller information to logsLOG_DISABLE_STACKTRACE: Disable stack tracesLOG_UNESCAPED_MULTILINE: Allow unescaped multiline logsLOG_COLORIZE_LINE: Colorize log lines
This project uses GitHub Actions for continuous integration and delivery:
- Build and Tests: Runs on each push and pull request to verify code integrity.
- Security Scan: Regular vulnerability scanning with govulncheck and CodeQL.
- Release Process: Tagged commits trigger automatic builds and publish to:
- Container images:
ghcr.io/vitistack/viti-kubevirt-operator - Helm charts:
oci://ghcr.io/vitistack/helm/kubevirt-operator
- Container images:
- Dependabot: Automated dependency updates for GitHub Actions, Go modules, Docker, and Helm charts.
To create a new release:
- Tag the commit:
git tag -a v1.0.0 -m "Release v1.0.0" - Push the tag:
git push origin v1.0.0
The GitHub Actions workflow will automatically build and publish the container image and Helm chart.
Dependabot is configured to automatically open pull requests for:
- GitHub Actions workflow dependencies
- Go module dependencies
- Docker image dependencies
- Helm chart dependencies
Pull requests for minor and patch updates are automatically approved and merged. Major updates require manual review and approval.