Editing
Tutorials:Mount cifs storage in a pod
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Overview == If you have a Data Management Plan (DMP), or you have access to a custom CIFS (SMB, Samba, Windows Share) storage you want to mount in a pod please follow the steps below == Convert your credentials to base64 encoding == In a terminal type: <syntaxhighlight lang="bash"> echo -n "<Your_CIFS_Username>" | base64 $ PFlvdXJfQ0lGU19Vc2VybmFtZT4= echo -n "<Your_CIFS_Password>" | base64 $ PFlvdXJfQ0lGU19QYXNzd29yZD4= echo -n "CASCB" | base64 $ Q0FTQ0I= </syntaxhighlight> Note that the output shown here is literally for the example used == Create a secret containing your credentials to the storage == Having your credentials encoded in base 64, you can create a cifs_secret.yaml like shown below: <syntaxhighlight lang="bash"> apiVersion: v1 kind: Secret metadata: name: cifs-secret namespace: user-<your-username> type: fstab/cifs data: username: 'PFlvdXJfQ0lGU19Vc2VybmFtZT4=' password: 'PFlvdXJfQ0lGU19QYXNzd29yZA==' domain: 'Q0FTQ0I=' </syntaxhighlight> You can then type: <syntaxhighlight lang="bash"> kubectl create secret -f secret.yaml </syntaxhighlight> == Adding your mounting option in your pod == Reusing our standard example of pod, we have to modify the section volumeMounts and Volumes in our pod creation file: <syntaxhighlight lang="bash"> apiVersion: v1 kind: Pod metadata: name: busybox-test-pod spec: containers: - name: busybox image: ccu-k8s.inf.uni-konstanz.de:32250/<your.username>/my_busybox # example of when we hosted our own image in the CCU repository command: ["sleep", "1d"] resources: requests: cpu: 100m memory: 100Mi limits: cpu: 1 memory: 1Gi volumeMounts: - mountPath: /abyss/home name: cephfs-home readOnly: false - mountPath: /abyss/shared name: cephfs-shared readOnly: false - mountPath: /abyss/datasets name: cephfs-datasets readOnly: true - mountPath: "/abyss/home/<your-already-created-mount-location-folder>" ## Add here location of where to mount the storage name: samba-share readOnly: false imagePullSecrets: - name: <A_Name_For_Your_Secret> ## Secret for accessing the CCU repository volumes: - name: cephfs-home hostPath: path: "/cephfs/abyss/home/<your-username>" type: Directory - name: cephfs-shared hostPath: path: "/cephfs/abyss/shared" type: Directory - name: cephfs-datasets hostPath: path: "/cephfs/abyss/datasets" type: Directory - name: samba-share ## Details of the source of the storage to be mounted flexVolume: driver: "fstab/cifs" fsType: "cifs" secretRef: name: "cifs-secret" options: networkPath: "//timon.cascb.uni-konstanz.de/<Your-Storage-Folder>" # Storage address, here assumed to be part of your DMP mountOptions: "vers=3.0,dir_mode=0755,file_mode=0644,noperm,domain=CASCB" </syntaxhighlight> == Checking if everything was mounted properly== Check the status of the pod with <syntaxhighlight lang="bash"> kubectl describe pods busybox-test-pod </syntaxhighlight> And when accessing your pod, your cifs storage should be mounted at: <syntaxhighlight lang="bash"> /abyss/home/<your-already-created-mount-location-folder> </syntaxhighlight>
Summary:
Please note that all contributions to Collective Computational Unit may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
CCU:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Collective Computational Unit
Main page
Projects
Tutorials
GPU Cluster
Core Facilitys
Mediawiki
Recent changes
Random page
Help
Tools
What links here
Related changes
Page information