Skip to content

Commit 70efb78

Browse files
tomazbGitHub Copilotclaude
authored
Skills support (#848)
* Add kcli-provider-development skill Provides guidance for implementing new virtualization providers: - Provider architecture and directory structure - Required methods and return value patterns - Registration in config.py and setup.py - Reference implementations * Add kcli-plan-authoring skill Provides guidance for creating kcli plan files: - YAML structure with Jinja2 templating - Resource types (VM, profile, network, image, container) - Parameter substitution and conditionals - Common VM parameters and plan execution commands * Add kcli-cluster-deployment skill Provides guidance for Kubernetes cluster deployment: - Supported cluster types (OpenShift, kubeadm, k3s, etc.) - Basic commands and key parameters - Scaling operations and troubleshooting - Cloud provider integration * Add kcli-vm-operations skill Provides guidance for VM lifecycle management: - Create, list, start, stop, delete VMs - Disk and NIC operations - Snapshots and cloning - Configuration hierarchy and common parameters - Troubleshooting tips * Add kcli-testing skill Provides guidance for testing and code quality: - Development setup and linting commands - pytest usage and test structure - Integration testing with plans - Pre-commit validation checklist - CI/CD pipeline overview * Improve Claude Code skills and add configuration skill Improvements to existing skills: - kcli-provider-development: Add 50+ missing methods including snapshots, buckets, security groups, subnets, DNS, and update operations; expand provider reference list with line counts; add provider complexity guide - kcli-plan-authoring: Fix incorrect Jinja filters path; document all 25 custom filters organized by category - kcli-testing: Document bottle.py exclusion; note flake8 E501 difference from CI linting - kcli-cluster-deployment: Add generic/kubernetes cluster type; add RKE2 and MicroShift deployment sections New skill: - kcli-configuration: Comprehensive guide for config.yml setup, all provider types (KVM, AWS, GCP, Azure, KubeVirt, OpenStack, oVirt, vSphere, Proxmox, Hetzner, IBM), profiles, and troubleshooting * Add comprehensive kcli user skill New skill combining official documentation and existing skills into a single user-focused reference covering: - Quick reference for all major commands - VM creation with common parameters and advanced examples - VM management (list, info, state control, snapshots) - Plans (Infrastructure as Code) with Jinja2 templating - Kubernetes cluster deployment (all types) - Image management and common images - Network and storage operations - Provider/client management - Profiles for reusable VM templates - Debug and troubleshooting tips - Configuration file reference - Container mode usage - Practical tips and shortcuts --------- Co-authored-by: GitHub Copilot <agent@github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent b849ca9 commit 70efb78

File tree

7 files changed

+1930
-0
lines changed

7 files changed

+1930
-0
lines changed
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
---
2+
name: kcli-cluster-deployment
3+
description: Guides deployment and management of Kubernetes clusters with kcli. Use when deploying OpenShift, k3s, kubeadm, or other Kubernetes distributions.
4+
---
5+
6+
# kcli Cluster Deployment
7+
8+
## Supported Cluster Types
9+
10+
| Type | Description | Module |
11+
|------|-------------|--------|
12+
| `openshift` | Red Hat OpenShift (IPI/UPI) | `kvirt/cluster/openshift/` |
13+
| `okd` | Community OpenShift | Same as openshift |
14+
| `hypershift` | OpenShift Hosted Control Planes | `kvirt/cluster/hypershift/` |
15+
| `microshift` | Lightweight edge OpenShift | `kvirt/cluster/microshift/` |
16+
| `generic` | Generic Kubernetes (alias: `kubernetes`) | `kvirt/cluster/kubernetes/` |
17+
| `kubeadm` | Standard Kubernetes via kubeadm | `kvirt/cluster/kubeadm/` |
18+
| `k3s` | Lightweight Kubernetes | `kvirt/cluster/k3s/` |
19+
| `rke2` | Rancher Kubernetes Engine 2 | `kvirt/cluster/rke2/` |
20+
| `aks` | Azure Kubernetes Service | `kvirt/cluster/aks/` |
21+
| `eks` | Amazon Elastic Kubernetes | `kvirt/cluster/eks/` |
22+
| `gke` | Google Kubernetes Engine | `kvirt/cluster/gke/` |
23+
24+
## Basic Cluster Commands
25+
26+
```bash
27+
# Create cluster
28+
kcli create kube <type> <clustername>
29+
30+
# Create with parameters
31+
kcli create kube openshift -P ctlplanes=3 -P workers=2 mycluster
32+
33+
# List clusters
34+
kcli list kube
35+
36+
# Get cluster info
37+
kcli info kube mycluster
38+
39+
# Delete cluster
40+
kcli delete kube mycluster
41+
42+
# Scale cluster
43+
kcli scale kube <type> -P workers=5 mycluster
44+
45+
# Get kubeconfig
46+
kcli get kubeconfig mycluster
47+
```
48+
49+
## OpenShift Deployment
50+
51+
### Minimal Example
52+
```bash
53+
kcli create kube openshift -P pull_secret=~/pull-secret.json mycluster
54+
```
55+
56+
### Key Parameters
57+
```yaml
58+
# Required
59+
pull_secret: ~/pull-secret.json # Red Hat pull secret
60+
domain: example.com # Base domain
61+
62+
# Topology
63+
ctlplanes: 3 # Control plane nodes
64+
workers: 2 # Worker nodes
65+
version: stable # OpenShift version (stable, 4.14, etc.)
66+
67+
# Resources
68+
ctlplane_memory: 16384 # Control plane memory (MB)
69+
ctlplane_numcpus: 8 # Control plane CPUs
70+
worker_memory: 8192 # Worker memory
71+
worker_numcpus: 4 # Worker CPUs
72+
73+
# Networking
74+
network: default # Libvirt network
75+
api_ip: 192.168.122.253 # API VIP (auto-detected if omitted)
76+
ingress_ip: 192.168.122.252 # Ingress VIP
77+
```
78+
79+
### Disconnected/Air-gapped
80+
```yaml
81+
disconnected_url: registry.local:5000
82+
disconnected_user: admin
83+
disconnected_password: password
84+
ca: |
85+
-----BEGIN CERTIFICATE-----
86+
...
87+
-----END CERTIFICATE-----
88+
```
89+
90+
## kubeadm Deployment
91+
92+
```bash
93+
kcli create kube kubeadm -P domain=k8s.local -P ctlplanes=1 -P workers=2 myk8s
94+
```
95+
96+
### Key Parameters
97+
```yaml
98+
domain: k8s.local # Required domain
99+
version: 1.29 # Kubernetes version
100+
ctlplanes: 1 # Control planes (odd number for HA)
101+
workers: 2 # Worker count
102+
network: default # Network name
103+
api_ip: 192.168.122.250 # API endpoint (for multi-ctlplane)
104+
image: centos9stream # Base OS image
105+
```
106+
107+
## k3s Deployment
108+
109+
```bash
110+
kcli create kube k3s -P ctlplanes=1 -P workers=2 myk3s
111+
```
112+
113+
### Key Parameters
114+
```yaml
115+
ctlplanes: 1
116+
workers: 2
117+
version: latest # k3s version
118+
domain: k3s.local
119+
image: ubuntu2204
120+
```
121+
122+
## RKE2 Deployment
123+
124+
```bash
125+
kcli create kube rke2 -P ctlplanes=1 -P workers=2 myrke2
126+
```
127+
128+
### Key Parameters
129+
```yaml
130+
ctlplanes: 1
131+
workers: 2
132+
version: latest # RKE2 version
133+
domain: rke2.local
134+
image: ubuntu2204
135+
```
136+
137+
## HyperShift (Hosted Control Planes)
138+
139+
```bash
140+
kcli create kube hypershift \
141+
-P pull_secret=~/pull-secret.json \
142+
-P nodepool_replicas=2 \
143+
myhypershift
144+
```
145+
146+
### Key Parameters
147+
```yaml
148+
pull_secret: ~/pull-secret.json
149+
management_cluster: mgmt # Existing cluster name
150+
nodepool_replicas: 2 # Worker node count
151+
release_image: ... # Specific OCP release
152+
```
153+
154+
## MicroShift Deployment
155+
156+
```bash
157+
kcli create kube microshift -P pull_secret=~/pull-secret.json mymicroshift
158+
```
159+
160+
### Key Parameters
161+
```yaml
162+
pull_secret: ~/pull-secret.json
163+
version: latest # MicroShift version
164+
image: rhel9 # RHEL-based image required
165+
```
166+
167+
## Cluster Directory Structure
168+
169+
Clusters store state in `~/.kcli/clusters/<clustername>/`:
170+
```
171+
~/.kcli/clusters/mycluster/
172+
├── kcli_parameters.yml # Stored parameters
173+
├── kubeconfig # Cluster kubeconfig
174+
├── auth/ # Auth credentials (OpenShift)
175+
│ ├── kubeadmin-password
176+
│ └── kubeconfig
177+
└── (other cluster-specific files)
178+
```
179+
180+
## Scaling Operations
181+
182+
```bash
183+
# Scale workers
184+
kcli scale kube openshift -P workers=5 mycluster
185+
186+
# Scale control planes (careful!)
187+
kcli scale kube kubeadm -P ctlplanes=3 mycluster
188+
189+
# Add nodes with specific parameters
190+
kcli scale kube openshift -P workers=3 -P worker_memory=16384 mycluster
191+
```
192+
193+
## Troubleshooting
194+
195+
### Check Deployment Progress
196+
```bash
197+
# OpenShift: watch bootstrap
198+
kcli ssh mycluster-bootstrap
199+
journalctl -f -u bootkube
200+
201+
# kubeadm: check cluster status
202+
export KUBECONFIG=~/.kcli/clusters/mycluster/kubeconfig
203+
kubectl get nodes
204+
kubectl get pods -A
205+
```
206+
207+
### Common Issues
208+
209+
1. **API IP not reachable**: Ensure `api_ip` is in the correct subnet
210+
2. **Pull secret invalid**: Verify JSON format and Red Hat subscription
211+
3. **Insufficient resources**: Check VM memory/CPU against requirements
212+
4. **DNS resolution**: Ensure domain resolves or use `sslip: true`
213+
214+
### Debug Mode
215+
```bash
216+
kcli -d create kube openshift mycluster # Verbose output
217+
```
218+
219+
## Cloud Provider Notes
220+
221+
For cloud providers (AWS, GCP, Azure), kcli can:
222+
- Auto-create load balancers (`cloud_lb: true`)
223+
- Configure cloud DNS (`cloud_dns: true`)
224+
- Set up cloud storage (`cloud_storage: true`)
225+
226+
```yaml
227+
cloud_lb: true
228+
cloud_dns: true
229+
cloud_storage: true
230+
```

0 commit comments

Comments
 (0)