Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/cni-readiness/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ This example demonstrates how to use the Node Readiness Controller to ensure nod
3. The `NodeReadinessRule` (`network-readiness-rule.yaml`) instructs the controller to remove the startup taint once the `projectcalico.org/CalicoReady` condition becomes `True`.
4. The reporter is deployed with `hostNetwork: true` to reach Calico's local health endpoint.
5. The reporter needs a dedicated ServiceAccount (`cni-reporter`) with permissions to patch node status.
6. The reporter exposes Prometheus metrics on port `9445` (`/metrics`). An optional `PodMonitor` (`cni-reporter-podmonitor.yaml`) is included for prometheus-operator users and can be applied separately with `kubectl apply -f cni-reporter-podmonitor.yaml`. Since the DaemonSet runs with `hostNetwork: true`, the metrics endpoint is exposed on the host network, not just inside the cluster.
5 changes: 5 additions & 0 deletions examples/cni-readiness/cni-reporter-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
metadata:
labels:
app: cni-reporter
example: cni-readiness
spec:
hostNetwork: true
Comment thread
rawadhossain marked this conversation as resolved.
serviceAccountName: cni-reporter
Expand All @@ -35,6 +36,10 @@ spec:
capabilities:
drop:
- "ALL"
ports:
- name: metrics
containerPort: 9445
protocol: TCP
env:
- name: NODE_NAME
valueFrom:
Expand Down
18 changes: 18 additions & 0 deletions examples/cni-readiness/cni-reporter-podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Optional: enables Prometheus Operator to scrape metrics from the CNI Reporter.
# Requires prometheus-operator and a Prometheus instance configured to watch this PodMonitor.
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: cni-readiness-reporter
namespace: kube-system
labels:
app: cni-reporter
spec:
selector:
matchLabels:
app: cni-reporter
example: cni-readiness
podMetricsEndpoints:
- port: metrics
path: /metrics
interval: 60s
5 changes: 5 additions & 0 deletions examples/constrained-impersonation/reporter-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
metadata:
labels:
app: cni-reporter
example: constrained-impersonation
spec:
hostNetwork: true
serviceAccountName: cni-reporter
Expand All @@ -35,6 +36,10 @@ spec:
capabilities:
drop:
- "ALL"
ports:
- name: metrics
containerPort: 9445
protocol: TCP
env:
- name: NODE_NAME
valueFrom:
Expand Down
18 changes: 18 additions & 0 deletions examples/constrained-impersonation/reporter-podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Optional: enables Prometheus Operator to scrape metrics from the Reporter.
# Requires prometheus-operator and a Prometheus instance configured to watch this PodMonitor.
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: constrained-impersonation-reporter
namespace: kube-system
labels:
app: cni-reporter
spec:
selector:
matchLabels:
app: cni-reporter
example: constrained-impersonation
podMetricsEndpoints:
- port: metrics
path: /metrics
interval: 60s
Loading