Skip to content

Commit

Permalink
Changing the namespace for the pod monitors as gateway-namesapce is n…
Browse files Browse the repository at this point in the history
…o longer created with istio being installed by sail

Signed-off-by: R-Lawton <[email protected]>
  • Loading branch information
R-Lawton committed Oct 8, 2024
1 parent bd043cd commit 483227e
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 13 deletions.
1 change: 1 addition & 0 deletions config/observability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ If however you have run `make local-setup` and would like to install the observa
```bash
./bin/kustomize build ./config/observability/| docker run --rm -i docker.io/ryane/kfilt -i kind=CustomResourceDefinition | kubectl apply --server-side -f -
./bin/kustomize build ./config/observability/| docker run --rm -i docker.io/ryane/kfilt -x kind=CustomResourceDefinition | kubectl apply -f -
./bin/kustomize build ./config/observability/prometheus/monitors/envoy | kubectl apply -f -
./bin/kustomize build ./config/thanos | kubectl apply -f -
./bin/kustomize build ./examples/dashboards | kubectl apply -f -
./bin/kustomize build ./examples/alerts | kubectl apply -f -
Expand Down
7 changes: 0 additions & 7 deletions config/observability/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ kind: Kustomization
resources:
- github.com/prometheus-operator/kube-prometheus?ref=release-0.13
- github.com/Kuadrant/gateway-api-state-metrics/config/kuadrant?ref=0.5.0
# To scrape istio metrics, 3 configurations are required:
# 1. Envoy metrics directly from the istio ingress gateway pod
- prometheus/monitors/pod-monitor-envoy.yaml
# 2. Istiod metrics via the istiod service
- prometheus/monitors/service-monitor-istiod.yaml
# 3. Istio metrics exposed via envoy on 15020 in each application.
# We're using the additionalScrapeConfigs field of the Prometheus CR
# here to read existing prometheus scrape annotations on pods.
# Ideally this would be done via another PodMonitor or ServicMonitor,
Expand All @@ -24,7 +18,6 @@ resources:
- prometheus/monitors/service-monitor-authorino-operator.yaml
- prometheus/monitors/service-monitor-dns-operator.yaml

- prometheus/telemetry.yaml

patchesStrategicMerge:
- rbac/cluster_role.yaml
Expand Down
2 changes: 1 addition & 1 deletion config/observability/openshift/telemetry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: telemetry.istio.io/v1alpha1
kind: Telemetry
metadata:
name: namespace-metrics
namespace: gateway-system
namespace: istio-system
spec:
metrics:
- providers:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- pod-monitor-envoy.yaml
- service-monitor.yaml

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: envoy-stats
namespace: envoy-gateway-system
spec:
namespaceSelector:
matchNames:
- gateway-system
- gateway-system
selector:
matchLabels:
app: kuadrant-ingressgateway
podMetricsEndpoints:
- port: http-envoy-prom
path: /stats/prometheus
- port: http-envoy-prom
path: /stats/prometheus

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: envoy-gateway
namespace: envoy-gateway-system
spec:
namespaceSelector:
matchNames:
- envoy-gateway-system
selector:
matchLabels:
control-plane: envoy-gateway
endpoints:
- port: metrics

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- service-monitor-istiod.yaml
- telemetry.yaml

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: istiod
namespace: istio-system
spec:
namespaceSelector:
matchNames:
- gateway-system
- istio-system
selector:
matchLabels:
app: istiod
endpoints:
- port: http-monitoring

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: telemetry.istio.io/v1alpha1
kind: Telemetry
metadata:
name: namespace-metrics
namespace: gateway-system
namespace: istio-system
spec:
metrics:
- providers:
Expand All @@ -26,3 +26,4 @@ spec:
value: "request.host"
request_url_path:
value: "request.url_path"

2 changes: 2 additions & 0 deletions hack/quickstart-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ KUADRANT_CERT_MANAGER_KUSTOMIZATION="${KUADRANT_REPO}/config/dependencies/cert-m
KUADRANT_METALLB_KUSTOMIZATION="${KUADRANT_REPO}/config/metallb?ref=${KUADRANT_REF}"
KUADARNT_THANOS_KUSTOMIZATION="${KUADRANT_REPO}/config/thanos?ref=${KUADRANT_REF}"
KUADARNT_OBSERVABILITY_KUSTOMIZATION="${KUADRANT_REPO}/config/observability?ref=${KUADRANT_REF}"
KUADARNT_OBSERVABILITY_ISTIO_KUSTOMIZATION="${KUADRANT_REPO}/config/observability/prometheus/monitors/istio?ref=${KUADRANT_REF}"
KUADRANT_DASHBOARDS_KUSTOMIZATION="${KUADRANT_REPO}/examples/dashboards?ref=${KUADRANT_REF}"
KUADRANT_ALERTS_KUSTOMIZATION="${KUADRANT_REPO}/examples/alerts?ref=${KUADRANT_REF}"
MGC_REPO="github.com/${KUADRANT_ORG}/multicluster-gateway-controller.git"
Expand Down Expand Up @@ -462,6 +463,7 @@ fi
info "Installing observability stack in ${KUADRANT_CLUSTER_NAME}..."
kubectl kustomize ${KUADARNT_OBSERVABILITY_KUSTOMIZATION} | $CONTAINER_RUNTIME_BIN run --rm -i docker.io/ryane/kfilt -i kind=CustomResourceDefinition | kubectl apply --server-side -f -
kubectl kustomize ${KUADARNT_OBSERVABILITY_KUSTOMIZATION} | $CONTAINER_RUNTIME_BIN run --rm -i docker.io/ryane/kfilt -x kind=CustomResourceDefinition | kubectl apply -f -
kubectl kustomize ${KUADARNT_OBSERVABILITY_ISTIO_KUSTOMIZATION} | kubectl apply --server-side -f -
kubectl kustomize ${KUADRANT_DASHBOARDS_KUSTOMIZATION} | kubectl apply --server-side -f -
kubectl kustomize ${KUADRANT_ALERTS_KUSTOMIZATION} | kubectl apply --server-side -f -
success "observability stack installed successfully."
Expand Down

0 comments on commit 483227e

Please sign in to comment.