Wordpress secure in OKD (https://www.okd.io)
  • Dockerfile 61.5%
  • Shell 38.5%
Find a file
2025-10-22 16:58:10 +02:00
kustomize@ad75b3962d sync 2025-10-20 13:10:15 +02:00
wordpress-container false branch in buildconfig 2025-10-22 16:58:10 +02:00
.gitattributes remove lfs 2024-01-04 10:10:44 +01:00
.gitmodules set to new branch model (main) 2025-10-20 13:18:13 +02:00
LICENSE Add LICENSE 2020-12-20 13:39:12 +00:00
read-repo.yaml update 2021-11-24 12:17:53 +01:00
Readme.md change namespace to bbdw 2025-02-04 18:37:34 +01:00

Wordpress OKD / Openshift implementation

This project is trying to implement an easy and secure way for Wordpress on Openshift / OKD

The goals were:

  • Use reliable base images (UBI8 & CentOS)
  • make upgrades easy
  • make it easy to understand (it's also part of an Openshift Workshop)
  • make it customizable in wordpress: plug-ins, themes, ...
  • updates of the core wordpress should require a container rebuild
  • container builds via openshift docker builds

Implement a secure clean wordpress installation

Always inspect all the yaml files first:

  • look for object names
  • ConfigMap and Secret values
  • play special attention to the image paths!

make wordpress container

First install the pull secret (can be only stanza to ignor SSL certs like here):

oc create secret generic read-repo --dry-run=client --from-file=.gitconfig=dot-gitconfig.ini -o yaml > read-repo.yaml
oc apply -f read-repo.yaml
  • download wordpress curl -L -o bbdw-website/wordpress.tar.gz https://wordpress.org/latest.tar.gz or get in inside your Dockerfile ;-)
  • run a docker build in the ./bbdw-website/ dir or
  • oc apply -f bbdw-website/ImageStream_bbdw-website.yaml
  • oc apply -f bbdw-website/BuildConfig_bbdw-website.yaml

get a suitable mariadb container

  • The easy way: oc import-image quay.io/centos7/mariadb-103-centos7:latest --confirm

  • The complete way:

      ```shell
      podman pull quay.io/centos7/mariadb-103-centos7:latest
      oc create imagestream mariadb-103-centos7
      podman tag quay.io/centos7/mariadb-103-centos7:latest default-route-openshift-image-registry.apps.fangorn.pfpk.pro/wordpress-namespace/mariadb-103-centos7:latest
      podman login -u $(oc whoami) -p $(oc whoami -t) default-route-openshift-image-registry.apps.fangorn.pfpk.pro 
      ```
    

create Openshift / OKD objects

oc apply -k kustomize/instancetemplate/

Or better copy the instancetemplate directory with it's conten to a new directory, make your cusomizings and deploy this with oc apply -k (look down in chapter "Kustomize")

Enter your install

  • Look to the Route element
  • Go for http first, https and Wordpress is not so easy ;-)

Kustomize

If you want to deliver the container with ArgoCD, there's a submodule (or other repo) wordpress-okd-config, which implements a delivery pattern based on kustomize.

  • while developing use the repo wordpress-okd-config as submodule in the dir ./kustomize (if you want to add it: git submodule add https://github.com/pflaeging/wordpress-okd-config.git kustomize)
  • if you want to make an ArgoCd gitOps scheme, you can use the repo wordpress-okd-config as template for your wordpress apps.

Peter Pfläging peter@pflaeging.net

Public Source: https://github.com/pflaeging/wordpress-okd.git

https://www.pflaeging.net