To mount a CIFS share on MAIA, you first need to install the cifs-utils package on all the nodes that will access the share. This package provides the necessary tools to mount and manage CIFS shares.
sudo apt-get install cifs-utils#VOLUME_PLUGIN_DIR="/usr/libexec/kubernetes/kubelet-plugins/volume/exec"
VOLUME_PLUGIN_DIR="/var/lib/kubelet/volumeplugins"
mkdir -p "$VOLUME_PLUGIN_DIR/fstab~cifs"
cd "$VOLUME_PLUGIN_DIR/fstab~cifs"
curl -L -O https://raw.githubusercontent.com/kthcloud/maia/master/CIFS/cifs
curl -L -O https://raw.githubusercontent.com/kthcloud/maia/master/CIFS/decrypt_string.py
chmod 755 cifs
chmod 700 decrypt_string.pyRemember to save the private key in the same location, with the name private_key.pem. The private key is used to decrypt the credentials for the CIFS share.
The private key should be set with permissions 644 to ensure that only the owner can read it. You can set the permissions with the following command:
chmod 644 private_key.pemTo check if the installation was successful, run the following command:
$VOLUME_PLUGIN_DIR/fstab~cifs/cifs initIt should output a JSON string containing "status": "Success". This command is also run by Kubernetes itself when the cifs plugin is detected on the file system.
To verify that the CIFS script can correctly execute the decrypt_string.py script, run the following command:
$VOLUME_PLUGIN_DIR/fstab~cifs/decrypt_string.pyThe only difference in the installation process for MicroK8s is the location of the volume plugin directory. For MicroK8s, the directory is located at /usr/libexec/kubernetes/kubelet-plugins/volume/exec.