Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more parameters to helm chart #134

Merged
merged 2 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions charts/core-dump-handler/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,21 @@ Basically copied from https://github.com/bitnami/charts/blob/master/bitnami/comm
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

{{- define "core-dump-handler.daemonset.container.volumeMounts" -}}
- name: host-volume
mountPath: {{ .Values.daemonset.hostDirectory }}
mountPropagation: Bidirectional
- name: core-volume
mountPath: {{ .Values.daemonset.coreDirectory }}
mountPropagation: Bidirectional
{{- if .Values.composer.coreEvents }}
- name: event-volume
mountPath: {{ .Values.daemonset.eventDirectory }}
mountPropagation: Bidirectional
{{- end }}
{{- if .Values.daemonset.mountContainerRuntimeEndpoint }}
- mountPath: {{ .Values.daemonset.hostContainerRuntimeEndpoint }}
name: container-runtime
{{- end }}
{{- end -}}
36 changes: 20 additions & 16 deletions charts/core-dump-handler/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ spec:
metadata:
labels:
name: {{ .Values.daemonset.label }}
annotations:
kubectl.kubernetes.io/default-container: "coredump-container"
spec:
{{- with .Values.image.pullSecrets }}
imagePullSecrets:
Expand All @@ -28,22 +30,7 @@ spec:
cpu: {{ .Values.image.limit_cpu }}
securityContext:
privileged: true
volumeMounts:
- name: host-volume
mountPath: {{ .Values.daemonset.hostDirectory }}
mountPropagation: Bidirectional
- name: core-volume
mountPath: {{ .Values.daemonset.coreDirectory }}
mountPropagation: Bidirectional
{{- if .Values.composer.coreEvents }}
- name: event-volume
mountPath: {{ .Values.daemonset.eventDirectory }}
mountPropagation: Bidirectional
{{- end }}
{{- if .Values.daemonset.mountContainerRuntimeEndpoint }}
- mountPath: {{ .Values.daemonset.hostContainerRuntimeEndpoint }}
name: container-runtime
{{- end }}
volumeMounts: {{ include "core-dump-handler.daemonset.container.volumeMounts" . | nindent 10 }}
env:
- name: COMP_FILENAME_TEMPLATE
value: {{ .Values.composer.filenameTemplate | quote }}
Expand Down Expand Up @@ -114,11 +101,28 @@ spec:
{{- if .Values.daemonset.extraEnvVars }}
{{ include "core-dump-handler.tplvalues.render" ( dict "value" .Values.daemonset.extraEnvVars "context" $) | nindent 10 }}
{{- end }}
{{- with .Values.daemonset.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
command: ["/app/core-dump-agent"]
lifecycle:
preStop:
exec:
command: ["/app/core-dump-agent", "remove"]
{{- range .Values.daemonset.sidecarContainers }}
- {{ with . -}}
securityContext:
privileged: true
volumeMounts:
{{- include "core-dump-handler.daemonset.container.volumeMounts" $ | nindent 10 }}
{{- if .volumeMounts -}}
{{- toYaml .volumeMounts | nindent 10 }}
{{- end }}
{{- $_ := unset . "volumeMounts" -}}
{{- toYaml . | nindent 8 -}}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
12 changes: 11 additions & 1 deletion charts/core-dump-handler/values.minikube.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
storageClass: standard
image:
tag: latest
pullPolicy: Never
composer:
logLevel: "Debug"
coreEvents: true
daemonset:
mountContainerRuntimeEndpoint: true
hostContainerRuntimeEndpoint: "/var/run/cri-dockerd.sock"
crioEndpoint: "unix:///var/run/cri-dockerd.sock"
deployCrioConfig: true
includeCrioExe: true
sidecarContainers:
- name: simple-printer
image: alpine
command:
- /bin/sh
- -c
- |
apk --no-cache add inotify-tools
cd /var/mnt/core-dump-handler/events
inotifywait -mq -e create .| while read directory action file; do cat $file; done
8 changes: 7 additions & 1 deletion charts/core-dump-handler/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@
},
"extraEnvVars": {
"type": "string"
},
"envFrom": {
"type": "array"
},
"sidecarContainers": {
"type": "array"
}
},
"required": [
Expand Down Expand Up @@ -333,4 +339,4 @@
"title": "ServiceAccount"
}
}
}
}
2 changes: 2 additions & 0 deletions charts/core-dump-handler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ daemonset:
s3BucketName: XXX
s3Region: XXX
extraEnvVars: ""
envFrom: []
sidecarContainers: []

serviceAccount:
create: true
Expand Down