Loading...
Loading...
Guides creation of kcli plan files for deploying VMs, networks, and infrastructure. Use when writing YAML plans with Jinja2 templating or debugging plan execution issues.
npx skill4agent add karmab/kcli kcli-plan-authoringtypeparameters:
param1: value1
param2: value2
resourcename:
type: resourcetype
key1: value1
key2: {{ param1 }}myvm:
image: fedora40
memory: 4096
numcpus: 2
disks:
- size: 20
- size: 10
pool: otherpool
nets:
- name: default
- name: mynet
ip: 192.168.1.10
netmask: 255.255.255.0
gateway: 192.168.1.1
cmds:
- echo hello > /tmp/test
files:
- path: /etc/myconfig
content: |
key=valuemyprofile:
type: profile
image: centos9stream
memory: 2048
numcpus: 2
disks:
- 10
nets:
- defaultmynetwork:
type: network
cidr: 192.168.100.0/24
dhcp: true
nat: true
domain: mylab.localmyimage:
type: image
url: https://example.com/image.qcow2
pool: defaultmycontainer:
type: container
image: nginx:latest
ports:
- 8080:80parameters:
cluster_name: mycluster
worker_count: 3
{{ cluster_name }}-master:
image: rhcos
{% for i in range(worker_count) %}
{{ cluster_name }}-worker-{{ i }}:
image: rhcos
{% endfor %}parameters:
enable_storage: true
myvm:
image: fedora40
{% if enable_storage %}
disks:
- size: 100
{% endif %}kvirt/jinjafilters/jinjafilters.pybasenamedirnamediskpathexistspwd_pathreal_pathread_filenonetypebase64certificatecountkubenodesdefaultnodeshas_ctlplanegithub_versionmin_ocp_versionmax_ocp_versionlocal_ipnetwork_ipipv6_wrapkcli_infofind_manifestswait_crdwait_csvfilter_bgp_peerskcli_parameters.ymlcluster_name: prod
worker_count: 5
memory: 8192kcli create plan -f myplan.yml -P worker_count=10 myplan| Parameter | Default | Description |
|---|---|---|
| 2 | Number of CPUs |
| 512 | Memory in MB |
| default | Storage pool |
| None | Base image name |
| [default] | Network list |
| [{size:10}] | Disk list |
| [] | Post-boot commands |
| [] | Files to inject |
| [] | SSH public keys |
| true | Auto-start VM |
| true | Enable cloud-init |
# Create plan
kcli create plan -f myplan.yml myplanname
# Create with parameter overrides
kcli create plan -f myplan.yml -P memory=4096 -P image=fedora40 myplanname
# List plans
kcli list plan
# Get plan info
kcli info plan myplanname
# Delete plan (and all its resources)
kcli delete plan myplanname
# Update existing plan
kcli update plan -f myplan.yml myplannamepython -c "import yaml; yaml.safe_load(open('plan.yml'))"{{}}{% %}kcli -d create plan -f plan.yml testparameters:
domain: lab.local
base_image: centos9stream
labnetwork:
type: network
cidr: 10.0.0.0/24
dhcp: true
domain: {{ domain }}
webserver:
image: {{ base_image }}
memory: 2048
nets:
- labnetwork
cmds:
- dnf -y install nginx
- systemctl enable --now nginx
database:
image: {{ base_image }}
memory: 4096
disks:
- size: 20
- size: 50
nets:
- labnetwork
cmds:
- dnf -y install postgresql-server
- postgresql-setup --initdb