agentleFS
karmabkarmab/kcli/skills/kcli-cluster-deployment/SKILL.md

kcli-cluster-deployment

Skill658 starsChanged 13 days agoApache-2.0View on GitHub

Guides deployment and management of Kubernetes clusters with kcli. Use when deploying OpenShift, k3s, kubeadm, or other Kubernetes distributions.

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    API IP not reachable: Ensure api_ip is in the correct subnet

    line 209
  2. Distinctive:

    Pull secret invalid: Verify JSON format and Red Hat subscription

    line 210
  3. Distinctive:

    Insufficient resources: Check VM memory/CPU against requirements

    line 211
  4. Very specific:

    DNS resolution: Ensure domain resolves or use sslip: true

    line 212

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

kcli Cluster Deployment

Supported Cluster Types

TypeDescriptionModule
openshiftRed Hat OpenShift (IPI/UPI)kvirt/cluster/openshift/
okdCommunity OpenShiftSame as openshift
hypershiftOpenShift Hosted Control Planeskvirt/cluster/hypershift/
microshiftLightweight edge OpenShiftkvirt/cluster/microshift/
genericGeneric Kubernetes (alias: kubernetes)kvirt/cluster/kubernetes/
kubeadmStandard Kubernetes via kubeadmkvirt/cluster/kubeadm/
k3sLightweight Kuberneteskvirt/cluster/k3s/
rke2Rancher Kubernetes Engine 2kvirt/cluster/rke2/
aksAzure Kubernetes Servicekvirt/cluster/aks/
eksAmazon Elastic Kuberneteskvirt/cluster/eks/
gkeGoogle Kubernetes Enginekvirt/cluster/gke/

Basic Cluster Commands

# Create cluster
kcli create kube <type> <clustername>

# Create with parameters
kcli create kube openshift -P ctlplanes=3 -P workers=2 mycluster

# List clusters
kcli list kube

# Get cluster info
kcli info kube mycluster

# Delete cluster
kcli delete kube mycluster

# Scale cluster
kcli scale kube <type> -P workers=5 mycluster

# Get kubeconfig
kcli get kubeconfig mycluster

OpenShift Deployment

Minimal Example

kcli create kube openshift -P pull_secret=~/pull-secret.json mycluster

Key Parameters

# Required
pull_secret: ~/pull-secret.json    # Red Hat pull secret
domain: example.com                 # Base domain

# Topology
ctlplanes: 3                        # Control plane nodes
workers: 2                          # Worker nodes
version: stable                     # OpenShift version (stable, 4.14, etc.)

# Resources
ctlplane_memory: 16384              # Control plane memory (MB)
ctlplane_numcpus: 8                 # Control plane CPUs
worker_memory: 8192                 # Worker memory
worker_numcpus: 4                   # Worker CPUs

# Networking
network: default                    # Libvirt network
api_ip: 192.168.122.253            # API VIP (auto-detected if omitted)
ingress_ip: 192.168.122.252        # Ingress VIP

Disconnected/Air-gapped

disconnected_url: registry.local:5000
disconnected_user: admin
disconnected_password: password
ca: |
  -----BEGIN CERTIFICATE-----
  ...
  -----END CERTIFICATE-----

kubeadm Deployment

kcli create kube kubeadm -P domain=k8s.local -P ctlplanes=1 -P workers=2 myk8s

Key Parameters

domain: k8s.local                   # Required domain
version: 1.29                       # Kubernetes version
ctlplanes: 1                        # Control planes (odd number for HA)
workers: 2                          # Worker count
network: default                    # Network name
api_ip: 192.168.122.250            # API endpoint (for multi-ctlplane)
image: centos9stream                # Base OS image

k3s Deployment

kcli create kube k3s -P ctlplanes=1 -P workers=2 myk3s

Key Parameters

ctlplanes: 1
workers: 2
version: latest                     # k3s version
domain: k3s.local
image: ubuntu2204

RKE2 Deployment

kcli create kube rke2 -P ctlplanes=1 -P workers=2 myrke2

Key Parameters

ctlplanes: 1
workers: 2
version: latest                     # RKE2 version
domain: rke2.local
image: ubuntu2204

HyperShift (Hosted Control Planes)

kcli create kube hypershift \
  -P pull_secret=~/pull-secret.json \
  -P nodepool_replicas=2 \
  myhypershift

Key Parameters

pull_secret: ~/pull-secret.json
management_cluster: mgmt            # Existing cluster name
nodepool_replicas: 2                # Worker node count
release_image: ...                  # Specific OCP release

MicroShift Deployment

kcli create kube microshift -P pull_secret=~/pull-secret.json mymicroshift

Key Parameters

pull_secret: ~/pull-secret.json
version: latest                     # MicroShift version
image: rhel9                        # RHEL-based image required

Cluster Directory Structure

Clusters store state in ~/.kcli/clusters/<clustername>/:

~/.kcli/clusters/mycluster/
├── kcli_parameters.yml    # Stored parameters
├── kubeconfig             # Cluster kubeconfig
├── auth/                  # Auth credentials (OpenShift)
│   ├── kubeadmin-password
│   └── kubeconfig
└── (other cluster-specific files)

Scaling Operations

# Scale workers
kcli scale kube openshift -P workers=5 mycluster

# Scale control planes (careful!)
kcli scale kube kubeadm -P ctlplanes=3 mycluster

# Add nodes with specific parameters
kcli scale kube openshift -P workers=3 -P worker_memory=16384 mycluster

Troubleshooting

Check Deployment Progress

# OpenShift: watch bootstrap
kcli ssh mycluster-bootstrap
journalctl -f -u bootkube

# kubeadm: check cluster status
export KUBECONFIG=~/.kcli/clusters/mycluster/kubeconfig
kubectl get nodes
kubectl get pods -A

Common Issues

  1. API IP not reachable: Ensure api_ip is in the correct subnet
  2. Pull secret invalid: Verify JSON format and Red Hat subscription
  3. Insufficient resources: Check VM memory/CPU against requirements
  4. DNS resolution: Ensure domain resolves or use sslip: true

Debug Mode

kcli -d create kube openshift mycluster  # Verbose output

Cloud Provider Notes

For cloud providers (AWS, GCP, Azure), kcli can:

  • Auto-create load balancers (cloud_lb: true)
  • Configure cloud DNS (cloud_dns: true)
  • Set up cloud storage (cloud_storage: true)
cloud_lb: true
cloud_dns: true
cloud_storage: true

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.