Welcome to the User Guide! This document provides comprehensive instructions to help you effectively use KubePress.
As explained in the Quick Start, deploying a WordPress instance with KubePress involves two steps:
To create a WordPress instance, you need to create a secret first.
A fully functional Secret for a WordPress Instance looks like this:
apiVersion: v1
data:
database: d3AtLWhvc3R6ZXJvLS13MS1jb20=
databaseHost: a3ViZXByZXNzLmt1YmVwcmVzcy5zdmMuY2x1c3Rlci5sb2NhbA==
databaseUsername: aG9zdHplcm8tYWRtaW4tYWIyOXNr
databasePassword: cGFzc3dvcmQK
password: cGFzc3dvcmQK
username: YWRtaW4=
kind: Secret
metadata:
name: wp--hostzero--w1-com
namespace: kubepress
type: Opaque
The secret must contain the following keys. These are required in any case:
usernamepasswordOptionally, you can also provide:
databaseUsername
username will be used with a random suffix appended to it. The random suffix is to ensure uniqueness of the database user, because all database users will be created in the same database cluster.databasePassword
databaseUsername field.If you set the wp.Spec.Database.CreateNew to false, you must provide the following additional keys in the secret (in addition to username and password):
database
databaseHost
databaseUsername
databasePassword
If you set the wp.Spec.Database.CreateNew to true (which is the default), you do not need to provide the three additional keys from above. The operator will create a new database and database user for you.
This data will be used to create:
After the initial creation of the WordPress instance, an update of username/password in the secret will not update:
k8s.mariadb.com/watch on the secret, and the operator will watch for changes.The newly updated credentials will be used in the deployment after a restart of the pods.
After creating the secret, you can create a WordPress Custom Resource that references the secret.
A fully functional WordPress Custom Resource looks like this:
apiVersion: crm.hostzero.de/v1
kind: WordPressSite
metadata:
name: wp--w2-com
namespace: kubepress
spec:
adminEmail: admin@example.com
adminUserSecretKeyRef: wp--w2-com
database:
createNew: true
ingress:
host: w2.com
tls: false
siteTitle: w2
wordpress:
image: wordpress:latest
maxUploadLimit: 64M
replicas: 1
resources:
cpuLimit: 500m
cpuRequest: 250m
memoryLimit: 1Gi
memoryRequest: 512Mi
storageSize: 10Gi
For more information about the fields in the WordPress Custom Resource, please look directly at the wordpresssite_types.go file in the api/v1 directory.