Skip to main content

Kubernetes

Prerequisites​

Kubernetes​

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​

ParameterDescriptionDefault
image.registryContainer registry the image is pulled fromregistry.jadice.com
image.repositoryImage namejadice-web-viewer-dist
image.tagImage tagappVersion of the chart
image.pullPolicyKubernetes image pull policyIfNotPresent
global.imageRegistryOverrides image.registry, e.g. for a registry proxy or mirrornil
imagePullSecretsList of pull secrets used by the pod[{name: registry-secret}]
image.createPullSecretLet the chart create the secret registry-secret from secrets.imageRegistry.* (see below)true
secrets.useSealedSecretsCreate the secrets from the secrets.* values as SealedSecrets; the secret values must then be provided encryptedfalse

Image pull secrets​

To access the container registry you have the following three options:

  1. Use an existing Kubernetes docker-registry secret: set image.createPullSecret: false and reference the secret via imagePullSecrets:

    image:
    createPullSecret: false
    imagePullSecrets:
    - name: my-registry-secret

    For instructions on how to create a Kubernetes docker-registry secret check out the Documentation or the output of kubectl create secret docker-registry --help

  2. Let the chart create the secret registry-secret by providing the credentials to the registry:

    ParameterDescriptionDefault
    secrets.imageRegistry.serverServer of the container registryregistry.jadice.com
    secrets.imageRegistry.usernameUsername for the container registrynil
    secrets.imageRegistry.passwordPassword for the container registrynil
  3. 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 parameter secrets.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-secret

    Note:

    • Requires jq and kubeseal
    • Replace <user>, <password>, <namespace> with the respective values.

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:

ParameterDescriptionDefault
existingLicenseSecretName of an existing Secret with the key license.yaml. Its content is a complete license file (jadice.licenseConfiguration.license, .fingerprint, .publicKey).nil
secrets.licenseInformation.licenseOnly 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.fingerprintOnly without sealed secrets: the fingerprint from your license file; required together with secrets.licenseInformation.license.nil
secrets.licenseInformation.licenseYamlOnly with secrets.useSealedSecrets: true: the complete, encrypted content of the license file. Without sealed secrets this parameter results in an empty license.nil
caution

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.

ParameterDescriptionDefault
additionalAppYamlSnippetApplication properties appended to application-k8s.yml (see note below){}
webtoolkit.clientConfigurationClient configuration (see Client-Configuration); merged with the chart default. Other webtoolkit.* values are ignored by the chart; set them via additionalAppYamlSnippet.{maxUploadFileSize: 50000000}
extraEnvVarsAdditional environment variables for the container (Kubernetes env spec), e.g. to inject credentials from a Secret.[]
javaOptions.enabledSet the JVM options from javaOptions.value as _JAVA_OPTIONSfalse
javaOptions.valueJVM options, e.g. loader.path. Note that the default contains -Xmx1G, which limits the heap to 1 GB.-Xmx1G -Djwt.log.dir=/var/logs
additionalConfigMapsExisting ConfigMaps to mount into the container. Each entry needs name, mountPath, subPath and readOnly.nil
volumesAdditional pod volumes, e.g. a PersistentVolumeClaim with plugin JARs[]
volumeMountsAdditional volume mounts for the container[]
caution

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).

caution

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: false and set the corresponding annotations in ingress.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 and haproxy.cookie.dynamicKey, so all HAProxy replicas route a client to the same pod.

    replicaCount: 3
    haproxy:
    enabled: true
    cookie:
    dynamicKey: "<random value per installation>"
caution

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.

ParameterDescriptionDefault
haproxy.enabledDeploy HAProxy with sticky sessions in front of the viewer; the Ingress then forwards to the HAProxy Servicefalse
haproxy.replicaCountNumber of HAProxy pods2
haproxy.image.registryContainer registry of the HAProxy imagedocker.io
haproxy.image.repositoryHAProxy imagehaproxytech/haproxy-alpine
haproxy.image.tagHAProxy image tag3.2.24
haproxy.imagePullSecretsPull secrets for the HAProxy image, e.g. when using a registry mirror[]
haproxy.service.typeType of the HAProxy ServiceClusterIP
haproxy.service.portPort of the HAProxy Service80
haproxy.maxServersMaximum 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.clusterDomainDNS 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.nameName of the sticky-session cookieJWVSRV
haproxy.cookie.secureSet 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.sameSiteValue of the SameSite attribute. Use None (requires secure: true) if the viewer is embedded cross-site, e.g. in an iframe.Lax
haproxy.cookie.dynamicKeyKey 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.clientMaximum inactivity time on the client side60s
haproxy.timeouts.serverMaximum inactivity time on the server side; must be longer than the longest viewer request60s
haproxy.timeouts.tunnelMaximum inactivity time of WebSocket connections1h
haproxy.accessLogWrite HTTP access logs to stdout. The logs contain client IP addresses (personal data).false
haproxy.additionalBackendConfigAdditional lines for the HAProxy backend section""
haproxy.podDisruptionBudget.enabledCreate 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.

ParameterDescriptionDefault
enableJadiceFlowEnable the jadice flow integrationfalse
secrets.controller.urlURL of the jadice flow controller (required)nil
secrets.controller.accessTokenAccess token for the jadice flow controller (required)nil
flow.requestTimeoutTimeout for requests to jadice flow in seconds60
flow.storageTypeStorage used to exchange documents with jadice flow: s3 or eurekas3
flow.auth.existingSecret.s3Use an existing Secret with the S3 credentials instead of secrets.s3.*. The Secret must be named s3-secret.nil
flow.auth.existingSecret.eurekaUse an existing Secret with the eureka credentials instead of secrets.eureka.*. The Secret must be named eureka-secret.nil
flow.formatFlow.resize-max-widthMaximum width for resizing images1000
flow.formatFlow.resize-max-heightMaximum height for resizing images1000
flow.formatFlow.formatsConversions 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):

ParameterDescriptionDefault
secrets.s3.endpointS3 endpoint (required)nil
secrets.s3.bucketBucket (required)nil
secrets.s3.accessKeyAccess key (required)nil
secrets.s3.secretKeySecret key (required)nil
secrets.s3.regionRegionnull
secrets.s3.protocolProtocolhttps
secrets.s3.trustSelfSignedTrust self-signed certificatesfalse
secrets.s3.trustAllTrust all certificatesfalse
secrets.s3.pathStyleAccessEnabledUse path-style accesstrue

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):

ParameterDescriptionDefault
secrets.eureka.urlURL of eurekahttp://eureka.jadice-flow
secrets.eureka.usernameUsernamenil
secrets.eureka.passwordPasswordnil

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.