### Initial Helm Release Installation Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Installs a Helm chart, creates a namespace if it doesn't exist, and waits for pods to become ready. Finally, it runs Helm tests to verify the installation. ```bash # 1. Create namespace and install helm install synology-csi . \ --create-namespace \ --namespace synology-csi \ --values values.yaml # 2. Wait for resources kubectl get pods -n synology-csi -w # 3. Test helm test synology-csi -n synology-csi ``` -------------------------------- ### Install Helm Chart with Namespace Creation Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Install the Synology CSI driver using Helm, creating the namespace if it doesn't exist. This is the standard installation command. ```bash helm install synology-csi . --create-namespace --namespace synology-csi ``` -------------------------------- ### Install Chart from Source using Makefile Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/README.md Use the provided Makefile for convenient installation of the chart from its source repository. ```bash $ make up ``` ```bash $ make ``` -------------------------------- ### Install Helm Chart Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Installs the Helm chart for the Synology CSI driver. ```bash helm install my-release . \ --create-namespace \ --namespace synology-csi \ --values values.yaml ``` -------------------------------- ### Minimal iSCSI Setup with Helm Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/09-example-deployments.md Use this configuration for development or testing environments with a single Diskstation and iSCSI-only volumes. Ensure Helm is installed and configured. ```yaml clientInfoSecret: create: true clients: - host: diskstation.local https: false port: 5000 username: admin password: secret storageClasses: iscsi: reclaimPolicy: Delete test: true ``` ```bash helm install synology-csi . \ --namespace synology-csi \ --create-namespace \ --values values.yaml # Wait for pods kubectl rollout status statefulset/synology-csi-controller -n synology-csi kubectl rollout status daemonset/synology-csi-node -n synology-csi # Test helm test synology-csi -n synology-csi ``` -------------------------------- ### Example .values.yaml Configuration Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md An example of a .values.yaml file demonstrating how to configure client information for local value overrides, including host, port, HTTPS settings, username, and password. ```yaml clientInfoSecret: create: true clients: - host: my-diskstation.local port: 5001 https: true username: csi-admin password: secret ``` -------------------------------- ### Examples: Using Helm Template Output Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md These examples demonstrate various ways to use the output of the 'make template' command, including viewing the first few lines, saving to a file, validating with 'kubeval', and filtering with 'grep'. ```bash # View rendered templates make template | head -50 ``` ```bash # Save to file make template > rendered.yaml ``` ```bash # Validate with kubeval make template | kubeval ``` ```bash # Use with kustomize/helm plugins make template | grep "kind: StorageClass" ``` -------------------------------- ### Example: Custom Namespace and Release for Upgrade Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md This example demonstrates how to override the default namespace and release name when running the 'make upgrade' target. The equivalent Helm command is also shown. ```bash NAMESPACE=prod RELEASE=prod-csi make upgrade # helm upgrade prod-csi . --create-namespace --install --namespace prod --values .values.yaml ``` -------------------------------- ### Install Helm Chart with Values File Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Install a Helm chart using a dedicated values file for configuration. This is preferred over using `--set` for complex configurations. ```bash # Good helm install my-release . --values prod-values.yaml # Avoid for complex values helm install my-release . --set clientInfoSecret.clients[0].host=192.168.1.1 ``` -------------------------------- ### Install Synology CSI Chart Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/README.md Install the Synology CSI Helm chart with a specified release name. ```bash helm install synology-csi-chart/synology-csi ``` -------------------------------- ### Add Helm Repository and Install Chart Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/01-overview.md Add the Synology CSI chart repository and install the chart with default values or local overrides. ```bash helm repo add synology-csi-chart https://christian-schlichtherle.github.io/synology-csi-chart helm install my-release synology-csi-chart/synology-csi git clone https://github.com/christian-schlichtherle/synology-csi-chart.git cd synology-csi-chart helm install my-release . --values .values.yaml ``` -------------------------------- ### Example: Uninstall from Specific Namespace Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md This example shows how to uninstall a Helm release from a specific namespace using the 'make down' target. The equivalent Helm command is also provided. ```bash NAMESPACE=synology-csi make down # helm uninstall synology-csi --namespace synology-csi ``` -------------------------------- ### Minimal Configuration Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Use this minimal configuration for basic setups. It includes essential client information and a default storage class. ```yaml # values-minimal.yaml clientInfoSecret: create: true clients: - host: 192.168.1.100 https: false port: 5000 username: admin password: secret123 storageClasses: iscsi-delete: reclaimPolicy: Delete ``` -------------------------------- ### Multi-Protocol Setup with Custom Parameters Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/02-configuration.md Supports iSCSI, NFS, and SMB with custom parameters. Includes client information, SMB user credentials, and storage classes for each protocol with specific configurations. ```yaml clientInfoSecret: create: true clients: - host: diskstation.local port: 5001 https: true username: csi-admin password: secure-password smbUserSecret: create: true stringData: username: smbadmin password: smbpassword storageClasses: iscsi-fast: parameters: fsType: ext4 reclaimPolicy: Delete nfs-shared: mountOptions: [vers=4.1, sync] parameters: protocol: nfs location: /volume1 reclaimPolicy: Retain smb-backup: parameters: protocol: smb reclaimPolicy: Retain ``` -------------------------------- ### Helm Chart Versioning Examples Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Examples of Helm chart versions following SemVer 2.0, including a development version, a release version, and a major version bump. ```text 0.11.3-SNAPSHOT # development version 0.11.3 # release version 1.0.0 # major version bump ``` -------------------------------- ### VolumeSnapshot Usage Example Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/07-csi-driver-integration.md Example of creating a VolumeSnapshot resource. Specify the volumeSnapshotClassName and the source PersistentVolumeClaim name. ```yaml apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: my-snapshot spec: volumeSnapshotClassName: synology-csi-delete source: persistentVolumeClaimName: my-pvc ``` -------------------------------- ### Documentation for Local Environment Configuration Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md This README example demonstrates how to document environment-specific configurations for a Helm chart deployment, including chart versions, Kubernetes versions, and custom settings. ```markdown # prod/README.md ## Production Configuration - Chart: synology-csi 0.11.3 - Kubernetes: 1.24.x - Diskstations: diskstation-01.prod, diskstation-02.prod ### Customizations - Node selector: node-role=csi - NFS mount options: vers=4.1,sync See prod-values.yaml for full configuration. ``` -------------------------------- ### Helm Install Commands for Namespace Isolation Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/08-rbac-reference.md These commands demonstrate how to install multiple instances of the CSI driver, each in its own isolated namespace, using Helm. This ensures independent ServiceAccounts and ClusterRoleBindings per instance. ```bash helm install csi-1 . --namespace synology-csi-1 --create-namespace helm install csi-2 . --namespace synology-csi-2 --create-namespace ``` -------------------------------- ### iSCSI StorageClass Example Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/07-csi-driver-integration.md Configure a StorageClass for iSCSI protocol. This is the default protocol and suitable for direct block-level access. Ensure iscsiadm is installed on cluster nodes. ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: synology-csi-iscsi-delete provisioner: csi.san.synology.com allowVolumeExpansion: true reclaimPolicy: Delete parameters: protocol: iscsi # or omit (default) fsType: ext4 # optional: ext4 (default) or btrfs formatOptions: --no-discard # optional: mkfs.* flags location: /volume1 # optional: volume location dsm: 192.168.1.100 # optional: Diskstation IP from clientInfoSecret ``` -------------------------------- ### Manually Create Namespace and Install Helm Chart Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md If namespace creation fails due to insufficient permissions, manually create the namespace first, then install the Helm chart without the `--create-namespace` flag. ```bash # Create namespace manually kubectl create namespace synology-csi # Then install without --create-namespace helm install synology-csi . --namespace synology-csi ``` -------------------------------- ### Check CIFS Module and Install Utilities Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Verify if the CIFS kernel module is loaded and install `cifs-utils` if necessary. This is required for SMB mounts and troubleshooting 'mount error: cifs filesystem not supported' errors. ```bash lsmod | grep cifs ``` ```bash apt-get install cifs-utils # Debian/Ubuntu ``` ```bash yum install cifs-utils # CentOS/RHEL ``` -------------------------------- ### Node Plugin Extra Arguments Example Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Provides an example of using extraArgs for the node's plugin configuration, such as specifying the iscsiadm path or log level. ```yaml node: plugin: extraArgs: - --iscsiadm-path=/usr/local/sbin/iscsiadm # Talos Linux - --log-level=debug # Increased verbosity ``` -------------------------------- ### Example: Fullname Override Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Demonstrates setting a `fullnameOverride` value to completely replace the resource name prefix. ```yaml fullnameOverride: my-synology # Results in resource names like: my-synology-controller ``` -------------------------------- ### Kubernetes Node Affinity Example Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Example of configuring node affinity for the controller component to schedule pods on nodes with specific labels. ```yaml controller: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: node-type operator: In values: [csi] ``` -------------------------------- ### Describe Pod for Image Pull Failures Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Use `kubectl describe pod` to get detailed information about a pod that is failing to start due to image pull issues. This helps diagnose registry, tag, or secret problems. ```bash kubectl describe pod -n synology-csi {pod-name} ``` -------------------------------- ### SMB StorageClass Example Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/07-csi-driver-integration.md Configure a StorageClass for SMB protocol, useful for Windows/hybrid environments. Requires SMB client tools and network access to the Diskstation SMB port. SMB credentials must be provided via a secret. ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: synology-csi-smb-delete provisioner: csi.san.synology.com allowVolumeExpansion: true mountOptions: - mfsymlinks # Allow symbolic links - dir_mode=0750 # Directory permissions - file_mode=0750 # File permissions reclaimPolicy: Delete parameters: protocol: smb location: /volume1 dsm: 192.168.1.100 secretRef: name: synology-csi-smb-user namespace: default ``` -------------------------------- ### Helm Upgrade/Install Command Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md This Helm command performs an upgrade or installation of the chart. It includes options to create the namespace if it doesn't exist, install if the release is new, specify the namespace, merge local overrides from '.values.yaml', and pass additional user-provided options. ```bash helm upgrade $HELM_RELEASE . \ --create-namespace \ --install \ --namespace $HELM_NAMESPACE \ --values .values.yaml \ $HELM_OPTS ``` -------------------------------- ### Restart Node DaemonSet After CIFS Install Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md After installing `cifs-utils` on nodes, restart the `synology-csi-node` daemonset to ensure the changes are applied and remounts can occur. This is a fix for SMB mount failures. ```bash kubectl rollout restart daemonset/synology-csi-node -n synology-csi ``` -------------------------------- ### High Availability Setup Configuration Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/09-example-deployments.md Configuration for a high availability setup with two Diskstations, including iSCSI and NFS storage classes, and controller/snapshotter affinity. ```yaml clientInfoSecret: create: true clients: # Primary Diskstation (iSCSI + NFS) - host: ds1.internal https: true port: 5001 username: csi-ha password: ${DS1_PASSWORD} # Secondary Diskstation (failover) - host: ds2.internal https: true port: 5001 username: csi-ha password: ${DS2_PASSWORD} storageClasses: # Primary storage (DS1) primary-fast: reclaimPolicy: Delete parameters: protocol: iscsi dsm: ds1.internal location: /volume1 test: true # Failover storage (DS2) failover-fast: reclaimPolicy: Delete parameters: protocol: iscsi dsm: ds2.internal location: /volume1 # Shared NFS (replicated between DS1 and DS2) shared-data: reclaimPolicy: Retain mountOptions: - vers=4.1 - sync parameters: protocol: nfs dsm: ds1.internal location: /volume2 mountPermissions: "0755" controller: # Spread controller across nodes affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: [controller] topologyKey: kubernetes.io/hostname snapshotter: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: [snapshotter] topologyKey: kubernetes.io/hostname volumeSnapshotClasses: standard: deletionPolicy: Retain disabled: false ``` -------------------------------- ### Example PostgreSQL Application Deployment Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/09-example-deployments.md This YAML defines a PostgreSQL StatefulSet and its associated PersistentVolumeClaim using the 'synology-csi-iscsi-performance' storage class. It demonstrates how an application can request and utilize storage provisioned by the Synology CSI driver. ```yaml apiVersion: v1 kind: PersistentVolumeClaim metadata: name: postgres-data namespace: applications spec: accessModes: - ReadWriteOnce storageClassName: synology-csi-iscsi-performance resources: requests: storage: 100Gi --- apiVersion: apps/v1 kind: StatefulSet metadata: name: postgres namespace: applications spec: serviceName: postgres replicas: 1 selector: matchLabels: app: postgres template: metadata: labels: app: postgres spec: serviceAccountName: app-sa containers: - name: postgres image: postgres:15-alpine ports: - containerPort: 5432 env: - name: PGDATA value: /var/lib/postgresql/data/pgdata volumeMounts: - name: data mountPath: /var/lib/postgresql/data volumeClaimTemplates: - metadata: name: data spec: accessModes: - ReadWriteOnce storageClassName: synology-csi-iscsi-performance resources: requests: storage: 100Gi ``` -------------------------------- ### Install CSIDriver Resource Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Controls the deployment of the CSIDriver resource. Set to false if the CSIDriver is managed separately. ```yaml installCSIDriver: true ``` -------------------------------- ### Example: Custom Name Override Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Demonstrates setting a custom `nameOverride` value to alter resource naming. ```yaml nameOverride: synology-csi-custom # Results in resource names like: release-synology-csi-custom-controller ``` -------------------------------- ### Verify Node Prerequisites for iSCSI and NFS Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Check if the necessary iSCSI and NFS client utilities are installed and running on your nodes. This is crucial for volume provisioning. ```bash # iSCSI volumes: verify iscsiadm which iscsiadm systemctl status iscsid # NFS volumes: verify NFS client cat /proc/filesystems | grep nfs ``` -------------------------------- ### NFS StorageClass Example Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/07-csi-driver-integration.md Configure a StorageClass for NFS protocol, suitable for shared filesystem access. Mount options like NFS version and sync can be specified. Network access to the Diskstation NFS port is required. ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: synology-csi-nfs-delete provisioner: csi.san.synology.com allowVolumeExpansion: true mountOptions: - vers=4.1 # NFS version (4.1 recommended for Kubernetes) - sync # synchronous writes - noatime # skip access time updates reclaimPolicy: Delete parameters: protocol: nfs location: /volume1 dsm: 192.168.1.100 mountPermissions: "0750" # optional: mounted folder permissions ``` -------------------------------- ### Default Makefile Target (Install/Upgrade) Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md The default 'make' command is an alias for 'make upgrade', performing a Helm upgrade or install. It can be customized using environment variables for namespace, release name, and additional Helm options. ```bash make ``` -------------------------------- ### Set Namespace for Troubleshooting Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/README.md Set the NAMESPACE variable to the chart's installation namespace for troubleshooting commands. ```bash $ NAMESPACE=synology-csi ``` -------------------------------- ### Example Client Info Secret Content Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/03-kubernetes-resources.md This YAML content represents the structure of the client-info secret, which lists DiskStation connection entries with credentials. It is conditionally created if `clientInfoSecret.create` is true. ```yaml clients: - host: 192.168.1.1 https: false password: secret port: 5000 username: admin - host: 192.168.1.1 https: true password: secret port: 5001 username: admin ``` -------------------------------- ### Pod Using iSCSI PersistentVolumeClaim Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/09-example-deployments.md Mounts a PersistentVolumeClaim into a pod for data persistence. This example uses a busybox image for demonstration. ```yaml apiVersion: v1 kind: Pod metadata: name: my-app namespace: default spec: containers: - name: app image: busybox volumeMounts: - name: data mountPath: /data command: ["sleep", "3600"] volumes: - name: data persistentVolumeClaim: claimName: my-data ``` -------------------------------- ### Collect Logs for Support Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md This script collects various Kubernetes resources, logs, and configuration details into a debug bundle for support. Ensure you have kubectl and helm installed and configured. ```bash #!/bin/bash NAMESPACE=synology-csi RELEASE=synology-csi # Create debug bundle mkdir -p debug-bundle/{pods,events,resources} # Collect pod logs kubectl logs -n $NAMESPACE -l app=controller -c csi-plugin > debug-bundle/controller-plugin.log kubectl logs -n $NAMESPACE -l app=node -c csi-plugin > debug-bundle/node-plugin.log kubectl logs -n $NAMESPACE -l app=controller -c csi-provisioner > debug-bundle/provisioner.log # Collect resource descriptions kubectl get all -n $NAMESPACE -o yaml > debug-bundle/resources/all.yaml kubectl get pv -o yaml > debug-bundle/resources/pvs.yaml kubectl get pvc -A -o yaml > debug-bundle/resources/pvcs.yaml # Collect events kubectl get events -n $NAMESPACE -o yaml > debug-bundle/events/namespace.yaml kubectl get events --all-namespaces -o yaml > debug-bundle/events/all.yaml # Helm release information helm status $RELEASE -n $NAMESPACE > debug-bundle/helm-status.txt helm get values $RELEASE -n $NAMESPACE > debug-bundle/helm-values.yaml # Kubernetes version kubectl version > debug-bundle/k8s-version.txt # Node information kubectl get nodes -o wide > debug-bundle/nodes.txt # Package for sharing tar czf debug-bundle-$(date +%Y%m%d-%H%M%S).tar.gz debug-bundle/ ``` -------------------------------- ### Makefile Target for Upgrade/Install Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md The 'make up' target is a shorthand for 'make upgrade', used for installing or upgrading the Helm chart. It utilizes environment variables for configuration. ```bash make up ``` -------------------------------- ### Example Synology CSI Chart Client Info Secret Configuration Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/02-configuration.md This YAML snippet demonstrates how to configure the `clientInfoSecret` to connect to Synology Diskstations. It includes settings for creating the secret, its name, and an array of client connection details, specifying host, port, protocol (HTTP/HTTPS), username, and password for each. ```yaml clientInfoSecret: create: true name: synology-credentials clients: - host: 192.168.1.1 port: 5000 https: false username: csi-user password: secure-password - host: 192.168.1.1 port: 5001 https: true username: csi-user password: secure-password ``` -------------------------------- ### NVMe/TCP StorageClass Example Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/07-csi-driver-integration.md Configure a StorageClass for NVMe/TCP protocol, designed for high-performance storage on PAS7700 Diskstations with Synology CSI Driver v1.3.0+. Requires NVMe/TCP capable cluster nodes. ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: synology-csi-nvme-delete provisioner: csi.san.synology.com allowVolumeExpansion: true reclaimPolicy: Delete parameters: protocol: nvme location: /volume1 dsm: 192.168.1.100 ``` -------------------------------- ### Override Helm Values with Multiple Files Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Installs a Helm chart using multiple values files for layered configuration. Later files override earlier ones. ```bash helm install my-release . \ --values values.yaml \ --values values-prod.yaml \ --values values-secrets.yaml ``` -------------------------------- ### Show Helm Differences Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Compares the currently deployed Helm release with local changes, showing additions, modifications, and deletions. It requires the Helm diff plugin to be installed and exits without applying changes. ```bash make diff ``` ```bash helm diff upgrade $HELM_RELEASE . \ --context 3 \ --namespace $HELM_NAMESPACE \ --values .values.yaml \ $HELM_OPTS ``` -------------------------------- ### Describe PVC to Check Status Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Use this command to get detailed information about a PVC, which can help diagnose why it's stuck in a pending state. Look for events related to provisioning failures. ```bash kubectl describe pvc {pvc-name} -n {namespace} ``` -------------------------------- ### Execute and Monitor Fio Benchmark Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Apply the fio benchmark configuration, monitor its progress in real-time, and retrieve the results from the pod logs. Tail logs for live updates. ```bash # Run benchmark kubectl apply -f fio-bench.yaml # Monitor progress kubectl logs fio-bench -f # Check results kubectl logs fio-bench | grep -A20 "fio version" ``` -------------------------------- ### Verify Node Prerequisites for SMB Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Ensure that the SMB client tools are available on your nodes for mounting SMB shares as volumes. ```bash # SMB volumes: verify SMB client which mount.cifs ``` -------------------------------- ### Manual Test Procedure for PVC and Pod Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Follow these steps to manually create a PersistentVolumeClaim (PVC), wait for it to bind, create a pod that uses the PVC, and verify data persistence. Includes cleanup steps. ```bash # 1. Create test PVC kubectl apply -f - < /data/test.txt" # 6. Verify data persists kubectl exec test-pod -- cat /data/test.txt # 7. Check volume on Diskstation # Via DSM UI: Storage > Volumes > (your volume) > SAN > iSCSI LUN # Should show LUN created with correct size # 8. Cleanup kubectl delete pod test-pod kubectl delete pvc test-pvc ``` -------------------------------- ### Typical CI/CD Usage for Distribution Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md This snippet shows the typical steps in a CI/CD workflow after a version bump to package the chart, commit the distribution files, and push them to the gh-pages branch. ```bash # In release workflow after version bump make dist # Commit dist/ to gh-pages branch git checkout gh-pages cp dist/* . git add -A git commit -m "Release v0.11.3" git push origin gh-pages ``` -------------------------------- ### Troubleshoot Plugin Socket Connection Failed Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Commands to restart a pod, check CSI plugin container logs, and verify the existence of the socket file to resolve 'connection refused' errors. ```bash # Restart pod kubectl delete pod -n synology-csi {pod-name} # Check plugin container logs kubectl logs -n synology-csi {pod-name} -c csi-plugin --tail=100 # Verify socket file exists kubectl exec -n synology-csi {pod-name} -c csi-plugin -- ls -la /var/lib/csi/sockets/pluginproxy/ ``` -------------------------------- ### Migrate Application Data to Cold Tier Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/09-example-deployments.md Demonstrates migrating application data to a different storage tier by creating a new PVC in the target tier and then copying data. This process typically involves using a temporary pod with tools like rsync or dd. ```bash # Create new PVC in target tier kubectl apply -f - <-client-info stringData: client-info.yaml: | clients: - host: 192.168.1.1 https: false password: changeme port: 5000 username: changeme - host: 192.168.1.1 https: true password: changeme port: 5001 username: changeme ``` -------------------------------- ### Usage of synology-csi.chart Helper Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Applies the synology-csi.chart helper to set the helm.sh/chart label. ```yaml helm.sh/chart: {{ include "synology-csi.chart" . }} ``` -------------------------------- ### Node Kubelet Path Configuration Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Shows how to use the 'kubeletPath' variable to dynamically configure the path to the Kubelet socket, enabling compatibility with different Kubernetes distributions. ```yaml value: {{ $.Values.node.kubeletPath }}/plugins/csi.san.synology.com/csi.sock ``` -------------------------------- ### Helm Test Hook Deletion Policy Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Configures the deletion policy for Helm test hooks using annotations. This example specifies that test resources should be deleted before new hooks are created and after hooks succeed. ```yaml annotations: helm.sh/hook: test helm.sh/hook-deletion-policy: before-hook-creation,hook-succeeded ``` -------------------------------- ### Helm Template Type Coercion Examples Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Illustrates how Helm templates handle type coercion for different YAML data types. This includes how strings, booleans, numbers, objects, and arrays are interpreted and outputted. ```yaml # YAML string username: csi-admin # treated as string # YAML boolean create: true # treated as boolean # YAML number port: 5000 # treated as integer # Template output {{ .Values.client.host }} # outputs string value {{ .Values.installCSIDriver }} # outputs boolean value {{ .Values.images.provisioner.tag }} # outputs string value ``` -------------------------------- ### Define synology-csi.labels Helper Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Generates a comprehensive set of standard Kubernetes resource labels, including managed-by, version, chart, template, and selector labels. ```go-template {{ define "synology-csi.labels" -}} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} {{ include "synology-csi.selectorLabels" . }} helm.sh/chart: {{ include "synology-csi.chart" . }} helm.sh/template: {{ .Template.Name | trimPrefix .Template.BasePath | trimPrefix "/" | replace "/" "_" }} {{- end }} ``` -------------------------------- ### Run Helm Test Hook Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Executes Helm test hooks, creates PVCs for testable StorageClasses, and runs fio benchmark pods. It waits up to 10 minutes for test pods to complete and fails if any pod exits with a non-zero status. ```bash make test ``` ```bash helm test $HELM_RELEASE \ --namespace $HELM_NAMESPACE \ --timeout 10m \ $HELM_OPTS ``` -------------------------------- ### Define synology-csi.selectorLabels Helper Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Generates standard selector labels, including app.kubernetes.io/instance and app.kubernetes.io/name, for use in pod selectors and filters. ```go-template {{ define "synology-csi.selectorLabels" -}} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/name: {{ include "synology-csi.name" . }} {{- end }} ``` -------------------------------- ### Override Helm Values with Environment Variables Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/06-helm-commands.md Uses a git-ignored .values.yaml file to inject environment-specific values, often secrets, via environment variables. This example shows how to use Make with environment variables to set values. ```bash # .values.yaml (gitignored) clientInfoSecret: create: true clients: - host: ${DISKSTATION_HOST} port: ${DISKSTATION_PORT} username: ${DISKSTATION_USER} password: ${DISKSTATION_PASS} DISKSTATION_HOST=192.168.1.1 make ``` -------------------------------- ### Usage of synology-csi.labels Helper Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Applies the synology-csi.labels helper to generate all standard labels for Kubernetes resources. ```yaml labels: {{- include "synology-csi.labels" $ | nindent 4 }} ``` -------------------------------- ### Node Configuration Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/05-values-structure.md Configures DaemonSet scheduling, kubelet path, and plugin arguments for the node component. Includes settings for affinity, kubeletPath, nodeSelector, plugin, and tolerations. ```yaml node: affinity: {} kubeletPath: /var/lib/kubelet nodeSelector: {} plugin: extraArgs: [] tolerations: [] ``` -------------------------------- ### Usage of synology-csi.selectorLabels Helper Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Includes the synology-csi.selectorLabels helper within a matchLabels block for defining pod selectors. ```yaml selector: matchLabels: {{- include "synology-csi.selectorLabels" $ | nindent 4 }} ``` -------------------------------- ### Talos Linux with Custom Kubelet Path Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/02-configuration.md Configuration for Talos Linux specifying a custom kubelet path and the path for the iscsiadm binary. ```yaml node: kubeletPath: /var/lib/kubelet plugin: extraArgs: - --iscsiadm-path=/usr/local/sbin/iscsiadm ``` -------------------------------- ### Usage of synology-csi.name Helper Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Applies the synology-csi.name helper to set the app.kubernetes.io/name label. ```yaml app.kubernetes.io/name: {{ include "synology-csi.name" . }} ``` -------------------------------- ### Check CSI Provisioner and Plugin Logs Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md These commands retrieve the latest logs from the csi-provisioner and csi-plugin containers within the synology-csi controller pod. Essential for diagnosing provisioning errors. ```bash kubectl logs -n synology-csi -l app=controller -c csi-provisioner --tail=100 ``` ```bash kubectl logs -n synology-csi -l app=controller -c csi-plugin --tail=100 ``` -------------------------------- ### I/O Performance Check with Fio Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Define a Kubernetes Pod to run fio for I/O performance benchmarking. This configuration specifies read/write operations, block size, and other parameters. Ensure a PVC named 'perf-test-pvc' exists. ```yaml apiVersion: v1 kind: Pod metadata: name: fio-bench namespace: default spec: containers: - name: fio image: ljishen/fio args: - --name=random-read-write - --ioengine=libaio - --iodepth=16 - --rw=randrw - --bs=4k - --direct=1 - --size=1G - --numjobs=4 - --runtime=60 - --time_based - --group_reporting - --filename=/data/test.fio volumeMounts: - name: data mountPath: /data volumes: - name: data persistentVolumeClaim: claimName: perf-test-pvc ``` -------------------------------- ### Check Kubernetes Version Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/10-troubleshooting-guide.md Verify that your Kubernetes version is compatible with the Synology CSI driver. Ensure it is version 1.20.x or higher. ```bash kubectl version --short # Expected: >= 1.20.x ``` -------------------------------- ### Usage of synology-csi.fullname Helper Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/04-helm-templates.md Appends '-controller' to the name generated by the synology-csi.fullname helper. This is useful for naming controller resources. ```yaml name: {{ include "synology-csi.fullname" $ }}-controller # Example: my-release-synology-csi-controller ``` -------------------------------- ### Monitor Volume Provisioning Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/07-csi-driver-integration.md Watch Persistent Volume Claim (PVC) binding status in a specific namespace and check the logs of the CSI provisioner for errors during volume creation. ```bash # Watch PVC binding kubectl get pvc -w -n ``` ```bash # Check provisioner logs kubectl logs -n synology-csi -l app=controller -c csi-provisioner --tail=50 ``` -------------------------------- ### Configure Volume Snapshot Classes Source: https://github.com/christian-schlichtherle/synology-csi-chart/blob/main/_autodocs/02-configuration.md Define VolumeSnapshotClass resources for snapshot creation. Use 'Delete' to remove snapshots or 'Retain' to keep them after deletion. Set 'disabled' to true to skip creation and 'isDefault' to true to mark as the default. ```yaml volumeSnapshotClasses: delete: deletionPolicy: Delete disabled: false retain: deletionPolicy: Retain disabled: false ```