xelos-server
by XELOS
A Helm chart for XELOS
About this chart
TL;DR;
$ helm repo add xelos https://blueend.bitbucket.io/helm/
$ helm install my-xelos xelos/xelos-server
XELOS Social Workplace
XELOS Social Workplace is an enterprise grade Social Intranet Software which supports the communication and collaboration aspects of modern companies. More information about XELOS and its features can be found on the XELOS Social Intranet website: https://xelos.net.
Prerequisites / Requirements
XELOS is a web application requiring different components to run in production. You are NOT required to run all components in K8S and you are also free to replace 3rd party software with a variant that fits your scenario better (e.g. mysql, mariadb, percona, galera-cluster, ...).
A standard XELOS installation is using:
- Application Server (xelosBackend + xelosFrontend for scaling)
- Worker Nodes for video and file processing (xelos worker)
- Database (mysql compatible)
- Elasticsearch
- Redis
Please note: You will need at least 8GB, preferably 16GB of RAM to run these pods. (If you are using a simple test on minikube with less resources, you will need to disable components or reduce resource requests, otherwise you will face OOM kills and hit resource limits with elasticsearch and database pods).
Test Installation
If you are looking for a simple proof of concept / requirements check you can use this helm chart and start a simplified / minimal version. This version will not really use the different components and does not include the XELOS application code (due to missing license), but should help you decide if the pod specs and your K8S is suitable for a XELOS deployment.
- Add the helm repo
$ helm repo add xelos https://blueend.bitbucket.io/helm/
- Install the primary xelos pods without persistence (no license is required for the test installation)
$ helm install my-xelos xelos/xelos-server --set elasticsearch.enabled=false,db.enabled=false,xelosBackend.persistence.enabled=false
- Upgrade the installation with modified values, activating dependencies until everything is starting without problems
$ helm upgrade my-xelos xelos/xelos-server --set elasticsearch.enabled=true,db.enabled=true,xelosBackend.persistence.enabled=true
Opening the deployment should show a status page. Congratulations: You should be able to run XELOS in your K8S cluster!
Production Environment
If you are looking to run a production environment, you will need a XELOS image which includes the application code matching your license agreement with BLUEEND/XELOS. You will get access to a private image registry, which contains a suitable image.
Please follow the following steps to prepare your environment for the production use of XELOS. These steps assume that you will modify / adapt the helm chart to suit your specific needs.
- Add the helm repo for XELOS, pull the latest chart and untar it
$ helm repo add xelos https://blueend.bitbucket.io/helm/
$ helm pull xelos/xelos-server --untar
- Check the values.yaml and templates, modify the image repository, change initial secrets etc.
xelosBackend.image: xelos/<private>:latest
xelosFrontend.image: xelos/<private>:latest
- Create an access token for the private registry on dockerhub and create a secret to pull the private images
$ kubectl create secret docker-registry regcred --docker-server=docker.io --docker-username=.. --docker-password=..<access-token-here> --docker-email=..
- Configure your XELOS license (see License below)
- Online installations: set your license key, e.g.
xelosBackend.env.XELOS_LICENSE_KEY, no license file is required - Isolated / airgapped installations: additionally download
image.licfrom the support portal (support.xelos.net), add it to a secret and enablexelosBackend.imageLicense.enabled
- Online installations: set your license key, e.g.
$ kubectl create secret generic xelos-image-license --from-file=image.lic=image.lic
- Install / Upgrade as required (either using your custom values.yaml or your custom chart)
$ helm install my-xelos xelos/xelos-server -f your-values.yaml
$ helm install my-xelos custom-xelos-chart
- Depending on your private image, it may be required to initialy seed the database
$ kubectl exec -ti <my-xelos-pod> -- php xf seed:init <seedId (default: social_intranet)>
- Reset the password for your initial user
$ kubectl exec -ti <my-xelos-pod> -- php xf user:password:set admin <newPassword>
You should be able to login to your installation, and continue via the UI and use the XELOS documentation/support portal for the next steps of configuration and administration.:
Please note: Instead of running the commands directly, you can also use bash or the interactive XELOS CLI shell for administrative tasks
$ kubectl exec -ti <my-xelos-pod> -- bash
$ kubectl exec -ti <my-xelos-pod> -- php xf shell
License
XELOS 12+ is no longer ionCube encoded and does not use a xelos.lic file anymore. The license is resolved in this order:
- Online (default): XELOS validates the license key against the XELOS repository (repo.xelos.net). No license file needs to be mounted. Set the key via
XELOS_LICENSE_KEY(or enter it in the setup wizard / Update Manager > License). The pods need outgoing HTTPS access to the repository. - Isolated / airgapped (
XELOS_RUN_ISOLATED=1): if the repository returns no license, XELOS verifies the signed image licenseimage.lic(default path/server/image.lic). - Otherwise: the last valid license status is kept (grace period) until a source is available again.
Image license (image.lic) for isolated installations
Images built for your license may already contain an image.lic. To install or renew it without rebuilding the image:
- Log in to the support portal (support.xelos.net) and click Download image.lic on your license card. The token is created fresh on every download and is valid for 18 months (or until the license expires, whichever comes first).
- Store it in a secret
$ kubectl create secret generic xelos-image-license --from-file=image.lic=image.lic
- Enable the image license in your values
xelosBackend:
imageLicense:
enabled: true # mount secret key image.lic at /server/image.lic
secretName: xelos-image-license
isolated: true # sets XELOS_RUN_ISOLATED=1 (image.lic is only used in isolated mode)
To renew the license, replace the secret and restart the pods (e.g. kubectl rollout restart deployment <release>-backend-deployment).
Upgrading from chart 0.1.x: xelosBackend.licenseConfigMapName and the xelos.lic mount were removed. An existing xelos-license configMap is no longer needed and can be deleted; XELOS 12+ ignores xelos.lic.
Secrets (credentials via Kubernetes secret volume)
Instead of putting credentials into values.yaml (plain env values in the pod spec), mount a Kubernetes secret as directory. XELOS reads every file of the directory referenced by XELOS_SECRETS_LOCATION as one variable (filename = variable name, content = value) on every request - no startup script, shell or writable filesystem required.
- Create the secret, the keys are the XELOS variable names
$ kubectl create secret generic xelos-secrets \
--from-literal=XELOS_DB_PASS='<DBPassword>' \
--from-literal=XELOS_PASSWORD_SALT='<Salt>' \
--from-file=XELOS_ADAPTER_S3=adapter_s3.json
- Enable the mount (used by xelosBackend and xelosFrontend)
xelosBackend:
secrets:
enabled: true
secretName: xelos-secrets
mountPath: /run/secrets/xelos # sets XELOS_SECRETS_LOCATION=/run/secrets/xelos
defaultMode: 0444 # 0440 only together with a pod securityContext.fsGroup
Please note:
- Values from the secret override env values.
db.auth.passwordis still passed asXELOS_DB_PASSenv var (the startup script checks for it) - set it to a placeholder likePLEASE_SETand provide the real password via the secret. - Only keys named
XELOS_*,XF_*orFORCE_*are read. Scalar values are used verbatim (only a trailing newline is removed), values starting with{or[are decoded as JSON (e.g.XELOS_ADAPTER_S3). Keep boolean/numeric settings inenv. - Do not use
subPathfor this mount, otherwise Kubernetes does not update rotated secrets. Changed secrets are picked up with the next request without restarting the pods. - PHP-FPM workers do not inherit the container environment (
clear_env), which is why web requests rely on the secrets mount or theconfig.env.jsoncreated on startup (XELOS_CONFIG_ENV_UPDATE=1). Details: XELOS docker reference.
Further information and documentation
- Please use XELOS docker reference for more parameters in the xelosBackend and xelosFrontend images
- Please refer to XELOS workers on dockerhub for options in worker images
- ElasticSearch on dockerhub
- Redis on dockerhub
- MySQL on dockerhub
- mariadb on dockerhub
Kubernetes securityContext + OpenShift deployment with random UID
The XELOS worker images are only built with default non-root user and do not require privilege escalation. If you are using the workers with readonly fs you need to make sure that /tmp is writable. If you are not providing your own certificates make /server/certs writable too. The runAsUser directive is optional and the container can be used with the OpenShift security context constraints 'anyuid', 'nonroot'.
When running the XELOS nonroot server container with OpenShift security context constraint 'anyuid', you need to make sure that the container environment variable is set accordingly:
XELOS_WEBSERVER_UID: -1
XELOS_SYSTEM_UID: -1
XELOS_SYSTEMWEBSERVER_GID: 0
The container will skip the dynamic configuration if 'anyuid' is detected and any changes required to internal etc configurations need to be implemented by using configmaps (e.g. NGINX server name will default to localhost, SSL is enabled by default). If your environment allows, it is recommended to use runAsUser: 10000 which will enable basic service configuration using environment variables.
You can use the following securityContext for the XELOS server container:
securityContext:
runAsUser: 10000 # Remove in OpenShift for 'anyuid'
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
Feedback / Roadmap / Contact
We are currently testing this helm chart and collect feedback. Please share your thoughts and submit modifications you feel should be in the official helm chart for XELOS.
The following topics are currently planned / under investigation:
- Ingress / Loadbalancer Setup with SSL
- Improved livenessProbe for all deployments
MIT License
THIS CHART IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Deploy xelos-server with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has xelos-server on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartxelos-server is pinned at v0.2.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply