Skip to content

Commit fe6ab2b

Browse files
Colvin-Ycodex
andcommitted
fix: Skip unavailable custom workload informers
Skip configured custom workload resources when discovery shows the CRD is not served so clean clusters can continue with built-in informers. Refresh README and quickstart docs for v0.1.1, add the topology viewer screenshot and Chinese overview, and include those assets in release archives. Co-Authored-By: OpenAI Codex <noreply@openai.com>
1 parent b0832ea commit fe6ab2b

11 files changed

Lines changed: 671 additions & 394 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ jobs:
5353
-ldflags="-s -w" \
5454
-o "${work}/${cmd}${ext}" "./cmd/${cmd}"
5555
done
56-
cp README.md LICENSE "${work}/"
56+
cp README.md README.zh-CN.md LICENSE "${work}/"
57+
mkdir -p "${work}/docs/assets"
58+
cp docs/assets/topology-viewer.jpg "${work}/docs/assets/"
5759
if [ "${format}" = "zip" ]; then
5860
(cd dist && zip -qr "$(basename "${work}").zip" "$(basename "${work}")")
5961
else

QUICKSTART.md

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
11
# Quick Start
22

3-
This guide starts kubernetes-ontology in the recommended MVP mode:
3+
[Project README](README.md) | [中文说明](README.zh-CN.md)
44

5-
- `kubernetes-ontologyd` runs as the local ontology server.
6-
- `kubernetes-ontology` runs as a standalone CLI client.
7-
- The server reads Kubernetes objects, maintains an in-memory ontology graph, and serves HTTP queries.
8-
- The client queries the server for status, entities, relations, neighbors, and diagnostic subgraphs.
5+
This guide gets `kubernetes-ontology` running in its recommended MVP mode:
96

