Difference between revisions of "Install Zabbix6 on OpenShift v49"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | |||
− | |||
=Tested with= | =Tested with= | ||
* Server Version: 4.9.0 | * Server Version: 4.9.0 |
Revision as of 20:23, 28 February 2022
1 Tested with
- Server Version: 4.9.0
- Kubernetes Version: v1.22.1
- Zabbix Version: 6.0
1.1 zabbix
PROJECT=zabbix-dev oc new-project $PROJECT oc process -n openshift mariadb-persistent MYSQL_DATABASE=zabbix MYSQL_USER=zabbix MYSQL_PASSWORD=zabbix VOLUME_CAPACITY=5Gi | oc create -f - sleep 3 oc logs -f dc/mariadb sleep 3 oc logs -f dc/mariadb
- or recreate database with proper settings automated
oc rsh dc/mariadb <<EOF MYSQL_PWD="\$MYSQL__ROOT_PASSWORD" mysql -h 127.0.0.1 -u root -e "show databases ; drop database \$MYSQL_DATABASE ; show databases ; create database \$MYSQL_DATABASE character set utf8 collate utf8_bin; show databases;" EOF
oc create serviceaccount anyuid oc adm policy add-scc-to-user anyuid -z anyuid
oc new-app --image=zabbix/zabbix-server-mysql:6.0-alpine-latest MYSQL_DATABASE=zabbix MYSQL_USER=zabbix MYSQL_PASSWORD=zabbix DB_SERVER_HOST=mariadb oc rollout pause deployment/zabbix-server-mysql oc patch deployment/zabbix-server-mysql --patch '{"spec":{"template":{"spec":{"serviceAccountName": "anyuid"}}}}'
oc set volume deployment/zabbix-server-mysql --add --name=zabbix-server-mysql-vol -t pvc --claim-size=5G --claim-mode=ReadWriteMany --claim-name=zabbix-server-mysql-claim
oc get pvc oc set volume deployment --all oc set volume deployment/zabbix-server-mysql | grep mounted\ at | awk '{print $3}' | tee /tmp/mounts
cat /tmp/mounts | while read m do oc set volume deployment/zabbix-server-mysql --remove --mount-path=$m --confirm done
echo ' /usr/lib/zabbix/alertscripts /usr/lib/zabbix/externalscripts /var/lib/zabbix/modules /var/lib/zabbix/enc /var/lib/zabbix/ssh_keys /var/lib/zabbix/ssl/certs /var/lib/zabbix/ssl/keys /var/lib/zabbix/ssl/ssl_ca /var/lib/zabbix/mibs' >> /tmp/mounts
cat /tmp/mounts | while read m do oc set volume deployment/zabbix-server-mysql --add --name=zabbix-server-mysql-vol --mount-path=$m --claim-name=zabbix-server-mysql-claim --sub-path=$(basename $m) done
oc set volume deployment --all
oc rollout resume deployment/zabbix-server-mysql oc logs -f deployment/zabbix-server-mysql
oc new-app --image=zabbix/zabbix-web-nginx-mysql:6.0-alpine-latest MYSQL_DATABASE=zabbix MYSQL_USER=zabbix MYSQL_PASSWORD=zabbix DB_SERVER_HOST=mariadb ZBX_SERVER_HOST=zabbix-server-mysql PHP_TZ="Europe/Zurich" oc patch deployment/zabbix-web-nginx-mysql --patch '{"spec":{"template":{"spec":{"serviceAccountName": "anyuid"}}}}' sleep 3 oc logs -f deployment/zabbix-web-nginx-mysql sleep 3 oc logs -f deployment/zabbix-web-nginx-mysql
oc create route edge --service=zabbix-web-nginx-mysql --port=8080 --hostname=zabbix.app.domain.com
- firefox zabbix.app.domain.com
- Admin / zabbix