Manage wordpress files in google container Engine and kubernetes

9/3/2017

I am in the middle of no where. Following this tutorial https://cloud.google.com/container-engine/docs/tutorials/persistent-disk

I deployed wordpress to google container engine. Now i have no idea how to access wordpress files on this Persistent Disks either with ftp or sftp. I can access project files with sftp on filezilla but can't find wordpress core files in it. Is there any way i can access these wordpress files?

-- khan
google-cloud-platform
google-kubernetes-engine
kubernetes
sftp
wordpress

2 Answers

9/5/2017

First take a look here: https://stackoverflow.com/a/46011597/1197205 This plugin uses Google Cloud Storage so it's easy to access via the UI

Another solution (only if you run 1 pod because otherwise you'd need to sync between disks): use an sftp container as a sidecar for the wordpress pod

-- Or Elimelech
Source: StackOverflow

9/20/2017

The persistent disk containing the wordpress files are attached to the wordpress pod. This disk is mounted on /var/www/html folder under the wordpress pod. You can access these files by connecting to the wordpress pod. First get the name of the running pod by executing the following command,

 kubectl get pods

Now use the name of the wordpress pod in the following command. This runs a remote shell on the wordpress pod,

kubectl exec -it <POD_NAME> sh

In the shell, run the ls command to see the list of wordpress files,

# ls

This will list the wordpress files. If you want to edit these files, you need to install vim or nano.

# apt-get update
# apt-get install vim
# apt-get install nano
# vi wp-config.php

Note that the vim/nano will be removed if the wordpress pod is restarted. If you really want them inside your pod, you will need to create a custom container.

-- Jayson Chacko
Source: StackOverflow