Skip to content

Commit 05d5a33

Browse files
author
Arvind Thirumurugan
committed
fix READMEs
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
1 parent 9dd8499 commit 05d5a33

File tree

4 files changed

+112
-634
lines changed

4 files changed

+112
-634
lines changed

approval-controller-metric-collector/approval-request-controller/README.md

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,67 @@ helm install approval-request-controller ./charts/approval-request-controller \
5555

5656
## Configuration
5757

58-
Key settings:
59-
- `controller.logLevel`: Log verbosity (default: 2)
60-
- `controller.resources`: Resource requests and limits
61-
- `rbac.create`: Create RBAC resources (default: true)
62-
- `crds.install`: Install MetricCollector, MetricCollectorReport, and WorkloadTracker CRDs (default: true)
63-
- `rbac.create`: Create RBAC resources (default: true)
64-
- `crds.install`: Install MetricCollector and MetricCollectorReport CRDs (default: true)
58+
The controller watches for:
59+
- `ApprovalRequest` (namespaced)
60+
- `ClusterApprovalRequest` (cluster-scoped)
6561

66-
## Development
62+
Both resources from kubefleet are monitored, and the controller creates `MetricCollector` resources on appropriate member clusters based on the staged update configuration.
6763

68-
### Build
64+
### Health Check Interval
6965

70-
```bash
71-
make docker-build
66+
The controller checks workload health every **15 seconds**. This interval is configurable via the `reconcileInterval` parameter in the Helm chart.
67+
68+
## API Reference
69+
70+
### WorkloadTracker
71+
72+
`WorkloadTracker` is a cluster-scoped custom resource that defines which workloads the approval controller should monitor for health metrics before auto-approving staged rollouts.
73+
74+
#### Example: Single Workload
75+
76+
```yaml
77+
apiVersion: placement.kubernetes-fleet.io/v1beta1
78+
kind: WorkloadTracker
79+
metadata:
80+
name: sample-workload-tracker
81+
workloads:
82+
- name: sample-metric-app
83+
namespace: test-ns
7284
```
7385
74-
### Test Locally
86+
#### Example: Multiple Workloads
87+
88+
```yaml
89+
apiVersion: placement.kubernetes-fleet.io/v1beta1
90+
kind: WorkloadTracker
91+
metadata:
92+
name: multi-workload-tracker
93+
workloads:
94+
- name: frontend
95+
namespace: production
96+
- name: backend-api
97+
namespace: production
98+
- name: worker-service
99+
namespace: production
100+
```
75101
76-
```bash
77-
go run ./cmd/approvalrequestcontroller/main.go
102+
#### Usage Notes
103+
104+
- **Cluster-scoped:** WorkloadTracker is a cluster-scoped resource, not namespaced
105+
- **Optional:** If no WorkloadTracker exists, the controller will skip health checks and won't auto-approve
106+
- **Single instance:** The controller expects one WorkloadTracker per cluster and uses the first one found
107+
- **Health criteria:** All workloads listed must report healthy (metric value = 1.0) before approval
108+
- **Prometheus metrics:** Each workload should expose `workload_health` metrics that the MetricCollector can query
109+
110+
For a complete example, see: [`./examples/workloadtracker/workloadtracker.yaml`](./examples/workloadtracker/workloadtracker.yaml)
111+
112+
## Additional Resources
113+
114+
- **Main Tutorial:** See [`../README.md`](../README.md) for a complete end-to-end tutorial on setting up automated staged rollouts with approval automation
115+
- **Metric Collector:** See [`../metric-collector/README.md`](../metric-collector/README.md) for details on the metric collection component that runs on member clusters
116+
- **KubeFleet Documentation:** [Azure/fleet](https://github.com/Azure/fleet) - Multi-cluster orchestration platform
117+
- **Example Configurations:**
118+
- [`./examples/workloadtracker/`](./examples/workloadtracker/) - WorkloadTracker resource examples
119+
- [`./examples/stagedupdaterun/`](./examples/stagedupdaterun/) - Staged update configuration examples
120+
- [`./examples/prometheus/`](./examples/prometheus/) - Prometheus deployment and configuration for metric collection
78121
```

approval-controller-metric-collector/metric-collector/HUB_SETUP.md

Lines changed: 0 additions & 212 deletions
This file was deleted.

0 commit comments

Comments
 (0)