From a9d74fd2cb29fd8b86984f5a43effba911436e08 Mon Sep 17 00:00:00 2001 From: Vivian Rook <91909295+vivian-rook@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:16:32 -0500 Subject: [PATCH] Install kube-state-metrics (#371) Bug: T355179 --- ansible/paws.yaml | 15 ++++++++++++++ ansible/templates/prometheus-ingress.yaml.j2 | 21 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 ansible/templates/prometheus-ingress.yaml.j2 diff --git a/ansible/paws.yaml b/ansible/paws.yaml index bd761c85..9e12ea8b 100644 --- a/ansible/paws.yaml +++ b/ansible/paws.yaml @@ -70,6 +70,21 @@ - value: controller.config.allow-snippet-annotations=true value_type: string + - name: Prometheus + kubernetes.core.helm: + name: prometheus + chart_ref: prometheus + chart_repo_url: https://prometheus-community.github.io/helm-charts + chart_version: 25.11.0 + release_namespace: metrics + create_namespace: true + + - name: Ingress for prometheus + kubernetes.core.k8s: + state: present + template: "templates/prometheus-ingress.yaml.j2" + namespace: metrics + - name: Add jupyterhub chart repo kubernetes.core.helm_repository: name: jupyterhub diff --git a/ansible/templates/prometheus-ingress.yaml.j2 b/ansible/templates/prometheus-ingress.yaml.j2 new file mode 100644 index 00000000..c371ca5f --- /dev/null +++ b/ansible/templates/prometheus-ingress.yaml.j2 @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: prometheus +spec: + ingressClassName: nginx + rules: +{% if datacenter == 'codfw1dev' %} + - host: prometheus-paws.codfw1dev.wmcloud.org +{% else %} + - host: prometheus-paws.wmcloud.org +{% endif %} + http: + paths: + - backend: + service: + name: prometheus-server + port: + number: 80 + path: / + pathType: Prefix