diff --git a/.github/configs/updatecli.d/grafana-agent.yaml b/.github/configs/updatecli.d/grafana-agent.yaml new file mode 100644 index 000000000..8d6340779 --- /dev/null +++ b/.github/configs/updatecli.d/grafana-agent.yaml @@ -0,0 +1,39 @@ +name: Bump dependency "grafana-agent" for Helm chart "k8s-monitoring" +sources: + grafana-agent: + name: Get latest "grafana-agent" Helm chart version + kind: helmchart + spec: + name: grafana-agent + url: https://grafana.github.io/helm-charts + versionfilter: + kind: semver + pattern: '*' +conditions: + grafana-agent: + name: Ensure Helm chart dependency "grafana-agent" is specified + kind: yaml + spec: + file: charts/k8s-monitoring/Chart.yaml + key: $.dependencies[0].name + value: grafana-agent + disablesourceinput: true +targets: + grafana-agent: + name: Bump Helm chart dependency "grafana-agent" for Helm chart "k8s-monitoring" + kind: helmchart + spec: + file: Chart.yaml + key: $.dependencies[0].version + name: charts/k8s-monitoring + versionincrement: none + sourceid: grafana-agent + grafana-agent-logs: + name: Bump Helm chart dependency "grafana-agent-logs" for Helm chart "k8s-monitoring" + kind: helmchart + spec: + file: Chart.yaml + key: $.dependencies[1].version + name: charts/k8s-monitoring + versionincrement: none + sourceid: grafana-agent diff --git a/.github/configs/updatecli.d/kube-state-metrics.yaml b/.github/configs/updatecli.d/kube-state-metrics.yaml new file mode 100644 index 000000000..b8ee564cf --- /dev/null +++ b/.github/configs/updatecli.d/kube-state-metrics.yaml @@ -0,0 +1,31 @@ +name: Bump dependency "kube-state-metrics" for Helm chart "k8s-monitoring" +sources: + kube-state-metrics: + name: Get latest "kube-state-metrics" Helm chart version + kind: helmchart + spec: + name: kube-state-metrics + url: https://prometheus-community.github.io/helm-charts + versionfilter: + kind: semver + pattern: '*' +conditions: + kube-state-metrics: + name: Ensure Helm chart dependency "kube-state-metrics" is specified + kind: yaml + spec: + file: charts/k8s-monitoring/Chart.yaml + key: $.dependencies[2].name + value: kube-state-metrics + disablesourceinput: true +targets: + kube-state-metrics: + name: Bump Helm chart dependency "kube-state-metrics" for Helm chart "k8s-monitoring" + kind: helmchart + spec: + file: Chart.yaml + key: $.dependencies[2].version + name: charts/k8s-monitoring + versionincrement: none + sourceid: kube-state-metrics + diff --git a/.github/configs/updatecli.d/node-exporter.yaml b/.github/configs/updatecli.d/node-exporter.yaml new file mode 100644 index 000000000..94ca985b5 --- /dev/null +++ b/.github/configs/updatecli.d/node-exporter.yaml @@ -0,0 +1,32 @@ +name: Bump dependency "prometheus-node-exporter" for Helm chart "k8s-monitoring" +sources: + prometheus-node-exporter: + name: Get latest "prometheus-node-exporter" Helm chart version + kind: helmchart + spec: + name: prometheus-node-exporter + url: https://prometheus-community.github.io/helm-charts + versionfilter: + kind: semver + pattern: '*' + +conditions: + prometheus-node-exporter: + name: Ensure Helm chart dependency "prometheus-node-exporter" is specified + kind: yaml + spec: + file: charts/k8s-monitoring/Chart.yaml + key: $.dependencies[3].name + value: prometheus-node-exporter + disablesourceinput: true + +targets: + prometheus-node-exporter: + name: Bump Helm chart dependency "prometheus-node-exporter" for Helm chart "k8s-monitoring" + kind: helmchart + spec: + file: Chart.yaml + key: $.dependencies[3].version + name: charts/k8s-monitoring + versionincrement: none + sourceid: prometheus-node-exporter diff --git a/.github/configs/updatecli.d/opencost.yaml b/.github/configs/updatecli.d/opencost.yaml new file mode 100644 index 000000000..cf16d95d2 --- /dev/null +++ b/.github/configs/updatecli.d/opencost.yaml @@ -0,0 +1,30 @@ +name: Bump dependency "opencost" for Helm chart "k8s-monitoring" +sources: + opencost: + name: Get latest "opencost" Helm chart version + kind: helmchart + spec: + name: opencost + url: https://opencost.github.io/opencost-helm-chart + versionfilter: + kind: semver + pattern: '*' +conditions: + opencost: + name: Ensure Helm chart dependency "opencost" is specified + kind: yaml + spec: + file: charts/k8s-monitoring/Chart.yaml + key: $.dependencies[6].name + value: opencost + disablesourceinput: true +targets: + opencost: + name: Bump Helm chart dependency "opencost" for Helm chart "k8s-monitoring" + kind: helmchart + spec: + file: Chart.yaml + key: $.dependencies[6].version + name: charts/k8s-monitoring + versionincrement: none + sourceid: opencost diff --git a/.github/configs/updatecli.d/prometheus-operator-crds.yaml b/.github/configs/updatecli.d/prometheus-operator-crds.yaml new file mode 100644 index 000000000..4a3c01a2c --- /dev/null +++ b/.github/configs/updatecli.d/prometheus-operator-crds.yaml @@ -0,0 +1,30 @@ +name: Bump dependency "prometheus-operator-crds" for Helm chart "k8s-monitoring" +sources: + prometheus-operator-crds: + name: Get latest "prometheus-operator-crds" Helm chart version + kind: helmchart + spec: + name: prometheus-operator-crds + url: https://prometheus-community.github.io/helm-charts + versionfilter: + kind: semver + pattern: '*' +conditions: + prometheus-operator-crds: + name: Ensure Helm chart dependency "prometheus-operator-crds" is specified + kind: yaml + spec: + file: charts/k8s-monitoring/Chart.yaml + key: $.dependencies[4].name + value: prometheus-operator-crds + disablesourceinput: true +targets: + prometheus-operator-crds: + name: Bump Helm chart dependency "prometheus-operator-crds" for Helm chart "k8s-monitoring" + kind: helmchart + spec: + file: Chart.yaml + key: $.dependencies[4].version + name: charts/k8s-monitoring + versionincrement: none + sourceid: prometheus-operator-crds diff --git a/.github/configs/updatecli.d/windows-exporter.yaml b/.github/configs/updatecli.d/windows-exporter.yaml new file mode 100644 index 000000000..0c71522c4 --- /dev/null +++ b/.github/configs/updatecli.d/windows-exporter.yaml @@ -0,0 +1,30 @@ +name: Bump dependency "prometheus-windows-exporter" for Helm chart "k8s-monitoring" +sources: + prometheus-windows-exporter: + name: Get latest "prometheus-windows-exporter" Helm chart version + kind: helmchart + spec: + name: prometheus-windows-exporter + url: https://prometheus-community.github.io/helm-charts + versionfilter: + kind: semver + pattern: '*' +conditions: + prometheus-windows-exporter: + name: Ensure Helm chart dependency "prometheus-windows-exporter" is specified + kind: yaml + spec: + file: charts/k8s-monitoring/Chart.yaml + key: $.dependencies[5].name + value: prometheus-windows-exporter + disablesourceinput: true +targets: + prometheus-windows-exporter: + name: Bump Helm chart dependency "prometheus-windows-exporter" for Helm chart "k8s-monitoring" + kind: helmchart + spec: + file: Chart.yaml + key: $.dependencies[5].version + name: charts/k8s-monitoring + versionincrement: none + sourceid: prometheus-windows-exporter diff --git a/.github/workflows/check-for-dependency-updates.yaml b/.github/workflows/check-for-dependency-updates.yaml new file mode 100644 index 000000000..d1e8d0a70 --- /dev/null +++ b/.github/workflows/check-for-dependency-updates.yaml @@ -0,0 +1,281 @@ +--- +name: Check for dependency updates + +on: + workflow_dispatch: + schedule: + # Run once a day + - cron: '0 0 * * *' + +permissions: + contents: "write" + pull-requests: "write" + +env: + UPDATECLI_CONFIG_DIR: "${{ github.workspace }}/.github/configs/updatecli.d" + UPDATECLI_GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + +jobs: + updateGrafanaAgent: + name: Update Grafana Agent + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Updatecli + uses: updatecli/updatecli-action@v2 + + - name: Run Updatecli + id: update-grafana-agent + run: | + updatecli apply --config ${UPDATECLI_CONFIG_DIR}/grafana-agent.yaml + if ! git diff --exit-code > /dev/null; then + echo "changed=true" >> "${GITHUB_OUTPUT}" + fi + + - name: Regenerate docs + if: steps.update-grafana-agent.outputs.changed == 'true' + run: docker run --rm -v "$(pwd)/charts/k8s-monitoring:/helm-docs" -u "$(id -u)" jnorwood/helm-docs + + - name: Install Helm + if: steps.update-grafana-agent.outputs.changed == 'true' + uses: azure/setup-helm@v3 + + - name: Regenerate examples + if: steps.update-grafana-agent.outputs.changed == 'true' + run: make regenerate-example-outputs + + - name: Create pull request + if: steps.update-grafana-agent.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v5 + with: + title: "[dependency] Update Grafana Agent" + body: "Updates the Grafana Agent subchart" + base: main + author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + committer: "GitHub " + commit-message: Update Grafana Agent + labels: dependencies + branch: chore/update-grafana-agent + delete-branch: true + + updateKubeStateMetrics: + name: Update Kube State Metrics + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Updatecli + uses: updatecli/updatecli-action@v2 + + - name: Run Updatecli + id: update-kube-state-metrics + run: | + updatecli apply --config ${UPDATECLI_CONFIG_DIR}/kube-state-metrics.yaml + if ! git diff --exit-code > /dev/null; then + echo "changed=true" >> "${GITHUB_OUTPUT}" + fi + + - name: Regenerate docs + if: steps.update-kube-state-metrics.outputs.changed == 'true' + run: docker run --rm -v "$(pwd)/charts/k8s-monitoring:/helm-docs" -u "$(id -u)" jnorwood/helm-docs + + - name: Install Helm + if: steps.update-kube-state-metrics.outputs.changed == 'true' + uses: azure/setup-helm@v3 + + - name: Regenerate examples + if: steps.update-kube-state-metrics.outputs.changed == 'true' + run: make regenerate-example-outputs + + - name: Create pull request + if: steps.update-kube-state-metrics.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v5 + with: + title: "[dependency] Update Kube State Metrics" + body: "Updates the Kube State Metrics subchart" + base: main + author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + committer: "GitHub " + commit-message: Update Kube State Metrics + labels: dependencies + branch: chore/update-kube-state-metrics + delete-branch: true + + updateNodeExporter: + name: Update Node Exporter + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Updatecli + uses: updatecli/updatecli-action@v2 + + - name: Run Updatecli + id: update-node-exporter + run: | + updatecli apply --config ${UPDATECLI_CONFIG_DIR}/node-exporter.yaml + if ! git diff --exit-code > /dev/null; then + echo "changed=true" >> "${GITHUB_OUTPUT}" + fi + + - name: Regenerate docs + if: steps.update-node-exporter.outputs.changed == 'true' + run: docker run --rm -v "$(pwd)/charts/k8s-monitoring:/helm-docs" -u "$(id -u)" jnorwood/helm-docs + + - name: Install Helm + if: steps.update-node-exporter.outputs.changed == 'true' + uses: azure/setup-helm@v3 + + - name: Regenerate examples + if: steps.update-node-exporter.outputs.changed == 'true' + run: make regenerate-example-outputs + + - name: Create pull request + if: steps.update-node-exporter.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v5 + with: + title: "[dependency] Update Node Exporter" + body: "Updates the Node Exporter subchart" + base: main + author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + committer: "GitHub " + commit-message: Update Node Exporter + labels: dependencies + branch: chore/update-node-exporter + delete-branch: true + + updateOpenCost: + name: Update OpenCost + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Updatecli + uses: updatecli/updatecli-action@v2 + + - name: Run Updatecli + id: update-opencost + run: | + updatecli apply --config ${UPDATECLI_CONFIG_DIR}/opencost.yaml + if ! git diff --exit-code > /dev/null; then + echo "changed=true" >> "${GITHUB_OUTPUT}" + fi + + - name: Regenerate docs + if: steps.update-opencost.outputs.changed == 'true' + run: docker run --rm -v "$(pwd)/charts/k8s-monitoring:/helm-docs" -u "$(id -u)" jnorwood/helm-docs + + - name: Install Helm + if: steps.update-opencost.outputs.changed == 'true' + uses: azure/setup-helm@v3 + + - name: Regenerate examples + if: steps.update-opencost.outputs.changed == 'true' + run: make regenerate-example-outputs + + - name: Create pull request + if: steps.update-opencost.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v5 + with: + title: "[dependency] Update OpenCost" + body: "Updates the OpenCost subchart" + base: main + author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + committer: "GitHub " + commit-message: Update OpenCost + labels: dependencies + branch: chore/update-opencost + delete-branch: true + + updatePrometheusOperatorCRDs: + name: Update Prometheus Operator CRDs + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Updatecli + uses: updatecli/updatecli-action@v2 + + - name: Run Updatecli + id: update-prometheus-operator-crds + run: | + updatecli apply --config ${UPDATECLI_CONFIG_DIR}/prometheus-operator-crds.yaml + if ! git diff --exit-code > /dev/null; then + echo "changed=true" >> "${GITHUB_OUTPUT}" + fi + + - name: Regenerate docs + if: steps.update-prometheus-operator-crds.outputs.changed == 'true' + run: docker run --rm -v "$(pwd)/charts/k8s-monitoring:/helm-docs" -u "$(id -u)" jnorwood/helm-docs + + - name: Install Helm + if: steps.update-prometheus-operator-crds.outputs.changed == 'true' + uses: azure/setup-helm@v3 + + - name: Regenerate examples + if: steps.update-prometheus-operator-crds.outputs.changed == 'true' + run: make regenerate-example-outputs + + - name: Create pull request + if: steps.update-prometheus-operator-crds.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v5 + with: + title: "[dependency] Update Prometheus Operator CRDs" + body: "Updates the Prometheus Operator CRD subchart" + base: main + author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + committer: "GitHub " + commit-message: Update Prometheus Operator CRDs + labels: dependencies + branch: chore/update-prometheus-operator-crds + delete-branch: true + + updateWindowsExporter: + name: Update Windows Exporter + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Updatecli + uses: updatecli/updatecli-action@v2 + + - name: Run Updatecli + id: update-windows-exporter + run: | + updatecli apply --config ${UPDATECLI_CONFIG_DIR}/windows-exporter.yaml + if ! git diff --exit-code > /dev/null; then + echo "changed=true" >> "${GITHUB_OUTPUT}" + fi + + - name: Regenerate docs + if: steps.update-windows-exporter.outputs.changed == 'true' + run: docker run --rm -v "$(pwd)/charts/k8s-monitoring:/helm-docs" -u "$(id -u)" jnorwood/helm-docs + + - name: Install Helm + if: steps.update-windows-exporter.outputs.changed == 'true' + uses: azure/setup-helm@v3 + + - name: Regenerate examples + if: steps.update-windows-exporter.outputs.changed == 'true' + run: make regenerate-example-outputs + + - name: Create pull request + if: steps.update-windows-exporter.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v5 + with: + title: "[dependency] Update Windows Exporter" + body: "Updates the Windows Exporter subchart" + base: main + author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + committer: "GitHub " + commit-message: Update Windows Exporter + labels: dependencies + branch: chore/update-windows-exporter + delete-branch: true