• astrozyk

    (@astrozyk)


    Hi, I have a question about getting wordpress set up in Kubernetes. I am setting all this up in GCP and I am using CloudSQL for the database. I have no problems with that but what I do have problems with is when trying to use persistent storage for the wordpress site. I want to know what the best practice is for updating a wordpress site using ci/cd and redeploying it. I looked at the documentation on the wordpress docker site at the “Static image / updates-via-redeploy” section and I was having issues where the persistent storage was being mounted with nothing there. It’s as if my site files that I copy into the container are then getting mounted over by the persistent storage which has nothing in it. I am unsure of how to get the files there and then update them on redeploy. So if I need to update a plugin I can replace the files and redeploy and the changes would take place.

Viewing 1 replies (of 1 total)
  • zaid0300

    (@zaid0300)

    Hello!

    Setting up WordPress in Kubernetes with persistent storage can be a bit tricky, but there are some best practices you can follow for updating your WordPress site using CI/CD and redeployment.

    One approach is to use a separate container or job to update your WordPress files, and then deploy a new version of your WordPress pod with the updated files. Here are the basic steps:

    1. Create a separate container or job in your deployment that will handle updating the WordPress files. This container or job can use a shared volume with the WordPress pod to access the persistent storage.
    2. Use a tool like WP-CLI or a custom script to update the WordPress files in the shared volume.
    3. Once the WordPress files have been updated, trigger a new deployment of your WordPress pod. This can be done through your CI/CD pipeline, or manually using the kubectl command line tool.
    4. When the new version of the WordPress pod is deployed, it will use the updated files from the shared volume.

    As for the issue you’re experiencing with the persistent storage being mounted with nothing in it, it’s possible that there is an issue with how your volumes are being configured. You may need to double-check your volume and volume mount definitions to ensure that they are correctly pointing to the persistent storage.

    I hope this helps! Let me know if you have any other questions.

Viewing 1 replies (of 1 total)
  • The topic ‘Static deployment of WordPress in Kubernetes’ is closed to new replies.