Skip to content

Commit

Permalink
feat: config map for configuration
Browse files Browse the repository at this point in the history
needed for more complex configuration, i.e. tag-selections

Signed-off-by: Mårten Svantesson <[email protected]>
  • Loading branch information
msvticket committed Nov 29, 2024
1 parent 7da1273 commit 195c3ff
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions configs/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- with .Values.config }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "prometheus-rds-exporter.fullname" . }}
labels:
{{- include "prometheus-rds-exporter.labels" . | nindent 4 }}
data:
prometheus-rds-exporter.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
15 changes: 15 additions & 0 deletions configs/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ spec:
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.config }}
args:
- --config
- /config/prometheus-rds-exporter.yaml
volumeMounts:
- mountPath: /config
name: config
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -75,3 +83,10 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.config }}
volumes:
- name: config
configMap:
name: {{ include "prometheus-rds-exporter.fullname" . }}
{{- end }}

3 changes: 3 additions & 0 deletions configs/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ image:
# Define environment variables
env: {}

# Configuration to generate
config: {}

# Name of the secret containing AWS credentials
awsCredentialsSecret: ""

Expand Down
5 changes: 5 additions & 0 deletions configs/prometheus-rds-exporter/prometheus-rds-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@

# Collect AWS RDS usages (AWS Cloudwatch API)
# collect-usages: true

# Select AWS instances by tags
# tag-selections:
# Environment:
# - staging

0 comments on commit 195c3ff

Please sign in to comment.