Skip to content

Commit e6ac0ef

Browse files
PSPDFKitPSPDFKit
PSPDFKit
authored and
PSPDFKit
committed
PSPDFKit Helm Charts
0 parents  commit e6ac0ef

File tree

97 files changed

+3925
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3925
-0
lines changed

.github/workflows/static.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["master"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v3
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v2
38+
with:
39+
path: 'repository/'
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v2

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# PSPDFKit Helm Charts
2+
3+
## Using this repository
4+
5+
```
6+
helm repo add pspdfkit https://pspdfkit.github.io/helm-charts
7+
helm repo update
8+
```
9+
10+
## Installing PDPDFKit tools
11+
12+
### Processor
13+
14+
```
15+
helm upgrade --install --debug --dry-run \
16+
processor pspdfkit/processor \
17+
-n pspdfkit-services \
18+
-f ./processor-values.yaml
19+
```
20+
21+
### Server
22+
23+
```
24+
helm upgrade --install --debug --dry-run
25+
server pspdfkit/server \
26+
-n pspdfkit-services \
27+
-f ./server-values.yaml
28+
```

charts/document-engine/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!templates/*

charts/document-engine/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/document-engine/Chart.lock

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 13.3.0
5+
digest: sha256:bb80f788b7315e53c5b8a8ee726a03a25445a0ca4d5a826588f6fda5bd16a4d4
6+
generated: "2024-01-18T19:35:06.348569+01:00"

charts/document-engine/Chart.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v2
2+
name: document-engine
3+
description: PSPDFKit Document Engine
4+
icon: data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwMCIgaGVpZ2h0PSIxMDAwIiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMzQyLjU2NyA2NTguNjEyTDMyOS40OTYgNjY1LjkxNUwzMzguNzk5IDY1NC4yODZDMzk5LjMxIDU3OS44NDIgNDMzLjAyNiA0ODcuMjExIDQzNC41MjggMzkxLjI4OEw0MzQuNzYgMzc2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kxLjczNyA4OTYuMDQgNjgwLjY1OUM5MDguNjkyIDYzMS40NDUgODg4LjQ1OCA1OTkuNzIyIDg3MS40OCA1ODIuNjUxWiIgZmlsbD0iIzVFNUNFQiIvPgo8L3N2Zz4K
5+
type: application
6+
version: 0.1.4
7+
appVersion: "0.1.0"
8+
9+
dependencies:
10+
- name: postgresql
11+
version: 13.3.0
12+
repository: https://charts.bitnami.com/bitnami
13+
condition: postgresql.enabled
Binary file not shown.
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "document-engine.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "document-engine.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "document-engine.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "document-engine.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20+
echo "Visit http://127.0.0.1:8080 to use your application"
21+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "document-engine.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "document-engine.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "document-engine.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "document-engine.labels" -}}
37+
helm.sh/chart: {{ include "document-engine.chart" . }}
38+
{{ include "document-engine.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "document-engine.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "document-engine.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "document-engine.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "document-engine.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{/*
65+
License secret name
66+
*/}}
67+
{{- define "document-engine.license.secret.name" -}}
68+
{{- if not .Values.pspdfkit.license.externalSecret.name -}}
69+
{{- printf "%s-license" (include "document-engine.fullname" .) -}}
70+
{{- else -}}
71+
{{- .Values.pspdfkit.license.externalSecret.name -}}
72+
{{- end -}}
73+
{{- end -}}
74+
75+
{{- define "document-engine.license.secret.key" -}}
76+
{{- if not .Values.pspdfkit.license.externalSecret.name -}}
77+
ACTIVATION_KEY
78+
{{- else -}}
79+
{{- .Values.pspdfkit.license.externalSecret.key -}}
80+
{{- end -}}
81+
{{- end -}}
82+
83+
{{/*
84+
API and dashboard secrets
85+
*/}}
86+
{{- define "document-engine.api.secret.name" -}}
87+
{{- if (eq .Values.pspdfkit.auth.api.createSecret true) -}}
88+
{{- printf "%s-api-auth" (include "document-engine.fullname" .) -}}
89+
{{- else -}}
90+
{{- .Values.pspdfkit.auth.api.externalSecretName -}}
91+
{{- end -}}
92+
{{- end -}}
93+
94+
{{- define "document-engine.dashboard.secret.name" -}}
95+
{{- if (eq .Values.pspdfkit.auth.dashboard.createSecret true) -}}
96+
{{- printf "%s-dashboard-auth" (include "document-engine.fullname" .) -}}
97+
{{- else -}}
98+
{{- .Values.pspdfkit.auth.dashboard.externalSecretName -}}
99+
{{- end -}}
100+
{{- end -}}
101+
102+
{{/*
103+
Database secrets
104+
*/}}
105+
{{- define "document-engine.storage.postgres.secret.name" -}}
106+
{{- if (eq .Values.pspdfkit.storage.postgres.auth.createSecret true) -}}
107+
{{- printf "%s-db-postgres" (include "document-engine.fullname" .) -}}
108+
{{- else -}}
109+
{{- .Values.pspdfkit.storage.postgres.auth.externalSecretName -}}
110+
{{- end -}}
111+
{{- end -}}
112+
113+
{{- define "document-engine.storage.postgres.adminSecret.name" -}}
114+
{{- if (eq .Values.pspdfkit.storage.postgres.auth.createSecret true) -}}
115+
{{- printf "%s-db-postgres-admin" (include "document-engine.fullname" .) -}}
116+
{{- else -}}
117+
{{- .Values.pspdfkit.storage.postgres.auth.externalAdminSecretName -}}
118+
{{- end -}}
119+
{{- end -}}
120+
121+
{{/*
122+
Object storage parameters
123+
*/}}
124+
{{- define "document-engine.s3.enabled" -}}
125+
{{- if .Values.pspdfkit.storage.assetStorageBackend -}}
126+
{{- with .Values.pspdfkit.storage.assetStorageBackend -}}
127+
{{- if eq . "s3" -}}
128+
{{- true -}}
129+
{{- else -}}
130+
{{- false -}}
131+
{{- end -}}
132+
{{- end -}}
133+
{{- else -}}
134+
{{- false -}}
135+
{{- end -}}
136+
{{- end -}}
137+
138+
{{- define "document-engine.s3.createSecret" -}}
139+
{{- if and (eq (include "document-engine.s3.enabled" .) "true") (not .Values.pspdfkit.storage.s3.auth.externalSecretName) -}}
140+
{{- true -}}
141+
{{- else -}}
142+
{{- false -}}
143+
{{- end -}}
144+
{{- end -}}
145+
146+
{{- define "document-engine.s3.secretName" -}}
147+
{{- if (eq (include "document-engine.s3.createSecret" .) "true") -}}
148+
{{- printf "%s-s3" (include "document-engine.fullname" .) -}}
149+
{{- else -}}
150+
{{- .Values.pspdfkit.storage.s3.auth.externalSecretName -}}
151+
{{- end -}}
152+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "document-engine.fullname" . }}-config
5+
labels:
6+
{{- include "document-engine.labels" . | nindent 4 }}
7+
data:
8+
LOG_LEVEL: {{ .Values.pspdfkit.log.level | quote }}
9+
PDF_GENERATION_TIMEOUT: {{ mul 1000 .Values.pspdfkit.generationTimeoutSeconds | quote }}
10+
SERVER_REQUEST_TIMEOUT: {{ mul 1000 .Values.pspdfkit.requestTimeoutSeconds | quote }}
11+
REMOTE_URL_FETCH_TIMEOUT: {{ mul 1000 .Values.pspdfkit.urlFetchTimeoutSeconds | quote }}
12+
READ_ANNOTATION_BATCH_TIMEOUT: {{ mul 1000 .Values.pspdfkit.readAnnotationBatchTimeoutSeconds | quote }}
13+
PSPDFKIT_WORKER_POOL_SIZE: {{ .Values.pspdfkit.workerPoolSize | quote }}
14+
ALLOW_DOCUMENT_UPLOADS: {{ .Values.pspdfkit.allowDocumentUploads | quote }}
15+
ALLOW_REMOTE_DOCUMENTS: {{ .Values.pspdfkit.allowRemoteDocuments | quote }}
16+
ALLOW_DOCUMENT_GENERATION: {{ .Values.pspdfkit.allowDocumentGeneration | quote }}
17+
ALLOW_REMOTE_ASSETS_IN_GENERATION: {{ .Values.pspdfkit.allowRemoteAssetsInGeneration | quote }}
18+
IGNORE_INVALID_ANNOTATIONS: {{ .Values.pspdfkit.ignoreInvalidAnnotations | quote }}
19+
ASSET_STORAGE_CACHE_SIZE: {{ mul 1048576 .Values.pspdfkit.assetStorageCacheSizeMegaBytes | quote }}
20+
AUTOMATIC_LINK_EXTRACTION: {{ .Values.pspdfkit.automaticLinkExtraction | quote }}
21+
USE_REDIS_CACHE: "false"
22+
{{- if .Values.pspdfkit.storage.enableMigrationJobs }}
23+
ENABLE_DATABASE_MIGRATIONS: "false"
24+
EXIT_AFTER_DATABASE_MIGRATIONS: "false"
25+
{{- else }}
26+
ENABLE_DATABASE_MIGRATIONS: "true"
27+
EXIT_AFTER_DATABASE_MIGRATIONS: "false"
28+
{{- end }}
29+
{{- with .Values.pspdfkit.storage }}
30+
ASSET_STORAGE_BACKEND: {{ default "built-in" .assetStorageBackend | quote }}
31+
{{- if eq .assetStorageBackend "s3" }}
32+
ASSET_STORAGE_S3_BUCKET: {{ default "none" .s3.bucket | quote }}
33+
ASSET_STORAGE_S3_REGION: {{ default "none" .s3.region | quote }}
34+
{{- if .s3.host }}
35+
ASSET_STORAGE_S3_HOST: {{ .s3.host | quote }}
36+
ASSET_STORAGE_S3_PORT: {{ default "443" .s3.port | quote }}
37+
ASSET_STORAGE_S3_SCHEME: {{ default "https://" .s3.scheme | quote }}
38+
{{- end }}
39+
{{- end }}
40+
ENABLE_ASSET_STORAGE_FALLBACK: {{ default "false" .enableAssetStorageFallback | quote }}
41+
{{- end }}
42+
{{- with .Values.pspdfkit.signingService }}
43+
{{- if .enabled }}
44+
SIGNING_SERVICE_URL: {{ default "none" .url | quote }}
45+
SIGNING_SERVICE_TIMEOUT: {{ mul 1000 .timeoutSeconds | quote }}
46+
DEFAULT_SIGNER_NAME: {{ default "none" .defaultSignerName | quote }}
47+
DEFAULT_SIGNATURE_REASON: {{ default "none" .defaultSignatureReason | quote }}
48+
DEFAULT_SIGNATURE_LOCATION: {{ default "none" .defaultSignatureLocation | quote }}
49+
DIGITAL_SIGNATURE_HASH_ALGORITHM: {{ default "sha512" .digitalSignatureHashAlgorithm | quote }}
50+
DIGITAL_SIGNATURE_CERTIFICATE_CHECK_TIME: {{ default "current_time" .digitalSignatureCertificateCheckTime | quote }}
51+
{{- end }}
52+
{{- end }}
53+
{{- with .Values.pspdfkit.trustedProxies }}
54+
TRUSTED_PROXIES: {{ . | quote }}
55+
{{- end }}
56+
{{- if .Values.prometheusExporter.enabled }}
57+
STATSD_HOST: localhost
58+
STATSD_PORT: {{ .Values.prometheusExporter.statsdPort | quote }}
59+
STATSD_CUSTOM_TAGS: "namespace={{ .Release.Namespace }},app={{ include "document-engine.fullname" . }}"
60+
{{- end }}
61+
# Can be used for hash updating
62+
VERSION: {{ include "document-engine.chart" . | quote }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "document-engine.fullname" . }}
5+
labels:
6+
{{- include "document-engine.labels" . | nindent 4 }}
7+
data:
8+
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace ( include "document-engine.fullname" . ) ) | default dict }}
9+
{{- $secretData := (get $secretObj "data") | default dict }}
10+
{{- $secretKeyBase := (get $secretData "SECRET_KEY_BASE") | default ( default (randAlphaNum 256) .Values.pspdfkit.secretKeyBase | b64enc) }}
11+
SECRET_KEY_BASE: {{ $secretKeyBase | quote }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if .Values.pspdfkit.auth.api.createSecret }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "document-engine.fullname" . }}-api-auth
6+
labels:
7+
{{- include "document-engine.labels" . | nindent 4 }}
8+
data:
9+
API_AUTH_TOKEN: {{ default (randAlphaNum 64) .Values.pspdfkit.auth.api.apiToken | b64enc | quote }}
10+
{{- if .Values.pspdfkit.auth.api.jwt.enabled }}
11+
JWT_PUBLIC_KEY: {{ default "none" .Values.pspdfkit.auth.api.jwt.publicKey | b64enc | quote }}
12+
JWT_ALGORITHM: {{ default "none" .Values.pspdfkit.auth.api.jwt.algorithm | b64enc | quote }}
13+
{{- end }}
14+
{{- end }}

0 commit comments

Comments
 (0)