Skip to content

Commit 717d527

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

Some content is hidden

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

70 files changed

+2042
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.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/.DS_Store

6 KB
Binary file not shown.

charts/processor/.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/processor/Chart.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: processor
3+
description: PSPDFKit Processor
4+
type: application
5+
version: 0.1.26
6+
appVersion: "2023.10.0"

charts/processor/templates/NOTES.txt

+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 "processor.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 "processor.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "processor.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 "processor.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 }}
+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "processor.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 "processor.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 "processor.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "processor.labels" -}}
37+
helm.sh/chart: {{ include "processor.chart" . }}
38+
{{ include "processor.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 "processor.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "processor.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 "processor.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "processor.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 "processor.license.secret.name" -}}
68+
{{- if not .Values.pspdfkit.license.externalSecret.name -}}
69+
{{- printf "%s-license" (include "processor.fullname" .) -}}
70+
{{- else -}}
71+
{{- .Values.pspdfkit.license.externalSecret.name -}}
72+
{{- end -}}
73+
{{- end -}}
74+
75+
{{- define "processor.license.secret.key" -}}
76+
{{- if not .Values.pspdfkit.license.externalSecret.name -}}
77+
LICENSE_KEY
78+
{{- else -}}
79+
{{- .Values.pspdfkit.license.externalSecret.key -}}
80+
{{- end -}}
81+
{{- end -}}
+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "processor.fullname" . }}
5+
labels:
6+
{{- include "processor.labels" . | nindent 4 }}
7+
spec:
8+
{{- if not .Values.autoscaling.enabled }}
9+
replicas: {{ .Values.replicaCount }}
10+
{{- end }}
11+
{{- if .Values.updateStrategy }}
12+
strategy:
13+
{{ toYaml .Values.updateStrategy | nindent 4 }}
14+
{{- end }}
15+
selector:
16+
matchLabels:
17+
{{- include "processor.selectorLabels" . | nindent 6 }}
18+
template:
19+
metadata:
20+
annotations:
21+
checksum/config: {{ include (print $.Template.BasePath "/processor-config.yaml") . | sha256sum }}
22+
{{- if .Values.pspdfkit.auth.api.createSecret }}
23+
checksum/auth-api: {{ include (print $.Template.BasePath "/processor-auth-secret.yaml") . | sha256sum }}
24+
{{- end }}
25+
{{- if not .Values.pspdfkit.license.externalSecret.name }}
26+
checksum/license: {{ include (print $.Template.BasePath "/processor-license-secret.yaml") . | sha256sum }}
27+
{{- end }}
28+
{{- with .Values.podAnnotations }}
29+
{{- toYaml . | nindent 8 }}
30+
{{- end }}
31+
labels:
32+
{{- include "processor.selectorLabels" . | nindent 8 }}
33+
spec:
34+
{{- with .Values.imagePullSecrets }}
35+
imagePullSecrets:
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
38+
serviceAccountName: {{ include "processor.serviceAccountName" . }}
39+
securityContext:
40+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
41+
{{- if .Values.initContainers }}
42+
initContainers:
43+
{{ toYaml .Values.initContainers | nindent 8 }}
44+
{{- end }}
45+
containers:
46+
- name: {{ .Chart.Name }}
47+
envFrom:
48+
{{- if .Values.pspdfkit.auth.api.createSecret }}
49+
- secretRef:
50+
name: {{ include "processor.fullname" . }}-auth
51+
{{- else }}
52+
{{- with .Values.pspdfkit.auth.api.externalSecretName }}
53+
- secretRef:
54+
name: {{ . }}
55+
{{- end }}
56+
{{- end }}
57+
- configMapRef:
58+
name: {{ include "processor.fullname" . }}-config
59+
env:
60+
- name: LICENSE_KEY
61+
valueFrom:
62+
secretKeyRef:
63+
name: {{ include "processor.license.secret.name" . }}
64+
key: {{ include "processor.license.secret.key" . }}
65+
{{- if .Values.extraEnvs }}
66+
{{- toYaml .Values.extraEnvs | nindent 12 }}
67+
{{- end }}
68+
securityContext:
69+
{{- toYaml .Values.securityContext | nindent 12 }}
70+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
71+
imagePullPolicy: {{ .Values.image.pullPolicy }}
72+
ports:
73+
- name: api
74+
containerPort: 5000
75+
protocol: TCP
76+
{{- if .Values.startupProbe }}
77+
startupProbe: {{ toYaml .Values.startupProbe | nindent 12 }}
78+
{{- end }}
79+
{{- if .Values.livenessProbe }}
80+
livenessProbe: {{ toYaml .Values.livenessProbe | nindent 12 }}
81+
{{- end }}
82+
{{- if .Values.readinessProbe }}
83+
readinessProbe: {{ toYaml .Values.readinessProbe | nindent 12 }}
84+
{{- end }}
85+
resources:
86+
{{- toYaml .Values.resources | nindent 12 }}
87+
{{- if .Values.extraVolumeMounts }}
88+
volumeMounts:
89+
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
90+
{{- end }}
91+
{{- if .Values.sidecars }}
92+
{{ toYaml .Values.sidecars | nindent 8 }}
93+
{{- end }}
94+
{{- if .Values.extraVolumes }}
95+
volumes:
96+
{{ toYaml .Values.extraVolumes | nindent 8 }}
97+
{{- end }}
98+
{{- with .Values.nodeSelector }}
99+
nodeSelector:
100+
{{- toYaml . | nindent 8 }}
101+
{{- end }}
102+
{{- with .Values.affinity }}
103+
affinity:
104+
{{- toYaml . | nindent 8 }}
105+
{{- end }}
106+
{{- with .Values.tolerations }}
107+
tolerations:
108+
{{- toYaml . | nindent 8 }}
109+
{{- end }}

charts/processor/templates/hpa.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2beta1
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "processor.fullname" . }}
6+
labels:
7+
{{- include "processor.labels" . | nindent 4 }}
8+
spec:
9+
scaleTargetRef:
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
name: {{ include "processor.fullname" . }}
13+
minReplicas: {{ .Values.autoscaling.minReplicas }}
14+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15+
metrics:
16+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17+
- type: Resource
18+
resource:
19+
name: cpu
20+
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
21+
{{- end }}
22+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
23+
- type: Resource
24+
resource:
25+
name: memory
26+
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
27+
{{- end }}
28+
{{- end }}

0 commit comments

Comments
 (0)