diff --git a/.github/workflows/helm-prometheus-blackbox-exporter.yaml b/.github/workflows/helm-prometheus-blackbox-exporter.yaml new file mode 100644 index 00000000..0a7f1157 --- /dev/null +++ b/.github/workflows/helm-prometheus-blackbox-exporter.yaml @@ -0,0 +1,42 @@ +name: Helm GitHub Actions for Prometheus Blackbox Exporter + +on: + pull_request: + paths: + - base-helm-configs/prometheus-blackbox-exporter/** + - base-kustomize/prometheus-blackbox-exporter/** + - .github/workflows/helm-prometheus-blackbox-exporter.yaml +jobs: + helm: + strategy: + matrix: + overlays: + - base + name: Helm + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: azure/setup-helm@v3 + with: + version: latest + token: "${{ secrets.GITHUB_TOKEN }}" + id: helm + - name: Add prometheus-community repo to helm + run: | + ${{ steps.helm.outputs.helm-path }} repo add prometheus-community https://prometheus-community.github.io/helm-charts + ${{ steps.helm.outputs.helm-path }} repo update + - name: Run Helm Template + run: | + ${{ steps.helm.outputs.helm-path }} template prometheus-blackbox-exporter prometheus-community/prometheus-blackbox-exporter \ + --create-namespace \ + --namespace=prometheus \ + -f ${{ github.workspace }}//base-helm-configs/prometheus-blackbox-exporter/values.yaml \ + -f ${{ github.workspace }}//base-helm-configs/prometheus-blackbox-exporter/probe_targets.yaml \ + --post-renderer ${{ github.workspace }}/base-kustomize/kustomize.sh \ + --post-renderer-args prometheus-blackbox-exporter/${{ matrix.overlays }} > /tmp/rendered.yaml + - name: Return helm Build + uses: actions/upload-artifact@v4 + with: + name: helm-prometheus-artifact-${{ matrix.overlays }} + path: /tmp/rendered.yaml diff --git a/.github/workflows/helm-prometheus-mysql-exporter.yaml b/.github/workflows/helm-prometheus-mysql-exporter.yaml new file mode 100644 index 00000000..f6703547 --- /dev/null +++ b/.github/workflows/helm-prometheus-mysql-exporter.yaml @@ -0,0 +1,41 @@ +name: Helm GitHub Actions for Prometheus MySQL Exporter + +on: + pull_request: + paths: + - base-helm-configs/prometheus-mysql-exporter/** + - base-kustomize/prometheus-mysql-exporter/** + - .github/workflows/helm-prometheus-mysql-exporter.yaml +jobs: + helm: + strategy: + matrix: + overlays: + - base + name: Helm + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: azure/setup-helm@v3 + with: + version: latest + token: "${{ secrets.GITHUB_TOKEN }}" + id: helm + - name: Add prometheus-community repo to helm + run: | + ${{ steps.helm.outputs.helm-path }} repo add prometheus-community https://prometheus-community.github.io/helm-charts + ${{ steps.helm.outputs.helm-path }} repo update + - name: Run Helm Template + run: | + ${{ steps.helm.outputs.helm-path }} template prometheus-mysql-exporter prometheus-community/prometheus-mysql-exporter \ + --create-namespace \ + --namespace=prometheus \ + -f ${{ github.workspace }}//base-helm-configs/prometheus-mysql-exporter/values.yaml \ + --post-renderer ${{ github.workspace }}/base-kustomize/kustomize.sh \ + --post-renderer-args prometheus-mysql-exporter/${{ matrix.overlays }} > /tmp/rendered.yaml + - name: Return helm Build + uses: actions/upload-artifact@v4 + with: + name: helm-prometheus-artifact-${{ matrix.overlays }} + path: /tmp/rendered.yaml diff --git a/.github/workflows/helm-prometheus-postgres-exporter.yaml b/.github/workflows/helm-prometheus-postgres-exporter.yaml new file mode 100644 index 00000000..0e4f509c --- /dev/null +++ b/.github/workflows/helm-prometheus-postgres-exporter.yaml @@ -0,0 +1,41 @@ +name: Helm GitHub Actions for Prometheus Postgres Exporter + +on: + pull_request: + paths: + - base-helm-configs/prometheus-postgres-exporter/** + - base-kustomize/prometheus-postgres-exporter/** + - .github/workflows/helm-prometheus-postgres-exporter.yaml +jobs: + helm: + strategy: + matrix: + overlays: + - base + name: Helm + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: azure/setup-helm@v3 + with: + version: latest + token: "${{ secrets.GITHUB_TOKEN }}" + id: helm + - name: Add prometheus-community repo to helm + run: | + ${{ steps.helm.outputs.helm-path }} repo add prometheus-community https://prometheus-community.github.io/helm-charts + ${{ steps.helm.outputs.helm-path }} repo update + - name: Run Helm Template + run: | + ${{ steps.helm.outputs.helm-path }} template prometheus prometheus-community/prometheus-postgres-exporter \ + --create-namespace \ + --namespace=prometheus \ + -f ${{ github.workspace }}//base-helm-configs/prometheus-postgres-exporter/values.yaml \ + --post-renderer ${{ github.workspace }}/base-kustomize/kustomize.sh \ + --post-renderer-args prometheus-postgres-exporter/${{ matrix.overlays }} > /tmp/rendered.yaml + - name: Return helm Build + uses: actions/upload-artifact@v4 + with: + name: helm-prometheus-artifact-${{ matrix.overlays }} + path: /tmp/rendered.yaml diff --git a/.github/workflows/helm-prometheus-pushgateway.yaml b/.github/workflows/helm-prometheus-pushgateway.yaml new file mode 100644 index 00000000..20e94f38 --- /dev/null +++ b/.github/workflows/helm-prometheus-pushgateway.yaml @@ -0,0 +1,41 @@ +name: Helm GitHub Actions for Prometheus Pushgateway + +on: + pull_request: + paths: + - base-helm-configs/prometheus-pushgateway/** + - base-kustomize/prometheus-pushgateway/** + - .github/workflows/helm-prometheus-pushgateway.yaml +jobs: + helm: + strategy: + matrix: + overlays: + - base + name: Helm + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: azure/setup-helm@v3 + with: + version: latest + token: "${{ secrets.GITHUB_TOKEN }}" + id: helm + - name: Add prometheus-community repo to helm + run: | + ${{ steps.helm.outputs.helm-path }} repo add prometheus-community https://prometheus-community.github.io/helm-charts + ${{ steps.helm.outputs.helm-path }} repo update + - name: Run Helm Template + run: | + ${{ steps.helm.outputs.helm-path }} template prometheus-pushgateway prometheus-community/prometheus-pushgateway \ + --create-namespace \ + --namespace=prometheus \ + -f ${{ github.workspace }}//base-helm-configs/prometheus-pushgateway/values.yaml \ + --post-renderer ${{ github.workspace }}/base-kustomize/kustomize.sh \ + --post-renderer-args prometheus-pushgateway/${{ matrix.overlays }} > /tmp/rendered.yaml + - name: Return helm Build + uses: actions/upload-artifact@v4 + with: + name: helm-prometheus-artifact-${{ matrix.overlays }} + path: /tmp/rendered.yaml diff --git a/.github/workflows/helm-prometheus-rabbitmq-exporter.yaml b/.github/workflows/helm-prometheus-rabbitmq-exporter.yaml new file mode 100644 index 00000000..c6b5b131 --- /dev/null +++ b/.github/workflows/helm-prometheus-rabbitmq-exporter.yaml @@ -0,0 +1,41 @@ +name: Helm GitHub Actions for Prometheus RabbitMQ Exporter + +on: + pull_request: + paths: + - base-helm-configs/prometheus-rabbitmq-exporter/** + - base-kustomize/prometheus-rabbitmq-exporter/** + - .github/workflows/helm-prometheus-rabbitmq-exporter.yaml +jobs: + helm: + strategy: + matrix: + overlays: + - base + name: Helm + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: azure/setup-helm@v3 + with: + version: latest + token: "${{ secrets.GITHUB_TOKEN }}" + id: helm + - name: Add prometheus-community repo to helm + run: | + ${{ steps.helm.outputs.helm-path }} repo add prometheus-community https://prometheus-community.github.io/helm-charts + ${{ steps.helm.outputs.helm-path }} repo update + - name: Run Helm Template + run: | + ${{ steps.helm.outputs.helm-path }} template prometheus-rabbitmq-exporter prometheus-community/prometheus-rabbitmq-exporter \ + --create-namespace \ + --namespace=openstack \ + -f ${{ github.workspace }}//base-helm-configs/prometheus-rabbitmq-exporter/values.yaml \ + --post-renderer ${{ github.workspace }}/base-kustomize/kustomize.sh \ + --post-renderer-args prometheus-rabbitmq-exporter/${{ matrix.overlays }} > /tmp/rendered.yaml + - name: Return helm Build + uses: actions/upload-artifact@v4 + with: + name: helm-prometheus-artifact-${{ matrix.overlays }} + path: /tmp/rendered.yaml diff --git a/.github/workflows/kustomize-prometheus-mysql-exporter.yaml b/.github/workflows/kustomize-prometheus-mysql-exporter.yaml deleted file mode 100644 index 90be0782..00000000 --- a/.github/workflows/kustomize-prometheus-mysql-exporter.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Kustomize GitHub Actions for Prometheus MySql Exporter - -on: - pull_request: - paths: - - base-kustomize/prometheus-mysql-exporter/** - - .github/workflows/kustomize-prometheus-mysql-exporter.yaml -jobs: - kustomize: - name: Kustomize - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: azure/setup-helm@v3 - with: - version: latest - token: "${{ secrets.GITHUB_TOKEN }}" - id: helm - - name: Kustomize Install - working-directory: /usr/local/bin/ - run: | - if [ ! -f /usr/local/bin/kustomize ]; then - curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | sudo bash - fi - - name: Run Kustomize Build - run: | - kustomize build base-kustomize/prometheus-mysql-exporter/ --enable-helm --helm-command ${{ steps.helm.outputs.helm-path }} > /tmp/rendered.yaml - - name: Return Kustomize Build - uses: actions/upload-artifact@v4 - with: - name: kustomize-prometheus-mysql-exporter-artifact - path: /tmp/rendered.yaml diff --git a/.github/workflows/kustomize-prometheus-postgres-exporter.yaml b/.github/workflows/kustomize-prometheus-postgres-exporter.yaml deleted file mode 100644 index ca931d03..00000000 --- a/.github/workflows/kustomize-prometheus-postgres-exporter.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Kustomize GitHub Actions for Prometheus PostgresSQL exporter - -on: - pull_request: - paths: - - base-kustomize/prometheus-postgres-exporter/** - - .github/workflows/kustomize-prometheus-postgres-exporter.yaml -jobs: - kustomize: - name: Kustomize - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: azure/setup-helm@v3 - with: - version: latest - token: "${{ secrets.GITHUB_TOKEN }}" - id: helm - - name: Kustomize Install - working-directory: /usr/local/bin/ - run: | - if [ ! -f /usr/local/bin/kustomize ]; then - curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | sudo bash - fi - - name: Run Kustomize Build - run: | - kustomize build base-kustomize/prometheus-postgres-exporter/ --enable-helm --helm-command ${{ steps.helm.outputs.helm-path }} > /tmp/rendered.yaml - - name: Return Kustomize Build - uses: actions/upload-artifact@v4 - with: - name: kustomize-prometheus-postgres-exporter-artifact - path: /tmp/rendered.yaml diff --git a/.github/workflows/kustomize-prometheus-rabbitmq-exporter.yaml b/.github/workflows/kustomize-prometheus-rabbitmq-exporter.yaml deleted file mode 100644 index c6154147..00000000 --- a/.github/workflows/kustomize-prometheus-rabbitmq-exporter.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Kustomize GitHub Actions for Prometheus Rabbitmq exporter - -on: - pull_request: - paths: - - base-kustomize/prometheus-rabbitmq-exporter/** - - .github/workflows/kustomize-prometheus-rabbitmq-exporter.yaml -jobs: - kustomize: - name: Kustomize - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: azure/setup-helm@v3 - with: - version: latest - token: "${{ secrets.GITHUB_TOKEN }}" - id: helm - - name: Kustomize Install - working-directory: /usr/local/bin/ - run: | - if [ ! -f /usr/local/bin/kustomize ]; then - curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | sudo bash - fi - - name: Run Kustomize Build - run: | - kustomize build base-kustomize/prometheus-rabbitmq-exporter/ --enable-helm --helm-command ${{ steps.helm.outputs.helm-path }} > /tmp/rendered.yaml - - name: Return Kustomize Build - uses: actions/upload-artifact@v4 - with: - name: kustomize-prometheus-rabbitmq-exporter-artifact - path: /tmp/rendered.yaml diff --git a/base-kustomize/prometheus-blackbox-exporter/probe_targets.yaml b/base-helm-configs/prometheus-blackbox-exporter/probe_targets.yaml similarity index 100% rename from base-kustomize/prometheus-blackbox-exporter/probe_targets.yaml rename to base-helm-configs/prometheus-blackbox-exporter/probe_targets.yaml diff --git a/base-kustomize/prometheus-blackbox-exporter/values.yaml b/base-helm-configs/prometheus-blackbox-exporter/values.yaml similarity index 100% rename from base-kustomize/prometheus-blackbox-exporter/values.yaml rename to base-helm-configs/prometheus-blackbox-exporter/values.yaml diff --git a/base-kustomize/prometheus-mysql-exporter/values.yaml b/base-helm-configs/prometheus-mysql-exporter/values.yaml similarity index 100% rename from base-kustomize/prometheus-mysql-exporter/values.yaml rename to base-helm-configs/prometheus-mysql-exporter/values.yaml diff --git a/base-kustomize/prometheus-postgres-exporter/values.yaml b/base-helm-configs/prometheus-postgres-exporter/values.yaml similarity index 100% rename from base-kustomize/prometheus-postgres-exporter/values.yaml rename to base-helm-configs/prometheus-postgres-exporter/values.yaml diff --git a/base-kustomize/prometheus-pushgateway/values.yaml b/base-helm-configs/prometheus-pushgateway/values.yaml similarity index 100% rename from base-kustomize/prometheus-pushgateway/values.yaml rename to base-helm-configs/prometheus-pushgateway/values.yaml diff --git a/base-kustomize/prometheus-rabbitmq-exporter/values.yaml b/base-helm-configs/prometheus-rabbitmq-exporter/values.yaml similarity index 100% rename from base-kustomize/prometheus-rabbitmq-exporter/values.yaml rename to base-helm-configs/prometheus-rabbitmq-exporter/values.yaml diff --git a/base-kustomize/prometheus-blackbox-exporter/base/kustomization.yaml b/base-kustomize/prometheus-blackbox-exporter/base/kustomization.yaml new file mode 100644 index 00000000..10663bac --- /dev/null +++ b/base-kustomize/prometheus-blackbox-exporter/base/kustomization.yaml @@ -0,0 +1,4 @@ +sortOptions: + order: fifo +resources: + - all.yaml diff --git a/base-kustomize/prometheus-blackbox-exporter/kustomization.yaml b/base-kustomize/prometheus-blackbox-exporter/kustomization.yaml deleted file mode 100644 index 915a87c9..00000000 --- a/base-kustomize/prometheus-blackbox-exporter/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -helmCharts: - - name: prometheus-blackbox-exporter - repo: https://prometheus-community.github.io/helm-charts - releaseName: prometheus-blackbox-exporter - namespace: prometheus - includeCRDs: true - valuesFile: values.yaml - additionalValuesFiles: - - probe_targets.yaml diff --git a/base-kustomize/prometheus-mysql-exporter/base/kustomization.yaml b/base-kustomize/prometheus-mysql-exporter/base/kustomization.yaml new file mode 100644 index 00000000..174691a5 --- /dev/null +++ b/base-kustomize/prometheus-mysql-exporter/base/kustomization.yaml @@ -0,0 +1,6 @@ +sortOptions: + order: fifo +resources: + - monitoring_user_create.yaml + - monitoring_user_grant.yaml + - all.yaml diff --git a/base-kustomize/prometheus-mysql-exporter/monitoring_user_create.yaml b/base-kustomize/prometheus-mysql-exporter/base/monitoring_user_create.yaml similarity index 100% rename from base-kustomize/prometheus-mysql-exporter/monitoring_user_create.yaml rename to base-kustomize/prometheus-mysql-exporter/base/monitoring_user_create.yaml diff --git a/base-kustomize/prometheus-mysql-exporter/monitoring_user_grant.yaml b/base-kustomize/prometheus-mysql-exporter/base/monitoring_user_grant.yaml similarity index 100% rename from base-kustomize/prometheus-mysql-exporter/monitoring_user_grant.yaml rename to base-kustomize/prometheus-mysql-exporter/base/monitoring_user_grant.yaml diff --git a/base-kustomize/prometheus-mysql-exporter/kustomization.yaml b/base-kustomize/prometheus-mysql-exporter/kustomization.yaml deleted file mode 100644 index 2ad796fa..00000000 --- a/base-kustomize/prometheus-mysql-exporter/kustomization.yaml +++ /dev/null @@ -1,13 +0,0 @@ -sortOptions: - order: fifo -resources: - - monitoring_user_create.yaml - - monitoring_user_grant.yaml - -helmCharts: - - name: prometheus-mysql-exporter - repo: https://prometheus-community.github.io/helm-charts - releaseName: prometheus-mysql-exporter - namespace: openstack - includeCRDs: true - valuesFile: values.yaml diff --git a/base-kustomize/prometheus-postgres-exporter/base/kustomization.yaml b/base-kustomize/prometheus-postgres-exporter/base/kustomization.yaml new file mode 100644 index 00000000..10663bac --- /dev/null +++ b/base-kustomize/prometheus-postgres-exporter/base/kustomization.yaml @@ -0,0 +1,4 @@ +sortOptions: + order: fifo +resources: + - all.yaml diff --git a/base-kustomize/prometheus-postgres-exporter/kustomization.yaml b/base-kustomize/prometheus-postgres-exporter/kustomization.yaml deleted file mode 100644 index 4461e2c4..00000000 --- a/base-kustomize/prometheus-postgres-exporter/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -helmCharts: - - name: prometheus-postgres-exporter - repo: https://prometheus-community.github.io/helm-charts - releaseName: prometheus-postgres-exporter - namespace: openstack - version: 6.0.0 - includeCRDs: true - valuesFile: values.yaml diff --git a/base-kustomize/prometheus-pushgateway/base/kustomization.yaml b/base-kustomize/prometheus-pushgateway/base/kustomization.yaml new file mode 100644 index 00000000..10663bac --- /dev/null +++ b/base-kustomize/prometheus-pushgateway/base/kustomization.yaml @@ -0,0 +1,4 @@ +sortOptions: + order: fifo +resources: + - all.yaml diff --git a/base-kustomize/prometheus-pushgateway/kustomization.yaml b/base-kustomize/prometheus-pushgateway/kustomization.yaml deleted file mode 100644 index 1f589cd6..00000000 --- a/base-kustomize/prometheus-pushgateway/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -helmCharts: - - name: prometheus-pushgateway - repo: https://prometheus-community.github.io/helm-charts - releaseName: prometheus-pushgateway - namespace: prometheus - includeCRDs: true - valuesFile: values.yaml diff --git a/base-kustomize/prometheus-rabbitmq-exporter/base/kustomization.yaml b/base-kustomize/prometheus-rabbitmq-exporter/base/kustomization.yaml new file mode 100644 index 00000000..10663bac --- /dev/null +++ b/base-kustomize/prometheus-rabbitmq-exporter/base/kustomization.yaml @@ -0,0 +1,4 @@ +sortOptions: + order: fifo +resources: + - all.yaml diff --git a/base-kustomize/prometheus-rabbitmq-exporter/kustomization.yaml b/base-kustomize/prometheus-rabbitmq-exporter/kustomization.yaml deleted file mode 100644 index 86e8e10f..00000000 --- a/base-kustomize/prometheus-rabbitmq-exporter/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -helmCharts: - - name: prometheus-rabbitmq-exporter - repo: https://prometheus-community.github.io/helm-charts - releaseName: prometheus-rabbitmq-exporter - version: 1.11.0 - includeCRDs: true - valuesFile: values.yaml diff --git a/docs/prometheus-blackbox-exporter.md b/docs/prometheus-blackbox-exporter.md index ce458a7f..0e857c08 100644 --- a/docs/prometheus-blackbox-exporter.md +++ b/docs/prometheus-blackbox-exporter.md @@ -8,7 +8,7 @@ The blackbox exporter ideally would be ran outside the cluster but can still pro ``` shell -kubectl kustomize --enable-helm /etc/genestack/kustomize/prometheus-blackbox-exporter | kubectl apply -f - +bin/install-chart.sh prometheus-blackbox-exporter ``` !!! success diff --git a/docs/prometheus-mysql-exporter.md b/docs/prometheus-mysql-exporter.md index e3963fbe..0e661998 100644 --- a/docs/prometheus-mysql-exporter.md +++ b/docs/prometheus-mysql-exporter.md @@ -22,8 +22,7 @@ kubectl --namespace openstack \ Next, install the exporter ``` shell -kubectl kustomize --enable-helm /etc/genestack/kustomize/prometheus-mysql-exporter | \ - kubectl --namespace openstack apply --server-side -f - +bin/install-chart.sh prometheus-mysql-exporter ``` !!! success diff --git a/docs/prometheus-postgres-exporter.md b/docs/prometheus-postgres-exporter.md index e11db1b6..c9a0bb4c 100644 --- a/docs/prometheus-postgres-exporter.md +++ b/docs/prometheus-postgres-exporter.md @@ -11,8 +11,7 @@ PostgresSQL Exporter is used to expose metrics from a running PostgresSQL deploy Install the PostgresSQL Exporter ``` shell -kubectl kustomize --enable-helm /etc/genestack/kustomize/prometheus-postgres-exporter | \ - kubectl --namespace openstack apply --server-side -f - +bin/install-chart.sh prometheus-postgres-exporter ``` !!! success diff --git a/docs/prometheus-pushgateway.md b/docs/prometheus-pushgateway.md index 9985c180..63b975f6 100644 --- a/docs/prometheus-pushgateway.md +++ b/docs/prometheus-pushgateway.md @@ -11,7 +11,7 @@ the OVN backup _CronJob_. ``` shell -kubectl kustomize --enable-helm /etc/genestack/kustomize/prometheus-pushgateway | kubectl apply -f - +bin/install-chart.sh prometheus-pushgateway ``` !!! success diff --git a/docs/prometheus-rabbitmq-exporter.md b/docs/prometheus-rabbitmq-exporter.md index 11a1d314..1c30f68a 100644 --- a/docs/prometheus-rabbitmq-exporter.md +++ b/docs/prometheus-rabbitmq-exporter.md @@ -11,8 +11,7 @@ RabbitMQ Exporter is used to expose metrics from a running RabbitMQ deployment. Install the RabbitMQ Exporter ``` shell -kubectl kustomize --enable-helm /etc/genestack/kustomize/prometheus-rabbitmq-exporter | \ - kubectl --namespace openstack apply --server-side -f - +bin/install-chart.sh prometheus-rabbitmq-exporter ``` !!! success