-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,145 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# See https://github.com/helm/chart-testing#configuration | ||
charts: | ||
- charts/prometheus-prefect-exporter | ||
helm-extra-args: --timeout 600s | ||
namespace: default | ||
release-label: prefect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Release Prometheus Prefect Exporter Helm Chart | ||
|
||
"on": | ||
push: | ||
tags: | ||
# prefect-prometheus-exporter-2023.9.1, but not prefect-prometheus-exporter-2023.09.01 | ||
# prefect-prometheus-exporter-2023.11.5, but not prefect-prometheus-exporter-2023.11.05 | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet | ||
- 'prefect-prometheus-exporter-2[0-9][2-9][3-9].1?[0-9].[1-3]?[0-9]' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get the version tags | ||
id: get_version | ||
run: | | ||
# Enable pipefail so git command failures do not result in null versions downstream | ||
set -x | ||
export "FULL_RELEASE=$(echo $GITHUB_REF | cut -d / -f 3)" | ||
echo "RELEASE_VERSION=$(echo $FULL_RELEASE | cut -d - -f 4)" >> $GITHUB_OUTPUT | ||
echo "PROMETHEUS_PREFECT_EXPORTER_VERSION=$(\ | ||
git ls-remote --tags --refs --sort="v:refname" \ | ||
https://github.com/PrefectHQ/prometheus-prefect-exporter | tail -n1 | sed 's/.*\///' \ | ||
)" >> $GITHUB_OUTPUT | ||
- name: Copy Artifact Hub metadata | ||
run: | | ||
mkdir -p /tmp/chart | ||
cp artifacthub-repo.yml /tmp/chart | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
|
||
- name: Prepare GPG key for signing | ||
run: | | ||
gpg_dir=/tmp/.gpg | ||
mkdir "$gpg_dir" | ||
keyring="$gpg_dir/secring.gpg" | ||
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" | ||
passphrase_file="$gpg_dir/passphrase" | ||
echo "$GPG_PASSPHRASE" > "$passphrase_file" | ||
echo "SIGN_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" | ||
echo "SIGN_KEYRING=$keyring" >> "$GITHUB_ENV" | ||
env: | ||
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" | ||
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" | ||
|
||
- name: Package Prometheus Exporter helm chart | ||
run: | | ||
mkdir -p /tmp/chart | ||
cd charts | ||
# Update the prefect version tag in values.yaml | ||
sed -i "s/tag:.*$/tag: $PROMETHEUS_PREFECT_EXPORTER_VERSION/g" prometheus-prefect-exporter/values.yaml | ||
helm package prometheus-prefect-exporter \ | ||
--destination /tmp/chart \ | ||
--dependency-update \ | ||
--version $RELEASE_VERSION \ | ||
--app-version $PROMETHEUS_PREFECT_EXPORTER_VERSION \ | ||
--sign --key '[email protected]' \ | ||
--keyring $SIGN_KEYRING \ | ||
--passphrase-file $SIGN_PASSPHRASE_FILE | ||
env: | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
PROMETHEUS_PREFECT_EXPORTER_VERSION: ${{ steps.get_version.outputs.PROMETHEUS_PREFECT_EXPORTER_VERSION }} | ||
SIGN_KEYRING: ${{ env.SIGN_KEYRING }} | ||
SIGN_PASSPHRASE_FILE: ${{ env.SIGN_PASSPHRASE_FILE }} | ||
|
||
- name: Update chart index | ||
run: | | ||
git stash # Stash changes to the values.yaml so checkout doesn't complain | ||
git checkout gh-pages | ||
helm repo index /tmp/chart --url https://prefecthq.github.io/prefect-helm/charts --merge ./index.yaml | ||
- name: Commit and push | ||
run: | | ||
cp /tmp/chart/artifacthub-repo.yml . | ||
cp /tmp/chart/index.yaml . | ||
cp /tmp/chart/prometheus-prefect-exporter-$RELEASE_VERSION.* ./charts | ||
git add ./artifacthub-repo.yml ./index.yaml ./charts/prometheus-prefect-exporter-$RELEASE_VERSION.* | ||
git commit -m "Release $RELEASE_VERSION" | ||
git push origin gh-pages | ||
env: | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} |
47 changes: 47 additions & 0 deletions
47
.github/workflows/prometheus-prefect-exporter-lint-and-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Lint and Test Prometheus Prefect Exporter Chart | ||
|
||
"on": | ||
pull_request: | ||
paths: | ||
- .github/workflows/prometheus-prefect-exporter-lint-and-test.yaml | ||
- .github/linters/prometheus-prefect-exporter-ct.yaml | ||
- charts/prometheus-prefect-exporter/** | ||
|
||
jobs: | ||
lint_test: | ||
name: "lint-test (${{ matrix.kubernetes }})" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
kubernetes: | ||
- "1.25.8" | ||
- "1.26.3" | ||
- "1.27.0" | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (lint) | ||
run: ct lint --config .github/linters/prometheus-prefect-exporter-ct.yaml | ||
|
||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
with: | ||
node_image: "kindest/node:v${{ matrix.kubernetes }}" | ||
|
||
- name: Install Prefect Server | ||
run: | | ||
helm dependency build ./charts/prefect-server/ | ||
helm install prefect-server -n default ./charts/prefect-server/ --set=postgresql.auth.password=TESTING | ||
- name: Run chart-testing (install) | ||
run: | | ||
ct install --config .github/linters/prometheus-prefect-exporter-ct.yaml --helm-extra-set-args "--set=prefectApiUrl=http://prefect-server.default.svc.cluster.local:4200/api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v2 | ||
appVersion: "latest" | ||
description: A Helm chart to deploy Prometheus Prefect Exporter | ||
home: https://github.com/PrefectHQ | ||
keywords: | ||
- prometheus-prefect-exporter | ||
maintainers: | ||
- name: jamiezieziula | ||
email: [email protected] | ||
- name: jimid27 | ||
email: [email protected] | ||
- name: parkedwards | ||
email: [email protected] | ||
name: prometheus-prefect-exporter | ||
sources: | ||
- https://github.com/PrefectHQ/prefect-helm | ||
type: application | ||
# This version is never actually shipped. github actions will package add the appropriate version at build-time | ||
version: 0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# prometheus-prefect-exporter | ||
|
||
## Overview | ||
|
||
This chart deploys a [Prometheus Exporter](https://github.com/PrefectHQ/prometheus-prefect-exporter) for Prefect Server, providing relevant metrics from your deployed Prefect Server instance. | ||
Shoutout to [@ialejandro](https://github.com/ialejandro) for the original work on this chart! | ||
|
||
## Installing the Chart | ||
|
||
### Prerequisites | ||
|
||
1. Add the Prefect Helm repository to your Helm client: | ||
|
||
```bash | ||
helm repo add prefect https://prefecthq.github.io/prefect-helm | ||
helm repo update | ||
``` | ||
|
||
2. Deploy a Prefect Server instance using the [Prefect Server Helm chart](https://github.com/PrefectHQ/prefect-helm/tree/main/charts/prefect-server) | ||
|
||
### Install the Prefect Exporter chart | ||
|
||
1. Configure the Prefect exporter values as needed | ||
Create a `values.yaml` file to customize the Prometheus Prefect Exporter configuration. | ||
|
||
2. Install the chart | ||
```bash | ||
helm install prometheus-prefect-exporter prefect/prometheus-prefect-exporter --namespace=<PREFECT_SERVER_NAMESPACE> -f values.yaml | ||
``` | ||
|
||
3. Verify the deployment | ||
|
||
Check the status of your Prometheus Prefect Exporter deployment: | ||
|
||
```bash | ||
kubectl get pods -n prefect | ||
NAME READY STATUS RESTARTS AGE | ||
prometheus-prefect-exporter-76vxqnq 1/1 Running 0 25m | ||
``` | ||
|
||
You should see the Prometheus Prefect Exporter pod running | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| jamiezieziula | <[email protected]> | | | ||
| jimid27 | <[email protected]> | | | ||
| parkedwards | <[email protected]> | | | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | Affinity for pod assignment | | ||
| autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | Autoscaling with CPU or memory utilization percentage | | ||
| env | object | `{}` | Environment variables to configure application | | ||
| fullnameOverride | string | `""` | String to fully override prometheus-prefect-exporter.fullname template | | ||
| image | object | `{"pullPolicy":"IfNotPresent","repository":"prefecthq/prometheus-prefect-exporter","tag":"1.0.0"}` | Image registry | | ||
| imagePullSecrets | list | `[]` | Global Docker registry secret names as an array | | ||
| ingress | object | `{"annotations":{},"className":"","enabled":false,"hosts":[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}],"tls":[]}` | Ingress configuration to expose app | | ||
| livenessProbe | bool | `false` | Enable livenessProbe | | ||
| nameOverride | string | `""` | String to partially override prometheus-prefect-exporter.fullname template (will maintain the release name) | | ||
| nodeSelector | object | `{}` | Node labels for pod assignment | | ||
| podAnnotations | object | `{}` | Pod annotations | | ||
| podDisruptionBudget | object | `{}` | Limits the number of Pods of a replicated application that are down simultaneously from voluntary disruptions | | ||
| podSecurityContext | object | `{}` | To specify security settings for a Pod | | ||
| prefectApiUrl | string | `"http://prefect-server.prefect.svc.cluster.local:4200"` | Prefect API URL to connect to for metrics | | ||
| prometheusRule.additionalLabels | object | `{}` | | | ||
| prometheusRule.enabled | bool | `false` | | | ||
| prometheusRule.rules | list | `[]` | | | ||
| readinessProbe | bool | `false` | Enable readinessProbe | | ||
| replicaCount | int | `1` | Number of replicas | | ||
| resources | object | `{}` | The resources limits and requested | | ||
| securityContext | object | `{}` | Defines privilege and access control settings for a Pod or Container | | ||
| service | object | `{"port":80,"targetPort":8000,"type":"ClusterIP"}` | Kubernetes servide to expose Pod | | ||
| service.port | int | `80` | Kubernetes Service port | | ||
| service.targetPort | int | `8000` | Pod expose port | | ||
| service.type | string | `"ClusterIP"` | Kubernetes Service type. Allowed values: NodePort, LoadBalancer or ClusterIP | | ||
| serviceAccount | object | `{"annotations":{},"create":true,"name":""}` | Enable creation of ServiceAccount | | ||
| serviceMonitor | object | `{"enabled":false,"interval":"30s","metricRelabelings":[],"relabelings":[],"scrapeTimeout":"10s"}` | Enable ServiceMonitor to get metrics ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor | | ||
| serviceMonitor.enabled | bool | `false` | Enable or disable | | ||
| tolerations | list | `[]` | Tolerations for pod assignment | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{ template "chart.header" . }} | ||
|
||
## Overview | ||
|
||
This chart deploys a [Prometheus Exporter](https://github.com/PrefectHQ/prometheus-prefect-exporter) for Prefect Server, providing relevant metrics from your deployed Prefect Server instance. | ||
Shoutout to @ialejandro for the original work on this chart! | ||
|
||
## Installing the Chart | ||
|
||
### Prerequisites | ||
|
||
1. Add the Prefect Helm repository to your Helm client: | ||
|
||
```bash | ||
helm repo add prefect https://prefecthq.github.io/prefect-helm | ||
helm repo update | ||
``` | ||
|
||
2. Deploy a Prefect Server instance using the [Prefect Server Helm chart](https://github.com/PrefectHQ/prefect-helm/tree/main/charts/prefect-server) | ||
|
||
### Install the Prefect Exporter chart | ||
|
||
1. Configure the Prefect exporter values as needed | ||
Create a `values.yaml` file to customize the Prometheus Prefect Exporter configuration. | ||
|
||
2. Install the chart | ||
```bash | ||
helm install prometheus-prefect-exporter prefect/prometheus-prefect-exporter --namespace=<PREFECT_SERVER_NAMESPACE> -f values.yaml | ||
``` | ||
|
||
3. Verify the deployment | ||
|
||
Check the status of your Prometheus Prefect Exporter deployment: | ||
|
||
```bash | ||
kubectl get pods -n prefect | ||
|
||
NAME READY STATUS RESTARTS AGE | ||
prometheus-prefect-exporter-76vxqnq 1/1 Running 0 25m | ||
``` | ||
|
||
You should see the Prometheus Prefect Exporter pod running | ||
|
||
|
||
{{ template "chart.maintainersSection" . }} | ||
|
||
{{ template "chart.requirementsSection" . }} | ||
|
||
{{ template "chart.valuesSection" . }} | ||
|
||
{{ template "helm-docs.versionFooter" . }} |
Oops, something went wrong.