Skip to content

Commit ca07f8f

Browse files
committed
docs: use operator-managed Typha metrics service
Signed-off-by: Song Duan <dsong.cc@gmail.com> Signed-off-by: clcc2019 <46099295+clcc2019@users.noreply.github.com>
1 parent 3119e8f commit ca07f8f

5 files changed

Lines changed: 35 additions & 80 deletions

File tree

calico/operations/monitor/monitor-component-metrics.mdx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,13 @@ Typha uses **port 9091** TCP by default to publish its metrics. However, if $[pr
248248
<Tabs>
249249
<TabItem label="Operator" value="Operator-8">
250250

251+
When you set `spec.typhaMetricsPort`, the operator automatically creates the `calico-typha-metrics` service in the
252+
`calico-system` namespace. You do not need to create another service.
253+
254+
Verify the operator-managed service:
255+
251256
```bash
252-
kubectl apply -f - <<EOF
253-
apiVersion: v1
254-
kind: Service
255-
metadata:
256-
name: typha-metrics-svc
257-
namespace: calico-system
258-
spec:
259-
clusterIP: None
260-
selector:
261-
k8s-app: calico-typha
262-
ports:
263-
- port: 9093
264-
targetPort: 9093
265-
EOF
257+
kubectl get service calico-typha-metrics -n calico-system
266258
```
267259

268260
</TabItem>
@@ -491,7 +483,7 @@ data:
491483
- role: endpoints
492484
relabel_configs:
493485
- source_labels: [__meta_kubernetes_service_name]
494-
regex: typha-metrics-svc
486+
regex: calico-typha-metrics
495487
replacement: $1
496488
action: keep
497489
- source_labels: [__meta_kubernetes_pod_container_port_name]
@@ -656,7 +648,6 @@ First remove the services by executing the following command:
656648

657649
```bash
658650
kubectl delete service felix-metrics-svc -n calico-system
659-
kubectl delete service typha-metrics-svc -n calico-system
660651
```
661652

662653
If running $[prodnameWindows], also clean up the Windows nodes service:

calico_versioned_docs/version-3.29/operations/monitor/monitor-component-metrics.mdx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,13 @@ Typha uses **port 9091** TCP by default to publish its metrics. However, if $[pr
248248
<Tabs>
249249
<TabItem label="Operator" value="Operator-8">
250250

251+
When you set `spec.typhaMetricsPort`, the operator automatically creates the `calico-typha-metrics` service in the
252+
`calico-system` namespace. You do not need to create another service.
253+
254+
Verify the operator-managed service:
255+
251256
```bash
252-
kubectl apply -f - <<EOF
253-
apiVersion: v1
254-
kind: Service
255-
metadata:
256-
name: typha-metrics-svc
257-
namespace: calico-system
258-
spec:
259-
clusterIP: None
260-
selector:
261-
k8s-app: calico-typha
262-
ports:
263-
- port: 9093
264-
targetPort: 9093
265-
EOF
257+
kubectl get service calico-typha-metrics -n calico-system
266258
```
267259

268260
</TabItem>
@@ -491,7 +483,7 @@ data:
491483
- role: endpoints
492484
relabel_configs:
493485
- source_labels: [__meta_kubernetes_service_name]
494-
regex: typha-metrics-svc
486+
regex: calico-typha-metrics
495487
replacement: $1
496488
action: keep
497489
- source_labels: [__meta_kubernetes_pod_container_port_name]
@@ -656,7 +648,6 @@ First remove the services by executing the following command:
656648

657649
```bash
658650
kubectl delete service felix-metrics-svc -n calico-system
659-
kubectl delete service typha-metrics-svc -n calico-system
660651
```
661652

662653
If running $[prodnameWindows], also clean up the Windows nodes service:

calico_versioned_docs/version-3.30/operations/monitor/monitor-component-metrics.mdx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,13 @@ Typha uses **port 9091** TCP by default to publish its metrics. However, if $[pr
248248
<Tabs>
249249
<TabItem label="Operator" value="Operator-8">
250250

251+
When you set `spec.typhaMetricsPort`, the operator automatically creates the `calico-typha-metrics` service in the
252+
`calico-system` namespace. You do not need to create another service.
253+
254+
Verify the operator-managed service:
255+
251256
```bash
252-
kubectl apply -f - <<EOF
253-
apiVersion: v1
254-
kind: Service
255-
metadata:
256-
name: typha-metrics-svc
257-
namespace: calico-system
258-
spec:
259-
clusterIP: None
260-
selector:
261-
k8s-app: calico-typha
262-
ports:
263-
- port: 9093
264-
targetPort: 9093
265-
EOF
257+
kubectl get service calico-typha-metrics -n calico-system
266258
```
267259

268260
</TabItem>
@@ -491,7 +483,7 @@ data:
491483
- role: endpoints
492484
relabel_configs:
493485
- source_labels: [__meta_kubernetes_service_name]
494-
regex: typha-metrics-svc
486+
regex: calico-typha-metrics
495487
replacement: $1
496488
action: keep
497489
- source_labels: [__meta_kubernetes_pod_container_port_name]
@@ -656,7 +648,6 @@ First remove the services by executing the following command:
656648

657649
```bash
658650
kubectl delete service felix-metrics-svc -n calico-system
659-
kubectl delete service typha-metrics-svc -n calico-system
660651
```
661652

662653
If running $[prodnameWindows], also clean up the Windows nodes service:

calico_versioned_docs/version-3.31/operations/monitor/monitor-component-metrics.mdx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,13 @@ Typha uses **port 9091** TCP by default to publish its metrics. However, if $[pr
248248
<Tabs>
249249
<TabItem label="Operator" value="Operator-8">
250250

251+
When you set `spec.typhaMetricsPort`, the operator automatically creates the `calico-typha-metrics` service in the
252+
`calico-system` namespace. You do not need to create another service.
253+
254+
Verify the operator-managed service:
255+
251256
```bash
252-
kubectl apply -f - <<EOF
253-
apiVersion: v1
254-
kind: Service
255-
metadata:
256-
name: typha-metrics-svc
257-
namespace: calico-system
258-
spec:
259-
clusterIP: None
260-
selector:
261-
k8s-app: calico-typha
262-
ports:
263-
- port: 9093
264-
targetPort: 9093
265-
EOF
257+
kubectl get service calico-typha-metrics -n calico-system
266258
```
267259

268260
</TabItem>
@@ -491,7 +483,7 @@ data:
491483
- role: endpoints
492484
relabel_configs:
493485
- source_labels: [__meta_kubernetes_service_name]
494-
regex: typha-metrics-svc
486+
regex: calico-typha-metrics
495487
replacement: $1
496488
action: keep
497489
- source_labels: [__meta_kubernetes_pod_container_port_name]
@@ -656,7 +648,6 @@ First remove the services by executing the following command:
656648

657649
```bash
658650
kubectl delete service felix-metrics-svc -n calico-system
659-
kubectl delete service typha-metrics-svc -n calico-system
660651
```
661652

662653
If running $[prodnameWindows], also clean up the Windows nodes service:

calico_versioned_docs/version-3.32/operations/monitor/monitor-component-metrics.mdx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,13 @@ Typha uses **port 9091** TCP by default to publish its metrics. However, if $[pr
248248
<Tabs>
249249
<TabItem label="Operator" value="Operator-8">
250250

251+
When you set `spec.typhaMetricsPort`, the operator automatically creates the `calico-typha-metrics` service in the
252+
`calico-system` namespace. You do not need to create another service.
253+
254+
Verify the operator-managed service:
255+
251256
```bash
252-
kubectl apply -f - <<EOF
253-
apiVersion: v1
254-
kind: Service
255-
metadata:
256-
name: typha-metrics-svc
257-
namespace: calico-system
258-
spec:
259-
clusterIP: None
260-
selector:
261-
k8s-app: calico-typha
262-
ports:
263-
- port: 9093
264-
targetPort: 9093
265-
EOF
257+
kubectl get service calico-typha-metrics -n calico-system
266258
```
267259

268260
</TabItem>
@@ -491,7 +483,7 @@ data:
491483
- role: endpoints
492484
relabel_configs:
493485
- source_labels: [__meta_kubernetes_service_name]
494-
regex: typha-metrics-svc
486+
regex: calico-typha-metrics
495487
replacement: $1
496488
action: keep
497489
- source_labels: [__meta_kubernetes_pod_container_port_name]
@@ -656,7 +648,6 @@ First remove the services by executing the following command:
656648

657649
```bash
658650
kubectl delete service felix-metrics-svc -n calico-system
659-
kubectl delete service typha-metrics-svc -n calico-system
660651
```
661652

662653
If running $[prodnameWindows], also clean up the Windows nodes service:

0 commit comments

Comments
 (0)