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 configuration and settings to resolve issues installing on Talos #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
21 changes: 21 additions & 0 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if (default false .Values.talos) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "synology-csi.fullname" $ }}-chroot-configmap
namespace: {{ .Release.Namespace }}
data:
chroot.sh: |
#!/usr/bin/env bash
DIR="/host" # csi-node mount / of the node to /host in the container
BIN="$(basename "$0")"

iscsid_pid=$(pgrep iscsid)

echo "$@"

if [ -d "$DIR" ]; then
echo "entering nsenter"
nsenter --mount="/proc/${iscsid_pid}/ns/mnt" --net="/proc/${iscsid_pid}/ns/net" -- "/usr/local/sbin/$BIN" "$@"
fi
{{- end }}
18 changes: 18 additions & 0 deletions templates/node.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $talosEnabled := (default false .Values.talos) -}}
{{- with $.Values }}
---
apiVersion: v1
Expand Down Expand Up @@ -67,6 +68,9 @@ spec:
{{- with .affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{ if $talosEnabled }}
hostPID: true
{{- end }}
containers:
- name: csi-driver-registrar
args:
Expand Down Expand Up @@ -126,6 +130,11 @@ spec:
mountPropagation: Bidirectional
- name: plugin-dir
mountPath: /csi
{{- if $talosEnabled }}
- name: chroot-script
mountPath: /csibin/chroot.sh
subPath: chroot.sh
{{- end }}
hostNetwork: true
{{- with .nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
Expand All @@ -152,5 +161,14 @@ spec:
hostPath:
path: {{ .kubeletPath }}/plugins/csi.san.synology.com
type: DirectoryOrCreate
{{- if $talosEnabled }}
- name: chroot-script
configMap:
name: {{ include "synology-csi.fullname" $ }}-chroot-configmap
defaultMode: 0777
items:
- key: chroot.sh
path: chroot.sh
{{- end }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ images:
pullPolicy: IfNotPresent
tag: v6.2.2
installCSIDriver: true
# If using Talos.dev set to true to
# create a ConfigMap with a chroot script override and set hostPID to true for the node DaemonSet
talos: false
nameOverride: ""
# Specifies affinity, nodeSelector and tolerations for the node DaemonSet
node:
Expand Down