10-
The server is read-only. It does not create, update, patch, or delete Kubernetes resources.
11-
The open-source MVP is in-memory only: restarting the daemon discards the
12-
current graph and rebuilds it from Kubernetes. Persistent stores and external
13-
graph backends are outside the MVP setup.
7+
- `kubernetes-ontologyd` runs as the ontology server.
8+
- `kubernetes-ontology` runs as the CLI client.
9+
- The server reads Kubernetes objects and maintains an in-memory graph.
10+
- The client queries status, entities, relations, neighbors, and diagnostic
11+
subgraphs through the server.
12+
13+
The server is read-only. It does not create, update, patch, or delete
14+
Kubernetes resources. The MVP stores graph state in memory only: restarting the
15+
daemon rebuilds the graph from the Kubernetes API.
16+
17+
## Choose a Path
18+
19+
| Path | Best for | What runs where |
20+
| ---- | -------- | --------------- |
21+
| Helm + release CLI | Users who want to try the project without compiling Go code | Server and viewer run in Kubernetes. CLI runs on your workstation. |
22+
| Source build | Contributors and local development | Server, CLI, and viewer run from this repository. |
23+
24+
If you are unsure, use the Helm path first. Use the source path when changing
25+
code or testing local patches.
26+
27+
## Contents
28+
29+
- [Prerequisites](#prerequisites)
30+
- [No-Compile Path: Helm + Release CLI](#no-compile-path-helm--release-cli)
31+
- [Source Path](#source-path)
32+
- [Query Examples](#query-examples)
33+
- [Topology Viewer](#topology-viewer)
34+
- [Verification Flow For Changes](#verification-flow-for-changes)
35+
- [Troubleshooting](#troubleshooting)
1436

1537
## Prerequisites
1638

@@ -28,12 +50,13 @@ uses `kubectl port-forward` plus the release CLI binary from your machine.
2850
Set the version and image namespace you want to use:
2951

3052
```bash
31-
export KO_VERSION=v0.1.0
53+
export KO_VERSION=v0.1.1
3254
export KO_IMAGE=ghcr.io/colvin-y/kubernetes-ontology
3355
```
3456

35-
If you publish a fork or a different package namespace, replace `KO_IMAGE` with
36-
your image reference.
57+
Use the `KO_VERSION` value for the release tag you want to install. If you
58+
publish a fork or a different package namespace, replace `KO_IMAGE` with your
59+
image reference.
3760

3861
Install the Helm chart:
3962

@@ -118,13 +141,17 @@ Python:
118141
kubernetes-ontology-viewer --server "http://127.0.0.1:18080"
119142
```
120143

121-
## 1. Build
144+
## Source Path
145+
146+
Use this path when you want to run from a local checkout.
147+
148+
### 1. Build
122149

123150
```bash
124151
make build build-daemon
125152
```
126153

127-
## 2. Create Local Config
154+
### 2. Create Local Config
128155

129156
Create a machine-local YAML config:
130157

@@ -194,6 +221,10 @@ adds display-only controller ownership, such as Kruise workloads being served by
194221
`kruise-controller-manager` and node-local `kruise-daemon` pods.
195222
For `workloadResources.kind`, use the actual Kubernetes ownerReference `kind`
196223
such as `StatefulSet` for Kruise ASTS, not a local nickname.
224+
The example OpenKruise and Redis resources are optional. On a clean kind
225+
cluster without those CRDs installed, the server logs the unavailable custom
226+
resources and skips their informers; remove those entries or install the CRDs
227+
when you want them collected.
197228

198229
The equivalent CLI flags still exist for one-off overrides:
199230

@@ -206,7 +237,7 @@ The equivalent CLI flags still exist for one-off overrides:
206237
The Makefile still accepts `KUBECONFIG=...`, `CLUSTER=...`, and
207238
`CONTEXT_NAMESPACES=...` for one-off runs when `CONFIG` is not used.
208239

209-
## 3. Start the Server
240+
### 3. Start the Server
210241

211242
In terminal 1:
212243

@@ -233,7 +264,7 @@ go run ./cmd/kubernetes-ontologyd \
233264
--disable-polling
234265
```
235266

236-
## 4. Check Server Health
267+
### 4. Check Server Health
237268

238269
In terminal 2:
239270

@@ -259,7 +290,9 @@ Direct CLI:
259290
./bin/kubernetes-ontology --server "http://127.0.0.1:18080" --status
260291
```
261292

262-
## 5. Query Ontology Entities
293+
## Query Examples
294+
295+
### Query Ontology Entities
263296

264297
List pods:
265298

@@ -298,7 +331,7 @@ Resolve one entity with the agent-friendly alias:
298331
--name my-pod
299332
```
300333

301-
## 6. Query Relations and Neighbors
334+
### Query Relations and Neighbors
302335

303336
List outgoing neighbors for an entity:
304337

@@ -354,7 +387,7 @@ Common relation kinds include:
354387
- `managed_by_csi_controller`
355388
- `served_by_csi_node_agent`
356389

357-
## 7. Query Diagnostic Subgraphs
390+
### Query Diagnostic Subgraphs
358391

359392
Diagnose a pod:
360393

@@ -397,7 +430,7 @@ through that ServiceAccount to every other pod using it. Use
397430
`terminalKinds=...` or `expandTerminalNodes=true` on HTTP queries when you need
398431
that deeper fan-out.
399432

400-
## 8. Use HTTP Directly
433+
### Use HTTP Directly
401434

402435
The CLI is a convenience wrapper over the HTTP API:
403436

@@ -427,7 +460,7 @@ For agent workflows that need machine-readable stderr on failures:
427460
--name missing-pod
428461
```
429462

430-
## 9. View the Topology
463+
## Topology Viewer
431464

432465
With `make serve` still running, start the local viewer in another terminal:
433466

@@ -470,7 +503,7 @@ agent workflow, export the viewer state and collapse the same node locally:
470503
make -s collapse-node-graph GRAPH_FILE=/tmp/kubernetes-ontology-visible-topology.json ENTITY_ID='your/entityGlobalId'
471504
```
472505

473-
## 10. Verification Flow For Changes
506+
## Verification Flow For Changes
474507

475508
After every code change, run the fixed local verification flow:
476509

0 commit comments

Comments
 (0)