-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-30306 Allow arbitrary script based plane validation #17785
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -814,9 +814,9 @@ Specifically for now (but could be extended), this container generates sysctl co | |
A kludge to ensure until the mount of a PVC appears (this can happen with some types of host storage) | ||
*/}} | ||
{{- define "hpcc.waitForMount" -}} | ||
- name: wait-mount-container | ||
- name: {{ printf "wait-mount-container-%s" .volumeName }} | ||
{{- include "hpcc.addImageAttrs" . | nindent 2 }} | ||
command: ["/bin/sh"] | ||
command: ["/bin/bash"] | ||
args: | ||
- "-c" | ||
- {{ printf "until mountpoint -q %s; do sleep 5; done" .volumePath }} | ||
|
@@ -825,6 +825,25 @@ A kludge to ensure until the mount of a PVC appears (this can happen with some t | |
mountPath: {{ .volumePath | quote }} | ||
{{- end }} | ||
|
||
{{/* | ||
Inject container to perform any post plane initialization validation | ||
Pass in dict with volumeName, volumePath and cmds | ||
*/}} | ||
{{- define "hpcc.validatePlaneScript" -}} | ||
- name: {{ printf "validate-plane-script-container-%s" .volumeName }} | ||
{{- include "hpcc.addImageAttrs" . | nindent 2 }} | ||
command: ["/bin/bash"] | ||
args: | ||
- -c | ||
- | | ||
{{- range $cmd := .cmds }} | ||
{{ $cmd }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be a ; after each command? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, it's because the block scalar passes it as a script (complete with line breaks) which bash interprets as individual commands (as it would in a script.
The example in the JIRA is generated as:
.. and executes as expected. |
||
{{- end }} | ||
volumeMounts: | ||
- name: {{ .volumeName | quote}} | ||
mountPath: {{ .volumePath | quote }} | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
A kludge to ensure mounted storage (e.g. for nfs, minikube or docker for desktop) has correct permissions for PV | ||
|
@@ -888,6 +907,12 @@ NB: uid=10000 and gid=10001 are the uid/gid of the hpcc user, built into platfor | |
{{- $volumeName := (printf "%s-pv" $plane.name) -}} | ||
{{- include "hpcc.waitForMount" (dict "root" $root "me" $component "uid" $uid "gid" $gid "volumeName" $volumeName "volumePath" $plane.prefix) | nindent 0 }} | ||
{{- end -}} | ||
{{- if hasKey $plane "expert" -}} | ||
{{- if $plane.expert.validatePlaneScript -}} | ||
{{- $volumeName := (printf "%s-pv" $plane.name) -}} | ||
{{- include "hpcc.validatePlaneScript" (dict "root" $root "me" $component "uid" $uid "gid" $gid "volumeName" $volumeName "volumePath" $plane.prefix "cmds" $plane.expert.validatePlaneScript) | nindent 0 }} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth combining this into the wait for mount container if possible? What is the extra overhead starting a new container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well both are a kludge, but I wouldn't see both being used in tandem.
I was talking to the person behind the TF module that provisions the raided nvme on the nodes, and he thinks that it may require a new CSI behind the persistent volume to correctly wait for the mount to be fully ready.
But in the short term, in the next release, he is adding a marker file in the mount this mechanism could look for.
All less than ideal, once k8s pods see the pvc, that should be it - we shouldn't have to wait or check like this, but I think the provisioning of these raided nvme's is unusual and not fully supported by AKS out of the box.