How to mount from command line like the Nautilus does?
See the pmount
command for usage information
How can I browse a persistent volume in kubernetes and edit files with GUI?
Before all I should mention that everything below is for development environment.
Do not think of doing manual changes into container apps in production. For production you should make it so that all the necessary changes are applied automatically.
Copy files from remote machine and back
# Copy TO local machine
kubectl cp <namespace_name>/<pod_name>:<remote_file_path> <local_file_path> -c <container_name>
# Copy FROM local machine
kubectl cp <local_file_path> <namespace_name>/<pod_name>:<remote_file_path> -c <container_name>
# More examples
kubectl cp --help
-c <container_name>
can be omitted if there's only one container in the pod.
If you unsure which <namespace_name>
or <pod_name>
to use, you can try figuring that out with kubectl get pods --all-namespaces
.
If you are unsure which remote path you should type, you can try using ls
and pwd
in remote container:
kubectl exec -n <namespace_name> <pod_name> -c <container_name> ls <remote_path>`
# e.g.
kubectl exec -n my_namespace my_pod -c wordpress ls /var/www
kubectl exec -n my_namespace my_pod -c wordpress pwd
Edit files remotely with a console editor
Works if your container image has a shell in it and main process started by root
user. Start console session with:
kubectl exec -it -n <namespace_name> <pod_name> -c <container_name> sh
Install some console text editor (vim, nano, etc.) and use it. How to install depends on what Linux was used as the base for the image, you can find out using cat /etc/os-release
.
Editing with GUI
One way to work with GUI that I see, is to launch a web-based text editor (like jupyter
) alongside the app. You would need to modify the Deployment (or StatefulSet, DaemonSet, etc) and then you can launch proxy to the new container.
Here's an example how to add jupyter
to a pod:
- Modify the deployment by adding jupyter container:
- name: jupyter
image: jupyter/base-notebook
securityContext:
runAsUser: # insert UID that uses your app
args:
- jupyter
- notebook
- --ip=0.0.0.0
- --allow-root # if the UID is 0
workingDir: /data
ports:
- containerPort: 8888
volumeMounts:
- mountPath: /data
name: # insert name of the volume with files you want to modify
- Use
kubectl port-forward
to establish a connection with the pod:
kubectl port-forward -n <namespace> <pod_name> 8888:8888
After that you can access jupyter on localhost:8888
. See jupyter logs to obtain the access key (kubectl logs -n <namespace> <pod_name> -c jupyter
).
How to install TortoiseSVN repository in Ubuntu machine?
Tortoise SVN is Windows only, you can use the command line client, see here for help, or if you want a GUI you could try RabbitVCS or SmartSVN.
To install rabbitvcs: | Update rabbitvcs-nautilus3 to rabbitvcs-nautilus package
sudo add-apt-repository ppa:rabbitvcs/ppa
sudo apt-get update
sudo apt-get install rabbitvcs-nautilus3
Then log out and back in to restart nautilus (or How to restart nautilus without logging out?).
You should then have RabbitVCS items on your right click context menu in the file browser.
Ubuntu Linux Filepath for Windows mounted drive
Samba mounts via the Gnome desktop (Nautilus) are mounted per user in the directory
/home/user/.gvfs/
Just change user
to your user name or use ~/.gvfs/
instead.
If you have the samba tools installed, you can mount that samba share in a more general (not per-user) fashion wherever you want (e. g. via /etc/fstab
). Maybe that is more what you want?
Related Topics
Copy Files from Windows to Windows Subsystem for Linux (Wsl)
Docker Networking Namespace Not Visible in Ip Netns List
How to Force 'Cp' to Overwrite Directory Instead of Creating Another One Inside
Error: Can't Open Display: (Null) When Using Xclip to Copy Ssh Public Key
Installed Go Binary Not Found in Path on Alpine Linux Docker
Turning Multiple Lines into One Comma Separated Line
Create a Dedicated Folder for Every Zip Files in a Directory and Extract Zip Files
Bash History Without Line Numbers
Can You Attach Amazon Ebs to Multiple Instances
How to Mount One Partition from an Image File That Contains Multiple Partitions on Linux
Unzip All Files in a Directory
Connect to Host Localhost Port 22: Connection Refused
How to Automate Telnet Session Using Expect
How to Send a Sequence of at Commands to a Serial Port in Bash
How to Do 'Ret' Instruction from Code at _Start in MACos? Linux