VictoriaMetrics on Kubernetes Playground
VictoriaMetrics Operator on a multi-node Kubernetes cluster.
What's Included
A multi-node Kubernetes cluster with the VictoriaMetrics Operator pre-installed.
| Machine | Role |
|---|---|
| dev-machine | Your workstation |
| cplane-01 | Control plane node |
| node-01, node-02 | Worker nodes |
The VictoriaMetrics Operator is installed in the vm namespace using the upstream release manifests.
No VictoriaMetrics components are deployed: that's your job.
Operator version: v0.68.3
๐ฏ Getting Started
Check Operator
- Verify the cluster is ready:
kubectl get nodes
- Check that the VM Operator is running:
kubectl -n vm get pods
- Explore the available CRDs:
kubectl api-resources | grep victoriametrics
Deploy a Single-Node VictoriaMetrics Instance
kubectl apply -f - <<EOF
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMSingle
metadata:
name: victoriametrics
spec:
retentionPeriod: "7d"
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
EOF
Wait for it come up:
kubectl wait pods -l app.kubernetes.io/name=vmsingle --for=condition=Ready
Scrape kubelet Metrics from Every Node
kubectl apply -f - <<EOF
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAgent
metadata:
name: vmagent
spec:
selectAllByDefault: true
replicaCount: 1
remoteWrite:
- url: "http://vmsingle-victoriametrics.default.svc:8428/api/v1/write"
---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMNodeScrape
metadata:
name: kubelet-metrics
spec:
scheme: https
tlsConfig:
insecureSkipVerify: true
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
interval: 15s
EOF
Query Metrics
Start a port forward to query VictoriaMetrics:
kubectl port-forward svc/vmsingle-victoriametrics 8428:8428 &
curl -s 'http://localhost:8428/api/v1/query?query=up' | jq
๐ Learn More
๐งฉ Related Content
๐งช Playgrounds
Happy learning! ๐
A real VM, not a container
Get root on a VM with its own kernel, so Docker, Kubernetes, and systemd just work.
Read the docs โ
SSH from browser or CLI
Use the built-in web terminal, or connect with labctl ssh, plain ssh, scp, or rsync.
Read the docs โ
Drive it with AI
Let Claude, Codex, or any MCP client start this playground and run commands in it.
Read the docs โ
Expose HTTP(S) ports
Give any web app running inside the VM a public URL - for yourself or to share with others.
Read the docs โ
Share terminals
Invite others into your terminal session, or open it yourself from another device.
Read the docs โ
Customize with init scripts
Add shell scripts that run at boot to install packages, clone repos, or seed test data.
Read the docs โ
Private networking
VMs reach the internet via NAT with no public IP; several VMs share bridge networks.
Read the docs โ
Ephemeral or persistent
By default, VMs are destroyed when the session ends; enable persistence to keep the disks for next time.
Read the docs โ
Built-in container registry
A private registry.iximiuz.com for every playground to share images across services and VMs.
Read the docs โ