- Dockerfile 61.5%
- Shell 38.5%
| kustomize@ad75b3962d | ||
| wordpress-container | ||
| .gitattributes | ||
| .gitmodules | ||
| LICENSE | ||
| read-repo.yaml | ||
| Readme.md | ||
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.gzor get in inside your Dockerfile ;-) - run a docker build in the ./bbdw-website/ dir or
oc apply -f bbdw-website/ImageStream_bbdw-website.yamloc 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.gitkustomize) - 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