Skip to content

Commit

Permalink
feat: ✨ introduce prometheus crd management
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudTA committed Apr 8, 2024
1 parent ed63ff3 commit fc225de
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
6 changes: 6 additions & 0 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
- cloudnativepg
- cnpg

- name: prometheus
tags:
- prometheus
- prom
when: dsc.prometheus.crd.type == 'managed'

- name: keycloak
tags:
- keycloak
Expand Down
16 changes: 16 additions & 0 deletions roles/prometheus/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Installation des CRDs indépendamment du chart helm.
# Recommandé en production.
- name: Download prometheus-operator CRDs
ansible.builtin.uri:
url: https://github.com/prometheus-operator/prometheus-operator/releases/download/{{ dsc.prometheus.crd.version }}/stripped-down-crds.yaml
return_content: true
register: prometheusoperator_crds

- name: Apply CRDs
kubernetes.core.k8s:
state: present
definition: |
{{ prometheusoperator_crds.content |
regex_replace('- =~', "- '=~'") |
regex_replace('- =', "- '='") |
from_yaml_all }}
3 changes: 3 additions & 0 deletions roles/socle-config/files/cr-conf-dso-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
keycloak: {}
nexus:
storageSize: 25Gi
prometheus:
crd:
type: external
proxy:
enabled: false
sonarqube: {}
Expand Down
16 changes: 10 additions & 6 deletions roles/socle-config/files/crd-conf-dso.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,16 @@ spec:
description: Minimal configuration for prometheus CRDs
properties:
crd:
type: string
enum:
- external
- managed
version:
type: string
properties:
type:
type: string
enum:
- external
- managed
default: external
version:
type: string
type: object
type: object
proxy:
description: Proxy configuration for tools.
Expand Down
3 changes: 0 additions & 3 deletions roles/socle-config/files/releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ spec:
nexus:
# https://hub.docker.com/r/sonatype/nexus3/
imageTag: 3.66.0
prometheusoperator:
# https://github.com/prometheus-operator/prometheus-operator/releases
chartVersion: v0.73.0
sonarqube:
# https://artifacthub.io/packages/helm/sonarqube/sonarqube
chartVersion: 10.4.1+2389
Expand Down

0 comments on commit fc225de

Please sign in to comment.