-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add chart for prometheus exporter and conditionally install it …
…with workerpool controller
- Loading branch information
1 parent
88fa432
commit 6e37d3d
Showing
8 changed files
with
182 additions
and
1 deletion.
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,3 @@ | ||
.gitignore | ||
.git | ||
.github |
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 @@ | ||
apiVersion: v2 | ||
name: spacelift-promex | ||
description: A Helm chart for deploying the Spacelift Prometheus exporter. | ||
type: application | ||
version: 0.0.1 | ||
appVersion: "v0.3.1" |
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,27 @@ | ||
# Helm chart spacelift-prometheus-exporter | ||
|
||
This chart allows to deploy the Spacelift prometheus exporter. | ||
|
||
## Quick Start | ||
|
||
Add our Helm chart repo and update your local chart cache: | ||
|
||
```shell | ||
helm repo add spacelift https://downloads.spacelift.io/helm | ||
helm repo update | ||
``` | ||
|
||
Create a secret with your spacelift api key secret | ||
```shell | ||
kubectl create secret generic spacelift-api-key --from-literal=SPACELIFT_PROMEX_API_KEY_SECRET="{yourApiKeySecret}" | ||
``` | ||
|
||
You can then install the controller using this chart | ||
```shell | ||
helm upgrade spacelift-prometheus-exporter spacelift/spacelift-prometheus-exporter --install \ | ||
--set spacelift.apiEndpoint="https://{yourAccount}.app.spacelift.io" \ | ||
--set spacelift.apiKeyId="{yourApiToken}" \ | ||
--set spacelift.apiKeySecretName="spacelift-api-key" | ||
``` | ||
|
||
Follow the instructions on the [user-documentation](https://github.com/spacelift-io/prometheus-exporter) for more detailed instructions. |
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 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "spacelift-promex.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "spacelift-promex.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "spacelift-promex.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "spacelift-promex.labels" -}} | ||
helm.sh/chart: {{ include "spacelift-promex.chart" . }} | ||
{{ include "spacelift-promex.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "spacelift-promex.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "spacelift-promex.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
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,55 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "spacelift-promex.fullname" . }} | ||
labels: | ||
{{- include "spacelift-promex.labels" . | nindent 4 }} | ||
{{- with .Values.spaceliftPromex.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.spaceliftPromex.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ .Values.spaceliftPromex.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "spacelift-promex.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "spacelift-promex.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.spaceliftPromex.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: spacelift-promex | ||
{{- if .Values.spaceliftPromex.image.digest }} | ||
image: "{{ .Values.spaceliftPromex.image.repository }}@{{ .Values.spaceliftPromex.image.digest }}" | ||
{{- else }} | ||
image: "{{ .Values.spaceliftPromex.image.repository }}:{{ .Values.spaceliftPromex.image.tag }}" | ||
{{- end }} | ||
imagePullPolicy: {{ .Values.spaceliftPromex.image.pullPolicy }} | ||
ports: | ||
- name: metrics | ||
containerPort: 9953 | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: metrics | ||
periodSeconds: 5 | ||
env: | ||
- name: "SPACELIFT_PROMEX_API_ENDPOINT" | ||
value: "{{ .Values.spacelift.apiEndpoint }}" | ||
- name: "SPACELIFT_PROMEX_API_KEY_ID" | ||
value: "{{ .Values.spacelift.apiKeyId }}" | ||
- name: "SPACELIFT_PROMEX_API_KEY_SECRET" | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Values.spacelift.apiKeySecretName }} | ||
key: "SPACELIFT_PROMEX_API_KEY_SECRET" | ||
- name: "SPACELIFT_PROMEX_LISTEN_ADDRESS" | ||
value: "{{ .Values.spaceliftPromex.listenAddress}}" |
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,28 @@ | ||
spaceliftPromex: | ||
replicaCount: 1 | ||
image: | ||
repository: public.ecr.aws/spacelift/promex | ||
tag: v0.3.1 | ||
pullPolicy: IfNotPresent | ||
|
||
|
||
# The address to listen on for HTTP requests | ||
listenAddress: ":9953" | ||
|
||
# # Labels to add to the deployment | ||
# labels: | ||
# app.spacelift.io/example: spacelift-promx | ||
|
||
# # Annotations to add to the deployment | ||
# annotations: | ||
# app.spacelift.io/example: spacelift-promx | ||
|
||
spacelift: | ||
# # Your api endpoint, must be provided | ||
# apiEndpoint: https://myaccount.app.spacelift.io | ||
|
||
# # Your api key id, must be provided | ||
# apiKeyId: "my-api-key-id" | ||
|
||
# # your api key secret, the secret should contain the key "SPACELIFT_PROMEX_API_KEY_SECRET" | ||
# apiKeySecretName: "my-api-key-secret" |
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 |
---|---|---|
|
@@ -67,3 +67,6 @@ metricsService: | |
protocol: TCP | ||
targetPort: https | ||
type: ClusterIP | ||
|
||
spacelift-promex: | ||
enabled: true |