Install Ghost on OKD4x
Ghost blog software became pretty popular this days.
If you have a kubernetes cluster around, you can install it within seconds.
Here we go with OKD 4.10
1 ENVIRONMENT
genpasswd() {
local l=$1
[ "$l" == "" ] && l=16
tr -dc A-Za-z0-9_=%.,: < /dev/urandom | head -c ${l} | xargs
}
PROJECT=ghost
URL=$PROJECT.domain.com
IMG=docker.io/ghost/ghost:latest
DB_PASS=$(genpasswd)
oc new-project $PROJECT
2 DEPLOY DATABASE
oc process -n openshift mariadb-persistent MYSQL_DATABASE=$PROJECT MYSQL_USER=$PROJECT MYSQL_PASSWORD=$DB_PASS VOLUME_CAPACITY=5Gi | oc create -f -
3 DEPLOY APPLICATION
oc new-app --name $PROJECT --image $IMG \
database__client=mysql \
database__connection__host=mariadb \
database__connection__user=$PROJECT \
database__connection__password=$DB_PASS \
database__connection__database=$PROJECT \
url=https://$URL
4 CREATE ROUTE
oc create route edge --service=ghost --hostname=$URL