This repository contains a set of files to deploy ONLYOFFICE Docs-example into a Kubernetes cluster.
- To install, you need a kubernetes cluster, for installation, read the instructions
- You will need kubectl installed, you can read the instructions at this link.
- You will also need Helm v3. For installation, read the instructions
To install databases nfs server and docs-example you need to add repositories:
$ helm repo add onlyoffice https://download.onlyoffice.com/charts/stable
$ 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=PERSISTENT_STORAGE_CLASS \
--set persistence.size=PERSISTENT_SIZE
-
PERSISTENT_STORAGE_CLASS
is a Persistent Storage Class available in your Kubernetes cluster.Persistent Storage Classes for different providers:
- Amazon EKS:
gp2
- Digital Ocean:
do-block-storage
- IBM Cloud: Default
ibmc-file-bronze
. More storage classes - Yandex Cloud:
yc-network-hdd
oryc-network-ssd
. More details - minikube:
standard
- Amazon EKS:
-
PERSISTENT_SIZE
is the total size of all Persistent Storages for the nfs Persistent Storage Class. You can express the size as a plain integer with one of these suffixes:T
,G
,M
,Ti
,Gi
,Mi
. For example:9Gi
.
See more details about installing NFS Server Provisioner via Helm here. Please note, installing an NFS server on bare metal kubernetes cluster requires a pre-created pv.
Configure a Persistent Volume Claim
Note: The default nfs
Persistent Volume Claim is 8Gi. You can change it in the values.yaml
file in the persistence.storageClass
and persistence.size
section. It should be less than PERSISTENT_SIZE
at least by about 5%. It's recommended to use 8Gi or more for persistent storage for every 100 active users of ONLYOFFICE Docs.
To deploy Docs-example with the release name docs-example
:
$ helm install docs-example onlyoffice/docs-example --set example.dsUrl=http://<ip>/
The command deploys docs-example on the Kubernetes cluster with the URL configuration of your ONLYOFFICE Docs
To uninstall/delete the docs-example
deployment:
$ helm delete docs-example
Below are the options available for configuration before deploying docs-example to a cluster:
persistence.storageClass
storage class name by default: nfs
persistence.size
storage volume size by default: 8Gi
example.dsUrl
Specifies the address of your ONLYOFFICE Docs, default: http://onlyoffice-docs-address/
example.replicas
docs-example replicas quantity by default: 1
example.containerImage
example container image name by default: onlyoffice/docs-example:latest
example.imagePullPolicy
example container image pull policy by default: IfNotPresent
example.resources.requests.memory
memory request by default: 128Mi
example.resources.requests.cpu
cpu request by default: 100m
example.resources.limits.memory
memory limit by default: 128Mi
example.resources.limits.cpu
cpu limit by defalut: 250m
jwt.enabled
jwt enabling parameter by default: true
jwt.secret
jwt secret by default: MYSECRET
jwt.header
Defines the http header that will be used to send the JSON Web Token by default: Authorization
jwt.inBody
Specifies the enabling the token validation in the request body to the ONLYOFFICE Docs by default: false
jwt.existingSecret
The name of an existing secret containing variables for jwt. If not specified, a secret named example.jwt
will be created
service.type
docs-example service type by default: ClusterIP
service.port
docs-example service port by default: 3000
ingress.enabled
installation of ingress service by defaule: false
ingress.host
Ingress hostname for the docs-example ingress by default: ""
ingress.ssl.enabled
installation ssl for ingress service by default: false
ingress.ssl.secret
secret name for ssl by default: tls
securityContext.enabled
Enable security context for the pods by default: false
securityContext.example.runAsUser
Set example containers' Security Context runAsUser by default :1001
securityContext.example.runAsGroup
Set example containers' Security Context runAsGroup by default:1001
By default, the docs-example is published local using default serviceType: ClusterIP
to deploy external use the command
$ helm install docs-example onlyoffice/docs-example --set example.dsUrl=http://<ip>/ --set service.type=LoadBalancer
To install the Nginx Ingress Controller to your cluster, run the following command:
$ helm install nginx-ingress ingress-nginx/ingress-nginx --set controller.publishService.enabled=true,controller.replicaCount=2
See more detail about installing Nginx Ingress via Helm here.