Difference between revisions of "Install Ghost on OKD4x"
Jump to navigation
Jump to search
| Line 34: | Line 34: | ||
=DEPLOY APPLICATION= | =DEPLOY APPLICATION= | ||
<pre> | <pre> | ||
| − | oc new-app --name $PROJECT --image $IMG \ | + | oc new-app --name $PROJECT --source-secret=docker --image $IMG \ |
database__client=mysql \ | database__client=mysql \ | ||
database__connection__host=mariadb \ | database__connection__host=mariadb \ | ||
| Line 42: | Line 42: | ||
url=https://$URL | url=https://$URL | ||
</pre> | </pre> | ||
| + | |||
| + | [[Category:4x]] | ||
| + | [[Category:OpenShift & K8S]] | ||
=CREATE ROUTE= | =CREATE ROUTE= | ||
Revision as of 04:48, 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=docker.io/ghost/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