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
6 changes: 6 additions & 0 deletions Makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ deploy-external-dns:
deploy-metrics-server:
helm upgrade -i --repo https://kubernetes-sigs.github.io/metrics-server metrics-server metrics-server --version 3.8.3 -n kube-system --set args={--kubelet-insecure-tls}

#################
.PHONY: deploy-kube-state-metrics
deploy-kube-state-metrics:
helm upgrade -i --repo https://prometheus-community.github.io/helm-charts prometheus-operator-crds prometheus-operator-crds --version 4.0.2
helm upgrade -i --repo https://prometheus-community.github.io/helm-charts kube-state-metrics kube-state-metrics --version 5.7.0 -n kube-system --values test-data/kube-state-metrics-values.yaml

#################
# https://kind.sigs.k8s.io/docs/user/loadbalancer/
.PHONY: deploy-metallb
Expand Down
108 changes: 108 additions & 0 deletions test-data/kube-state-metrics-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 10m
memory: 32Mi

prometheus:
monitor:
enabled: true

rbac:
extraRules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["list", "watch"]
- apiGroups: ["gateway.networking.k8s.io"]
resources: ["*"]
verbs: ["list", "watch"]

extraArgs:
- --custom-resource-state-config
- |
spec:
resources:
- groupVersionKind:
group: gateway.networking.k8s.io
version: "v1beta1"
kind: GatewayClass
metricNamePrefix: "gatewayapi"
labelsFromPath:
name: ["metadata", "name"]
namespace: ["metadata", "namespace"]
controllerName: ["spec", "controllerName"]
metrics:
- name: gatewayclass_conditions
help: "GatewayClass conditions"
each:
type: Gauge
gauge:
path: ["status", "conditions"]
labelsFromPath:
type: ["type"]
valueFrom: ["status"]
# Zombie GatewayClasses can be detected by comparing `gatewayclass_conditions` with this
- name: gatewayclass_info
help: "GatewayClass info"
each:
type: Info
info:
labelsFromPath:
classname: ["spec", "controllerName"]
- groupVersionKind:
group: gateway.networking.k8s.io
version: "v1beta1"
kind: Gateway
metricNamePrefix: "gatewayapi"
labelsFromPath:
name: ["metadata", "name"]
namespace: ["metadata", "namespace"]
classname: ["spec", "gatewayClassName"]
metrics:
- name: gateway_conditions
help: "Gateway conditions"
each:
type: Gauge
gauge:
path: ["status", "conditions"]
labelsFromPath:
type: ["type"]
valueFrom: ["status"]
# Zombie Gateways can be detected by comparing `gateway_conditions` with this
- name: gateway_info
help: "Gateway info"
each:
type: Info
info:
labelsFromPath:
classname: ["spec", "gatewayClassName"]
- groupVersionKind:
group: gateway.networking.k8s.io
version: "v1beta1"
kind: HTTPRoute
metricNamePrefix: "gatewayapi"
labelsFromPath:
name: ["metadata", "name"]
namespace: ["metadata", "namespace"]
metrics:
- name: httproute_conditions
help: "HTTPRoute conditions"
each:
type: Gauge
gauge:
# This will not work for HTTPRoutes attached to multiple parents
path: ["status", "parents", "0", "conditions"]
labelsFromPath:
type: ["type"]
valueFrom: ["status"]
# Zombie HTTPRoutes can be detected by comparing `httproute_conditions` with this
- name: httproute_info
help: "HTTPRoute "
each:
type: Info
info:
labelsFromPath:
classname: ["spec", "parentRefs", "0"]
- --custom-resource-state-only=true