Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions charts/core-dump-handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,5 @@ Daemonset
* s3BucketName : Maps to the S3_BUCKET_NAME enviroment variable
* 3Region : Maps to the S3_REGION enviroment variable
* extraEnvVars: Option for passing additional configuration to the agent such as endpoint properties.
* envFrom: Array of [EnvFromSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#envfromsource-v1-core) to inject into main container.
* sidecarContainers: Array of [Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#container-v1-core) to define as part of the pod.
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