Skip to content

Commit 3edbb43

Browse files
committed
first claude-pass
Signed-off-by: grokspawn <[email protected]> Assisted-by: claude
1 parent b8989e5 commit 3edbb43

File tree

10 files changed

+939
-0
lines changed

10 files changed

+939
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "olmv1",
3+
"description": "A plugin for managing Kubernetes extensions using OLM v1 (operator-controller)",
4+
"version": "0.1.0",
5+
"author": {
6+
"name": "openshift-eng"
7+
}
8+
}

plugins/olmv1/README.md

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# OLM v1 Plugin
2+
3+
Manage Kubernetes cluster extensions using Operator Lifecycle Manager v1 (operator-controller).
4+
5+
## Overview
6+
7+
OLM v1 provides a simpler, more flexible approach to managing Kubernetes extensions including Operators, Helm charts, and other cluster extensions. This plugin helps you discover, install, upgrade, and manage extensions in your cluster.
8+
9+
## Prerequisites
10+
11+
- `kubectl` or `oc` CLI configured with cluster access
12+
- OLM v1 (operator-controller) installed in the cluster
13+
- Appropriate RBAC permissions for managing ClusterExtensions and ClusterCatalogs
14+
15+
## Key Concepts
16+
17+
- **ClusterCatalog**: A catalog of available extensions
18+
- **ClusterExtension**: An installed extension in the cluster
19+
- **Channels**: Release channels for extensions (stable, candidate, etc.)
20+
- **Version Constraints**: Semver-based version management
21+
22+
## Commands
23+
24+
### Catalog Management
25+
26+
#### `/olmv1:catalog-add <catalog-name> <image-ref> [--poll-interval <duration>]`
27+
Add a new catalog source to the cluster.
28+
29+
**Example:**
30+
```bash
31+
/olmv1:catalog-add operatorhubio quay.io/operatorhubio/catalog:latest
32+
/olmv1:catalog-add my-catalog registry.example.com/catalog:v1 --poll-interval 1h
33+
```
34+
35+
#### `/olmv1:catalog-list`
36+
List all available catalogs and their status.
37+
38+
**Example:**
39+
```bash
40+
/olmv1:catalog-list
41+
```
42+
43+
### Extension Discovery
44+
45+
#### `/olmv1:search <keyword> [--catalog <catalog-name>]`
46+
Search for available extensions across catalogs.
47+
48+
**Example:**
49+
```bash
50+
/olmv1:search cert-manager
51+
/olmv1:search prometheus --catalog operatorhubio
52+
```
53+
54+
### Extension Installation
55+
56+
#### `/olmv1:install <extension-name> [--version <version>] [--channel <channel>] [--catalog <catalog-name>] [--namespace <namespace>]`
57+
Install an extension with optional version or channel constraints.
58+
59+
**Parameters:**
60+
- `extension-name`: Name of the extension to install (required)
61+
- `--version`: Specific version or version range (e.g., "1.14.5", ">=1.14.0 <1.15.0")
62+
- `--channel`: Channel to track (e.g., "stable", "candidate")
63+
- `--catalog`: Catalog source to use
64+
- `--namespace`: Target namespace for namespaced extensions
65+
66+
**Examples:**
67+
```bash
68+
# Install latest from stable channel
69+
/olmv1:install cert-manager --channel stable
70+
71+
# Install specific version
72+
/olmv1:install argocd-operator --version 0.11.0
73+
74+
# Install with version range
75+
/olmv1:install prometheus-operator --version ">=0.68.0 <0.69.0"
76+
77+
# Install from specific catalog
78+
/olmv1:install my-extension --catalog my-catalog
79+
```
80+
81+
### Extension Management
82+
83+
#### `/olmv1:list [--all-namespaces]`
84+
List all installed extensions with their status.
85+
86+
**Example:**
87+
```bash
88+
/olmv1:list
89+
/olmv1:list --all-namespaces
90+
```
91+
92+
#### `/olmv1:status <extension-name>`
93+
Get detailed status and health information for an installed extension.
94+
95+
**Shows:**
96+
- Installation status and conditions
97+
- Resolved version and channel
98+
- Associated resources (CRDs, deployments, services)
99+
- Recent events and issues
100+
101+
**Example:**
102+
```bash
103+
/olmv1:status cert-manager
104+
```
105+
106+
### Extension Upgrades
107+
108+
#### `/olmv1:upgrade <extension-name> [--version <version>] [--channel <channel>]`
109+
Upgrade an extension using different strategies.
110+
111+
**Strategies:**
112+
- Channel-based: Track a specific channel for automatic updates
113+
- Version pinning: Upgrade to a specific version
114+
- Version range: Allow upgrades within a version range
115+
- Z-stream: Stay within the same minor version
116+
117+
**Examples:**
118+
```bash
119+
# Upgrade to latest in stable channel
120+
/olmv1:upgrade cert-manager --channel stable
121+
122+
# Upgrade to specific version
123+
/olmv1:upgrade argocd-operator --version 0.12.0
124+
125+
# Upgrade within version range (z-stream)
126+
/olmv1:upgrade prometheus-operator --version "~0.68.0"
127+
```
128+
129+
### Extension Removal
130+
131+
#### `/olmv1:uninstall <extension-name>`
132+
Safely uninstall an extension from the cluster.
133+
134+
**Example:**
135+
```bash
136+
/olmv1:uninstall cert-manager
137+
```
138+
139+
## Typical Workflows
140+
141+
### Installing a New Extension
142+
```bash
143+
# 1. Search for the extension
144+
/olmv1:search cert-manager
145+
146+
# 2. Install with desired version/channel
147+
/olmv1:install cert-manager --channel stable
148+
149+
# 3. Verify installation
150+
/olmv1:status cert-manager
151+
152+
# 4. List all installed extensions
153+
/olmv1:list
154+
```
155+
156+
### Managing Upgrades
157+
```bash
158+
# Check current status
159+
/olmv1:status my-extension
160+
161+
# Upgrade to latest in channel
162+
/olmv1:upgrade my-extension --channel stable
163+
164+
# Or pin to specific version
165+
/olmv1:upgrade my-extension --version 2.0.0
166+
167+
# Verify upgrade
168+
/olmv1:status my-extension
169+
```
170+
171+
### Troubleshooting
172+
```bash
173+
# Check extension status and conditions
174+
/olmv1:status <extension-name>
175+
176+
# Check catalog availability
177+
/olmv1:catalog-list
178+
179+
# View all extensions and their health
180+
/olmv1:list
181+
```
182+
183+
## Differences from OLM v0
184+
185+
- **Simpler API**: Uses ClusterExtension and ClusterCatalog instead of Subscription/CSV/InstallPlan
186+
- **Flexible versioning**: Supports semver ranges and version constraints
187+
- **Broader scope**: Manages any Kubernetes extension, not just Operators
188+
- **No automatic upgrades**: Explicit upgrade commands for better control
189+
- **GitOps friendly**: Declarative extension management
190+
191+
## Troubleshooting
192+
193+
Common issues and solutions:
194+
195+
1. **Extension stuck in progressing state**: Check the status for detailed error messages
196+
2. **Catalog not available**: Verify catalog image and network connectivity
197+
3. **Version conflicts**: Use `/olmv1:status` to see resolved dependencies
198+
4. **RBAC issues**: Ensure proper cluster permissions for managing extensions
199+
200+
## Resources
201+
202+
- [OLM v1 Documentation](https://operator-framework.github.io/operator-controller/)
203+
- [OLM v1 GitHub Repository](https://github.com/operator-framework/operator-controller)
204+
- [Migration from OLM v0](https://operator-framework.github.io/operator-controller/concepts/olmv0-to-olmv1/)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Add Catalog Command
2+
3+
You are helping the user add a new catalog source to their OLM v1 enabled cluster.
4+
5+
## Task
6+
7+
Add a ClusterCatalog resource to make extensions available for installation.
8+
9+
## Steps
10+
11+
1. **Gather catalog information**:
12+
- Catalog name (provided by user)
13+
- Image reference (provided by user)
14+
- Optional: Poll interval (default: 15m)
15+
16+
2. **Create ClusterCatalog resource**:
17+
```yaml
18+
apiVersion: olm.operatorframework.io/v1alpha1
19+
kind: ClusterCatalog
20+
metadata:
21+
name: <catalog-name>
22+
spec:
23+
source:
24+
type: Image
25+
image:
26+
ref: <image-ref>
27+
pollInterval: <poll-interval>
28+
```
29+
30+
3. **Apply the resource**:
31+
```bash
32+
kubectl apply -f <catalog-file>
33+
```
34+
35+
4. **Verify catalog availability**:
36+
```bash
37+
kubectl get clustercatalog <catalog-name>
38+
kubectl wait --for=condition=Unpacked clustercatalog/<catalog-name> --timeout=5m
39+
```
40+
41+
5. **Report status**:
42+
- Confirm catalog was added successfully
43+
- Show catalog status and last update time
44+
- Provide next steps (e.g., search for extensions)
45+
46+
## Error Handling
47+
48+
- If catalog image is unreachable, suggest checking image reference and network connectivity
49+
- If catalog fails to unpack, check the ClusterCatalog status conditions for details
50+
- If RBAC errors occur, suggest checking cluster permissions
51+
52+
## Example Output
53+
54+
```
55+
✓ Created ClusterCatalog: my-catalog
56+
✓ Waiting for catalog to unpack...
57+
✓ Catalog ready: my-catalog (Last updated: 2025-10-28T10:30:00Z)
58+
59+
Next steps:
60+
- Search for extensions: /olmv1:search <keyword> --catalog my-catalog
61+
- List all catalogs: /olmv1:catalog-list
62+
```
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# List Catalogs Command
2+
3+
You are helping the user list all available catalogs in their OLM v1 enabled cluster.
4+
5+
## Task
6+
7+
Display all ClusterCatalog resources and their status.
8+
9+
## Steps
10+
11+
1. **List all ClusterCatalogs**:
12+
```bash
13+
kubectl get clustercatalogs
14+
```
15+
16+
2. **Get detailed status**:
17+
```bash
18+
kubectl get clustercatalogs -o wide
19+
```
20+
21+
3. **Format output**:
22+
Show for each catalog:
23+
- Name
24+
- Source image
25+
- Status (Ready, Unpacking, Failed)
26+
- Last updated timestamp
27+
- Number of available packages (if available)
28+
29+
4. **Check for issues**:
30+
- Identify catalogs that are not ready
31+
- Show any error conditions
32+
33+
## Example Output
34+
35+
```
36+
Available Catalogs:
37+
38+
NAME IMAGE STATUS LAST UPDATED
39+
operatorhubio quay.io/operatorhubio/catalog:latest Ready 2025-10-28T09:15:00Z
40+
certified registry.redhat.io/certified:v4.15 Ready 2025-10-28T08:30:00Z
41+
my-catalog registry.example.com/catalog:v1 Ready 2025-10-28T10:00:00Z
42+
43+
Total: 3 catalogs (3 ready, 0 failed)
44+
```

0 commit comments

Comments
 (0)