Skip to content

Simplest script for DigitalOcean k8s http

Pavel Lobashov edited this page Jun 17, 2021 · 8 revisions
#!/bin/bash

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add stable https://charts.helm.sh/stable
helm repo update

helm install nfs-server stable/nfs-server-provisioner \
  --set persistence.enabled=true \
  --set persistence.storageClass=do-block-storage \
  --set persistence.size=20Gi
kubectl apply -f ./pvc/ds-files.yaml
sleep 60
kubectl get pvc ds-files
# Should see bound message

helm install rabbitmq bitnami/rabbitmq \
  --set metrics.enabled=false
helm install redis bitnami/redis \
  --set architecture=standalone \
  --set auth.enabled=false \
  --set image.tag=5.0.7-debian-10-r51 \
  --set metrics.enabled=false
wget -O createdb.sql https://raw.githubusercontent.com/ONLYOFFICE/server/master/schema/postgresql/createdb.sql
kubectl create configmap init-db-scripts \
  --from-file=./createdb.sql
helm install postgresql bitnami/postgresql \
  --set initdbScriptsConfigMap=init-db-scripts \
  --set postgresqlDatabase=postgres \
  --set persistence.size=8Gi \
  --set metrics.enabled=false

kubectl create secret generic license

kubectl apply -f ./configmaps/documentserver.yaml
kubectl create secret generic jwt \
  --from-literal=JWT_ENABLED=true \
  --from-literal=JWT_SECRET=jwtsecret

kubectl apply -f ./services/example.yaml
kubectl apply -f ./services/docservice.yaml
kubectl apply -f ./deployments/docservice.yaml
sleep 60
kubectl get deployment docservice
# wait to show READY 2/2

kubectl apply -f ./deployments/converter.yaml
sleep 60
kubectl get deployment converter
# wait to show READY 2/2

kubectl apply -f ./configmaps/example.yaml
kubectl apply -f ./pods/example.yaml

kubectl apply -f ./services/documentserver-lb.yaml
kubectl get service documentserver -o jsonpath="{.status.loadBalancer.ingress[*].ip}"
# wait until some ip is shown and open it
Clone this wiki locally