Kubernetes
Prerequisites
Kubernetes
- Kubernetes 1.14+
- Helm 3.1.0+
- (optional: sealed secrets)
Container Image Access
Because the images used in this chart are from a private container registry you need to have
- access to the container
registry registry.jadice.com - OR access to a proxy
registry registry.jadice.com
Since the used Helm charts come from a private container registry, they also require
- access to the helm registry
artifacts.jadice.com
Installing the Chart
On this page we showcase how to install the jadice web viewer via its corresponding Helm Chart.
Download Helm Chart
There is the option to download a Helm Chart with the command:
$ helm pull levigo/jadice-web-viewer
Install from jadice helm repository
In this case our release name will be my-release:
$ helm repo add levigo https://artifacts.jadice.com/repository/helm-charts/ --username <username>
Password: <enter your password>
$ helm install my-release levigo/jadice-web-viewer
Configuration
The chart runs the jadice web viewer as is; all parameters below are optional unless stated otherwise.
Pass them with --set or, preferably, in your own values file:
$ helm install my-release levigo/jadice-web-viewer -f my-values.yaml
This page describes the parameters that are relevant for integrators. Parameters for standard Kubernetes settings are listed in Further Kubernetes settings.
Image and registry
| Parameter | Description | Default |
|---|---|---|
image.registry | Container registry the image is pulled from | registry.jadice.com |
image.repository | Image name | jadice-web-viewer-dist |
image.tag | Image tag | appVersion of the chart |
image.pullPolicy | Kubernetes image pull policy | IfNotPresent |
global.imageRegistry | Overrides image.registry, e.g. for a registry proxy or mirror | nil |
imagePullSecrets | List of pull secrets used by the pod | [{name: registry-secret}] |
image.createPullSecret | Let the chart create the secret registry-secret from secrets.imageRegistry.* (see below) | true |
secrets.useSealedSecrets | Create the secrets from the secrets.* values as SealedSecrets; the secret values must then be provided encrypted | false |
Image pull secrets
To access the container registry you have the following three options:
-
Use an existing Kubernetes docker-registry secret: set
image.createPullSecret: falseand reference the secret viaimagePullSecrets:image:
createPullSecret: false
imagePullSecrets:
- name: my-registry-secretFor instructions on how to create a Kubernetes docker-registry secret check out the Documentation or the output of
kubectl create secret docker-registry --help -
Let the chart create the secret
registry-secretby providing the credentials to the registry:Parameter Description Default secrets.imageRegistry.serverServer of the container registry registry.jadice.comsecrets.imageRegistry.usernameUsername for the container registry nilsecrets.imageRegistry.passwordPassword for the container registry nil -
For sealed secrets (
secrets.useSealedSecrets: true), you can encrypt the content of a ~/.docker/config.json file as a String and provide this as the value for the parametersecrets.imageRegistry.dockerconfigjson.To create this String you could run the following command
kubectl create secret docker-registry registry-secret \
--docker-username=<user> \
--docker-password=<password> \
--docker-server=registry.jadice.com \
--dry-run=client -o json | jq -r '.data[".dockerconfigjson"]' | base64 -d | kubeseal --raw --from-file=/dev/stdin --namespace <namespace> --name registry-secretNote:
- Requires
jqandkubeseal - Replace
<user>,<password>,<namespace>with the respective values.
- Requires
License
The license (see License file) can be provided in one of the following ways. If several are set, the first one in this list wins:
| Parameter | Description | Default |
|---|---|---|
existingLicenseSecret | Name of an existing Secret with the key license.yaml. Its content is a complete license file (jadice.licenseConfiguration.license, .fingerprint, .publicKey). | nil |
secrets.licenseInformation.license | Only without sealed secrets: the license from your license file. The chart creates the Secret license-secret and adds the public key itself. | nil |
secrets.licenseInformation.fingerprint | Only without sealed secrets: the fingerprint from your license file; required together with secrets.licenseInformation.license. | nil |
secrets.licenseInformation.licenseYaml | Only with secrets.useSealedSecrets: true: the complete, encrypted content of the license file. Without sealed secrets this parameter results in an empty license. | nil |
If none of these parameters is set, the chart falls back to a trial license. Make sure a production deployment provides its own license.
Application configuration
The chart writes the Spring Boot configuration of the viewer into the file /config/application-k8s.yml
(Spring profile k8s). The following parameters extend this configuration and the container; for the available
application properties see Customization and
Client-Configuration.
| Parameter | Description | Default |
|---|---|---|
additionalAppYamlSnippet | Application properties appended to application-k8s.yml (see note below) | {} |
webtoolkit.clientConfiguration | Client configuration (see Client-Configuration); merged with the chart default. Other webtoolkit.* values are ignored by the chart; set them via additionalAppYamlSnippet. | {maxUploadFileSize: 50000000} |
extraEnvVars | Additional environment variables for the container (Kubernetes env spec), e.g. to inject credentials from a Secret. | [] |
javaOptions.enabled | Set the JVM options from javaOptions.value as _JAVA_OPTIONS | false |
javaOptions.value | JVM options, e.g. loader.path. Note that the default contains -Xmx1G, which limits the heap to 1 GB. | -Xmx1G -Djwt.log.dir=/var/logs |
additionalConfigMaps | Existing ConfigMaps to mount into the container. Each entry needs name, mountPath, subPath and readOnly. | nil |
volumes | Additional pod volumes, e.g. a PersistentVolumeClaim with plugin JARs | [] |
volumeMounts | Additional volume mounts for the container | [] |
additionalAppYamlSnippet is appended to a file that already contains the top-level keys webtoolkit, logging,
management and either jadice or spring.config.import. Repeating one of these keys results in a duplicate key,
and the viewer fails to start.
Customer-specific extensions (plugin JARs)
JAR files directly in /config/ are on the classpath of the viewer (see Customization).
Because the chart mounts its own configuration files into /config/, mount plugin JARs into a subdirectory and add it to
loader.path:
volumes:
- name: plugins
persistentVolumeClaim:
claimName: jwv-plugins
readOnly: true
volumeMounts:
- name: plugins
mountPath: /config/lib
readOnly: true
javaOptions:
enabled: true
value: "-Djwt.log.dir=/var/logs -Dloader.path=/config/,/config/lib/"
Networking
The Service (service.*) forwards to the HTTP port 8080 of the container. The Spring Boot management endpoints
(actuator) run on a separate port, managementPort (default 8000); the probes use it, and the Service does not
expose it. The Ingress is configured via ingress.* (see Further Kubernetes settings).
With haproxy.enabled: true, the Ingress forwards to the HAProxy Service instead (see
Multiple replicas and sticky sessions).
The jadice web viewer has no built-in user authentication. Access control has to be provided by the infrastructure in front of the viewer, e.g. the Ingress controller or an authenticating proxy.
Multiple replicas and sticky sessions
The viewer keeps the session of a client, including its documents, in the memory of the pod
(see Load-Balancing / Session Affinity / Sticky Sessions). If you run more than one
replica (replicaCount > 1 or autoscaling.enabled: true), all requests of a client have to reach the same pod.
You can achieve this in one of two ways:
-
Cookie affinity of the Ingress controller: if your Ingress controller supports it, leave
haproxy.enabled: falseand set the corresponding annotations iningress.annotations, e.g. for ingress-nginx:ingress:
annotations:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/affinity-mode: "persistent"For HAProxy Ingress, use
haproxy.org/cookie-persistence: "route". -
HAProxy from the chart (
haproxy.enabled: true): independent of the Ingress controller. The chart deploys HAProxy in front of the viewer pods. HAProxy discovers the ready viewer pods via a headless Service, so pods added by the autoscaler receive traffic automatically. It binds each client to a pod with a cookie. The cookie value is derived from the pod address andhaproxy.cookie.dynamicKey, so all HAProxy replicas route a client to the same pod.replicaCount: 3
haproxy:
enabled: true
cookie:
dynamicKey: "<random value per installation>"
Sticky sessions do not provide failover. If a viewer pod terminates, e.g. during a rolling update or a scale-down, the sessions on this pod are lost: the open documents are no longer displayed, and the users have to reload the viewer. Plan updates accordingly.
| Parameter | Description | Default |
|---|---|---|
haproxy.enabled | Deploy HAProxy with sticky sessions in front of the viewer; the Ingress then forwards to the HAProxy Service | false |
haproxy.replicaCount | Number of HAProxy pods | 2 |
haproxy.image.registry | Container registry of the HAProxy image | docker.io |
haproxy.image.repository | HAProxy image | haproxytech/haproxy-alpine |
haproxy.image.tag | HAProxy image tag | 3.2.24 |
haproxy.imagePullSecrets | Pull secrets for the HAProxy image, e.g. when using a registry mirror | [] |
haproxy.service.type | Type of the HAProxy Service | ClusterIP |
haproxy.service.port | Port of the HAProxy Service | 80 |
haproxy.maxServers | Maximum number of viewer pods HAProxy can route to. Must be at least the maximum number of replicas. If empty, the larger of replicaCount, autoscaling.maxReplicas and 10 is used. | nil |
haproxy.clusterDomain | DNS domain of the cluster, used to discover the viewer pods. Adjust it if your cluster does not use the default domain. | cluster.local |
haproxy.cookie.name | Name of the sticky-session cookie | JWVSRV |
haproxy.cookie.secure | Set the Secure attribute. Requires HTTPS between browser and Ingress; over plain HTTP the browser drops the cookie and the sticky sessions do not work. | true |
haproxy.cookie.sameSite | Value of the SameSite attribute. Use None (requires secure: true) if the viewer is embedded cross-site, e.g. in an iframe. | Lax |
haproxy.cookie.dynamicKey | Key used to compute the cookie value; set a random value per installation. If empty, a value derived from release name and namespace is used. | "" |
haproxy.timeouts.client | Maximum inactivity time on the client side | 60s |
haproxy.timeouts.server | Maximum inactivity time on the server side; must be longer than the longest viewer request | 60s |
haproxy.timeouts.tunnel | Maximum inactivity time of WebSocket connections | 1h |
haproxy.accessLog | Write HTTP access logs to stdout. The logs contain client IP addresses (personal data). | false |
haproxy.additionalBackendConfig | Additional lines for the HAProxy backend section | "" |
haproxy.podDisruptionBudget.enabled | Create a PodDisruptionBudget for HAProxy (only with more than one HAProxy replica) | true |
HAProxy runs as a non-root user with a read-only root file system. The parameters haproxy.resources,
haproxy.podAnnotations, haproxy.podSecurityContext, haproxy.securityContext, haproxy.nodeSelector,
haproxy.tolerations and haproxy.affinity have their usual Kubernetes meaning. Without haproxy.affinity, the
HAProxy pods are preferably scheduled on different nodes.
jadice flow
The viewer can use jadice flow to convert additional formats (e.g. Office documents, HEIC images, e-mails) before display.
| Parameter | Description | Default |
|---|---|---|
enableJadiceFlow | Enable the jadice flow integration | false |
secrets.controller.url | URL of the jadice flow controller (required) | nil |
secrets.controller.accessToken | Access token for the jadice flow controller (required) | nil |
flow.requestTimeout | Timeout for requests to jadice flow in seconds | 60 |
flow.storageType | Storage used to exchange documents with jadice flow: s3 or eureka | s3 |
flow.auth.existingSecret.s3 | Use an existing Secret with the S3 credentials instead of secrets.s3.*. The Secret must be named s3-secret. | nil |
flow.auth.existingSecret.eureka | Use an existing Secret with the eureka credentials instead of secrets.eureka.*. The Secret must be named eureka-secret. | nil |
flow.formatFlow.resize-max-width | Maximum width for resizing images | 1000 |
flow.formatFlow.resize-max-height | Maximum height for resizing images | 1000 |
flow.formatFlow.formats | Conversions to run: workflow-name, mime-types-input (comma-separated), mime-type-output, format-output. Overriding replaces the whole list. | x-to-pdf, heic-to-png, mail-to-pdf |
S3 storage (flow.storageType: s3):
| Parameter | Description | Default |
|---|---|---|
secrets.s3.endpoint | S3 endpoint (required) | nil |
secrets.s3.bucket | Bucket (required) | nil |
secrets.s3.accessKey | Access key (required) | nil |
secrets.s3.secretKey | Secret key (required) | nil |
secrets.s3.region | Region | null |
secrets.s3.protocol | Protocol | https |
secrets.s3.trustSelfSigned | Trust self-signed certificates | false |
secrets.s3.trustAll | Trust all certificates | false |
secrets.s3.pathStyleAccessEnabled | Use path-style access | true |
Provide trustSelfSigned, trustAll and pathStyleAccessEnabled as quoted strings ("true" / "false");
unquoted booleans are not processed correctly by the chart. With secrets.useSealedSecrets: true all S3 values are
required and must be encrypted.
eureka storage (flow.storageType: eureka):
| Parameter | Description | Default |
|---|---|---|
secrets.eureka.url | URL of eureka | http://eureka.jadice-flow |
secrets.eureka.username | Username | nil |
secrets.eureka.password | Password | nil |
Unless you use flow.auth.existingSecret.eureka, set secrets.eureka.username and secrets.eureka.password. Without a username, the chart ignores
secrets.eureka.url and takes all values from an existing Secret eureka-secret in the namespace; if there is none,
it generates a random username and password and leaves the URL empty.
Further Kubernetes settings
The following parameters have their usual Kubernetes or Helm meaning and are passed through unchanged:
nameOverride, fullnameOverride, commonLabels, podAnnotations, podSecurityContext, securityContext,
serviceAccount.create, serviceAccount.annotations, serviceAccount.name, nodeSelector, tolerations, affinity,
service.type, service.port, ingress.enabled, ingress.className, ingress.annotations, ingress.hosts,
ingress.tls, replicaCount, strategy, autoscaling.enabled, autoscaling.minReplicas, autoscaling.maxReplicas,
autoscaling.targetCPUUtilizationPercentage, autoscaling.targetMemoryUtilizationPercentage, resources.
The probes livenessProbe, readinessProbe and startupProbe call the path / on the management port and can be
configured via enabled, path, port, initialDelaySeconds (not for startupProbe), periodSeconds,
timeoutSeconds and failureThreshold. By default the startup probe allows 90 seconds for the start
(periodSeconds: 3 × failureThreshold: 30); increase startupProbe.failureThreshold if the viewer takes longer
to start, e.g. with many plugins.