Skip to content

Commit

Permalink
feat: add plugin downloader to helm
Browse files Browse the repository at this point in the history
Adds the ability to specify a path to download your aether plugins from

Signed-off-by: Spazzy <brendankamp757@gmail.com>
  • Loading branch information
Spazzy757 committed May 15, 2024
1 parent 9a8bd48 commit dc67826
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/aether/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
54 changes: 54 additions & 0 deletions charts/aether/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,51 @@ spec:
configMap:
defaultMode: 420
name: {{ include "aether.fullname" . }}
{{- if .Values.plugins.exporters }}
- name: exporters
emptyDir: {}
{{- end }}
{{- if .Values.plugins.sources }}
- name: sources
emptyDir: {}
{{- end }}
initContainers:
{{- if .Values.plugins.exporters }}
- name: download-exporters
image: "{{ .Values.plugins.image.repository }}:{{ .Values.plugins.image.tag }}"
command:
- sh
- -c
args:
- echo Downloading Exporters;
{{- range .Values.plugins.exporters }}
echo Fetching "{{ .link }}";
wget "{{ .link }}" -O /exporters/{{ .name }};
chmod 755 /exporters/{{ .name }};
{{- end }}
echo Finished downloading;
volumeMounts:
- mountPath: /exporters
name: exporters
{{- end }}
{{- if .Values.plugins.sources }}
- name: download-sources
image: "{{ .Values.plugins.image.repository }}:{{ .Values.plugins.image.tag }}"
command:
- sh
- -c
args:
- echo Downloading Sources;
{{- range .Values.plugins.exporters }}
echo Fetching "{{ .link }}";
wget "{{ .link }}" -O /sources/{{ .name }};
chmod 755 /exporters/{{ .name }};
{{- end }}
echo Finished downloading;
volumeMounts:
- mountPath: /sources
name: sources
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand All @@ -49,13 +94,22 @@ spec:
env:
- name: AETHER_CONFIG
value: local
{{- toYaml .Values.env | nindent 10 }}
volumeMounts:
- mountPath: /conf
name: config
{{- if .Values.secretName }}
- name: credentials
mountPath: /etc/secrets
{{- end }}
{{- if .Values.plugins.exporters }}
- mountPath: /plugins/exporters
name: exporters
{{- end }}
{{- if .Values.plugins.sources }}
- mountPath: /plugins/sources
name: sources
{{- end }}
livenessProbe:
httpGet:
path: /healthz
Expand Down
28 changes: 28 additions & 0 deletions charts/aether/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ secretName: ""

config: {}

# some plugins need extra environment variables
# you can set them here
# example
# env:
# - name: EXAMPLE_ENV
# value: foobar
env: []

# plugin configuration
plugins:
# image used to download the binaries
# requires wget
image:
repository: alpine
pullPolicy: IfNotPresent
tag: "3.15"

# a list of links that get plugins from
# example:
# exporters:
# - link: https://example.com/example
# name: example
# sources:
# - link: https://example.com/example
# name: example
exporters: []
sources: []

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down

0 comments on commit dc67826

Please sign in to comment.