Difference between revisions of "Install Ghost on OKD4x"
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
PROJECT=ghost | PROJECT=ghost | ||
URL=$PROJECT.domain.com | URL=$PROJECT.domain.com | ||
− | IMG= | + | IMG=ghost:latest |
DB_PASS=$(genpasswd) | DB_PASS=$(genpasswd) | ||
oc new-project $PROJECT | oc new-project $PROJECT | ||
</pre> | </pre> | ||
+ | |||
+ | [[Category:4x]] | ||
+ | [[Category:OpenShift & K8S]] | ||
=PULL SECRET= | =PULL SECRET= |
Revision as of 09:51, 22 April 2022
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=ghost:latest DB_PASS=$(genpasswd) oc new-project $PROJECT
2 PULL SECRET
oc create secret docker-registry docker --docker-server=docker.io --docker-username=username1 --docker-email=chris@domain.ch --docker-password=xcgsedfgsdfhgsdfg oc secrets link default docker --for=pull
3 DEPLOY DATABASE
oc process -n openshift mariadb-persistent MYSQL_DATABASE=$PROJECT MYSQL_USER=$PROJECT MYSQL_PASSWORD=$DB_PASS VOLUME_CAPACITY=5Gi | oc create -f -
4 DEPLOY APPLICATION
oc new-app --name $PROJECT --source-secret=docker --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
5 CREATE ROUTE
oc create route edge --service=ghost --hostname=$URL