Difference between revisions of "Install WikiJS on OKD4x"

From Bitbull Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
==zabbix==
 
==zabbix==
 +
 +
genpasswd() {
 +
        local l=$1
 +
        [ "$l" == "" ] && l=16
 +
          tr -dc A-Za-z0-9_=%.,: < /dev/urandom | head -c ${l} | xargs
 +
}
 +
 
  PROJECT=wiki-dev
 
  PROJECT=wiki-dev
  URL=$PROJECT.bitbull.ch
+
  URL=$PROJECT.domain.com
 
  oc new-project $PROJECT
 
  oc new-project $PROJECT
  
  oc process -n openshift mariadb-persistent MYSQL_DATABASE=wiki MYSQL_USER=wikijs MYSQL_PASSWORD=wikijsrocks VOLUME_CAPACITY=5Gi | oc create -f -
+
DB_PASS=$(genpasswd)
 +
 +
 
 +
  oc process -n openshift mariadb-persistent MYSQL_DATABASE=wiki MYSQL_USER=wikijs MYSQL_PASSWORD=$DB_PASS VOLUME_CAPACITY=5Gi | oc create -f -
 +
 
 +
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
 +
oc new-app --name wiki --docker-image requarks/wiki:2 DB_NAME=wiki DB_PASS=$DB_PASS DB_USER=wikijs DB_PORT=3306 DB_HOST=mariadb DB_TYPE=mysql --source-secret=docker
 +
 
  
  oc new-app --name wiki --docker-image requarks/wiki:2 DB_NAME=wiki DB_PASS=wikijsrocks DB_USER=wikijs DB_PORT=3306 DB_HOST=mariadb DB_TYPE=mysql  
+
  oc new-app --name wiki --docker-image requarks/wiki:2 DB_NAME=wiki DB_PASS=$DB_PASS DB_USER=wikijs DB_PORT=3306 DB_HOST=mariadb DB_TYPE=mysql  
  
 
  # wikijs needs more privileges, so we create a service account for that
 
  # wikijs needs more privileges, so we create a service account for that
Line 21: Line 36:
 
  oc create route edge --service=wiki --port=3000 --hostname=$URL
 
  oc create route edge --service=wiki --port=3000 --hostname=$URL
  
[[Category:OpenShift]]
+
[[Category:OpenShift & K8S]]
[[Category:V4x]]
+
[[Category:4x]]

Latest revision as of 20:50, 22 April 2021

1 Tested with

  • Server Version: 4.7
  • Kubernetes Version: v1.20


1.1 zabbix

genpasswd() {
       local l=$1
       [ "$l" == "" ] && l=16
          tr -dc A-Za-z0-9_=%.,: < /dev/urandom | head -c ${l} | xargs
}
PROJECT=wiki-dev
URL=$PROJECT.domain.com
oc new-project $PROJECT
DB_PASS=$(genpasswd)

oc process -n openshift mariadb-persistent MYSQL_DATABASE=wiki MYSQL_USER=wikijs MYSQL_PASSWORD=$DB_PASS VOLUME_CAPACITY=5Gi | oc create -f -
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
oc new-app --name wiki --docker-image requarks/wiki:2 DB_NAME=wiki DB_PASS=$DB_PASS DB_USER=wikijs DB_PORT=3306 DB_HOST=mariadb DB_TYPE=mysql --source-secret=docker


oc new-app --name wiki --docker-image requarks/wiki:2 DB_NAME=wiki DB_PASS=$DB_PASS DB_USER=wikijs DB_PORT=3306 DB_HOST=mariadb DB_TYPE=mysql 
# wikijs needs more privileges, so we create a service account for that
oc create serviceaccount anyuid
oc adm policy add-scc-to-user anyuid -z anyuid
oc patch deployment.apps/wiki --patch '{"spec":{"template":{"spec":{"serviceAccountName": "anyuid"}}}}'
oc create route edge --service=wiki --port=3000 --hostname=$URL