Skip to content

Commit

Permalink
official sophora helm charts (#12)
Browse files Browse the repository at this point in the history
* helm chart tests

* Release only if tests succeed

* rename job to release

* Sophora Indexing Service 1.0.0

* run tests on latest ubuntu runner

* fix helm tests

* Courier

* Sophora Deskclient Downloads

* External Secrets

* Sophora Dashboard

* move Sophora Dashboard to correct directory

* Sophora Exporter Job

* Sophora Image Access Service

* Sophora Image Update Service

* Sophora Import Job

* Sophora Importer

* remove Sophora Importer v3 support

* Sophora Indexer

* Sophora Metadata Supplier

* Sophora Server

* Sophora UGC

* Sophora Webclient

* YouTube Connector

* remove obsolete deskclient-downloads helm chart

* small changes/fixes in readmes

---------

Co-authored-by: Philip Dakowitz <[email protected]>
  • Loading branch information
tom-schoener and philmtd authored Apr 13, 2023
1 parent 9156e02 commit 998ab88
Show file tree
Hide file tree
Showing 183 changed files with 10,974 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release-chart.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Release Charts

on:
push:
branches:
- main
workflow_run:
workflows: [ "Test Charts" ]
branches: [ main ]
types:
- completed

jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/test-charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Charts

on: ["push", "pull_request"]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: azure/setup-helm@v3
with:
version: 'v3.11.2'
token: ${{ secrets.GITHUB_TOKEN }}
id: install
- name: Helm Deps
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Test Chart
run: |
for d in charts/* ; do
echo "testing $d..."
pushd $d
helm dependency build
if [ -e "test-values.yaml" ]
then
helm template -f test-values.yaml test .
else
echo "skipping $d because test-values.yaml was not found"
fi
popd
done
23 changes: 23 additions & 0 deletions charts/courier/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions charts/courier/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: courier
description: A Helm chart for Courier

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: '4.0.1'
87 changes: 87 additions & 0 deletions charts/courier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Courier

This chart deploys courier.

## What you need (requirements)

This chart requires the following already present in the target namespace:

* An ImagePullSecret for the subshell Docker Registry
* A secret containing username and password for Sophora, basicauth and the mail server.

## Example values.yaml

```yaml
image:
repository: docker.subshell.com/sophora-courier/base
pullPolicy: Always
tag: # Overrides the image tag whose default is the chart appVersion.

imagePullSecrets: []

javaOptions: "-XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=90.0 -XX:+AlwaysPreTouch"

service:
type: LoadBalancer
port: 80
targetPort: 8080
jolokiaPort: 1496
jolokiaTargetPort: 1496

sophora:
courier:
config:
server:
port: 8080

sophora:
serverUrl: "http://my-server:1196"
urlServletPath: "http://my-delivery.default.svc.cluster.local/system/servlet/urlService.servlet"
channel: presse
retryIntervalInMs: 5000
maxRetries: 5
noRetryErrorMessage: "Fehler: E-Mail/Newsletter hat keinen Inhalt."

preview:
urlServletPath: "http://my-delivery.default.svc.cluster.local/system/servlet/urlService.servlet"
userExternalId: preview-user-courier

propertyNames:
distributorName: customer:name
publicDistributor: customer:public

logging:
config: "config/logback/logback.xml"
path: "/logs/"

mail:
useDeliveryToGenerateTemplate: true
sendIntervalMs: 1000
maxQueueSize: 200
host: 10.5.0.2
port: 25
safeMode:
enabled: true
whitelist:
- [email protected]

resources:
requests:
memory: "3G"
cpu: "0.5"
limits:
memory: "3.5G"

secret:
name: courier-credentials
key:
courier:
username: username
password: password
basicauth:
username: username
password: password
mail:
username: username
password: password
```
62 changes: 62 additions & 0 deletions charts/courier/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "courier.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "courier.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "courier.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "courier.labels" -}}
helm.sh/chart: {{ include "courier.chart" . }}
{{ include "courier.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "courier.selectorLabels" -}}
app.kubernetes.io/name: {{ include "courier.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "courier.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "courier.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/courier/templates/courier-config-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "courier.fullname" . }}-config
labels:
app: {{ include "courier.fullname" . }}
data:
application.yml: |- {{ toYaml ( required "A configuration is required" .Values.sophora.courier.config) | nindent 4 }}
86 changes: 86 additions & 0 deletions charts/courier/templates/courier-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "courier.fullname" . }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "courier.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app: {{ include "courier.fullname" . }}
template:
metadata:
labels:
app: {{ include "courier.fullname" . }}
spec:
containers:
- name: {{ .Chart.Name }}-container
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
env:
- name: JDK_JAVA_OPTIONS
value: >-
-Dlogging.config=config/logback/logback.xml
{{ .Values.javaOptions }}
{{ if .Values.env -}}
{{- toYaml .Values.env | nindent 12 }}
{{- end }}
- name: SOPHORA_SOPHORAUSERNAME
valueFrom:
secretKeyRef:
key: {{ .Values.secret.key.courier.username }}
name: {{ .Values.secret.name }}
- name: SOPHORA_SOPHORAPASSWORD
valueFrom:
secretKeyRef:
key: {{ .Values.secret.key.courier.password }}
name: {{ .Values.secret.name }}
- name: SOPHORA_BASICAUTHUSERNAME
valueFrom:
secretKeyRef:
key: {{ .Values.secret.key.basicauth.username }}
name: {{ .Values.secret.name }}
- name: SOPHORA_BASICAUTHPASSWORD
valueFrom:
secretKeyRef:
key: {{ .Values.secret.key.basicauth.password }}
name: {{ .Values.secret.name }}
- name: MAIL_USERNAME
valueFrom:
secretKeyRef:
key: {{ .Values.secret.key.mail.username }}
name: {{ .Values.secret.name }}
- name: MAIL_PASSWORD
valueFrom:
secretKeyRef:
key: {{ .Values.secret.key.mail.password }}
name: {{ .Values.secret.name }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 1496
- containerPort: 8080
volumeMounts:
- name: {{ include "courier.fullname" . }}-logback-config
mountPath: /config/logback
- name: {{ include "courier.fullname" . }}-application-yml
mountPath: /config
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: {{ include "courier.fullname" . }}-logback-config
configMap:
name: {{ include "courier.fullname" . }}-logback
- name: {{ include "courier.fullname" . }}-application-yml
configMap:
name: {{ include "courier.fullname" . }}-config
9 changes: 9 additions & 0 deletions charts/courier/templates/courier-logback-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "courier.fullname" . }}-logback
labels:
app: {{ include "courier.fullname" . }}
data:
logback.xml: |
{{- .Values.sophora.courier.logback | nindent 4 }}
26 changes: 26 additions & 0 deletions charts/courier/templates/courier-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "courier.fullname" . }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "courier.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
ports:
- protocol: TCP
port: {{ .Values.service.jolokiaPort }}
targetPort: {{ .Values.service.jolokiaTargetPort }}
name: jolokia
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
name: rest
selector:
app: {{ include "courier.fullname" . }}
Loading

0 comments on commit 998ab88

Please sign in to comment.