Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/2-features/pr-2935
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Roman charts are now available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Roman charts are now available.
A helm chart for the bot 'Roman' is now available.

23 changes: 23 additions & 0 deletions charts/roman/.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/roman/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: roman
description: A Helm chart for Kubernetes

# 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: 0.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: 0.1.0
version: 0.0.42


# 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: "1.16.0"
7 changes: 7 additions & 0 deletions charts/roman/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is the helm chart for deploying Roman(https://github.com/wireapp/roman)

Edit the values.yaml file and put required configuration.

Refer to the Roman repo README file for details on all the variables.

Also, Roman needs a PostgreSQL database, for the test purpose you can create a PostgreSQL deployment by using the bitnami/postgresql wrapper available at charts/postgresql
Empty file.
62 changes: 62 additions & 0 deletions charts/roman/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "roman.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 "roman.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 "roman.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "roman.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "roman.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
83 changes: 83 additions & 0 deletions charts/roman/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: roman
labels:
app: roman
spec:
replicas: {{ .Values.roman.replicaCount }}
selector:
matchLabels:
app: roman
template:
metadata:
labels:
app: roman
spec:
containers:
- name: roman
image: "{{ .Values.roman.image.repository }}:{{ .Values.roman.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent

ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8081
protocol: TCP
- containerPort: 8082
protocol: TCP

env:
- name: APP_KEY
valueFrom:
secretKeyRef:
name: "roman-secrets"
key: appKey

- name: ROMAN_PUB_KEY_BASE64
valueFrom:
secretKeyRef:
name: "roman-secrets"
key: pubKeyBase64

- name: PROXY_DOMAIN
value: "{{- if .Values.roman.proxyDomain }} {{ .Values.roman.proxyDomain }} {{- end }}"

- name: DB_URL
value: "{{ required "Must specify dbURL" .Values.roman.dbURL }}"

- name: WIRE_API_HOST
value: "{{ required "Must specify wireApiHost" .Values.roman.wireApiHost }}"

- name: DB_USER
value: "{{ required "Must specify dbUser" .Values.roman.dbUser }}"

- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: "roman-secrets"
key: dbPassword

startupProbe:
httpGet:
path: /api/status
port: 8080
failureThreshold: 6
periodSeconds: 5

livenessProbe:
httpGet:
path: /api/status
port: 8080

readinessProbe:
httpGet:
path: /api/status
port: 8080

resources:
requests:
memory: "1500Mi"
cpu: 50m
limits:
memory: "1500Mi"
23 changes: 23 additions & 0 deletions charts/roman/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: extensions/v1beta1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change the ingress apiVersion for maximum kubernetes version compatibility as done in #3002: add some function to _helpers.tpl and adjust the ingress.yaml in the same fashion as done in that PR for other charts, e.g. the nginx-ingress-services one.

kind: Ingress
metadata:
name: roman
labels:
app: roman
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/enable-cors: "true"
spec:
tls:
- hosts:
- "{{ required "Must specify host" .Values.roman.publicURL }}"
# secretName: "{{ include "roman.fullname" . }}"
rules:
- host: "{{ .Values.roman.publicURL }}"
http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: roman
servicePort: 80
34 changes: 34 additions & 0 deletions charts/roman/templates/secret-or-certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.tls.issuerRef -}}
{{- if or .Values.tls.key .Values.tls.crt }}
{{- fail "ingress.issuer and ingress.{crt,key} are mutually exclusive" -}}
{{- end -}}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: roman
labels:
app: roman
spec:
dnsNames:
- {{ .Values.roman.publicURL }}
secretName: "{{ include "roman.fullname" . }}"
issuerRef:
{{- toYaml .Values.tls.issuerRef | nindent 4 }}
privateKey:
rotationPolicy: Always
algorithm: ECDSA
size: 384
{{- else if and .Values.tls.key .Values.tls.crt -}}
apiVersion: v1
kind: Secret
metadata:
name: "{{ include "roman.fullname" . }}"
labels:
app: roman
type: kubernetes.io/tls
data:
tls.key: {{ required "tls.key is required" .Values.tls.key | b64enc }}
tls.crt: {{ required "tls.crt is required" .Values.tls.crt | b64enc }}
{{- else -}}
{{- fail "must specify tls.key and tls.crt , or tls.issuerRef" -}}
{{- end -}}
9 changes: 9 additions & 0 deletions charts/roman/templates/secret-token.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: "roman-secrets"
type: Opaque
data:
appKey: "{{ required "Must specify serviceToken" .Values.roman.appKey | b64enc }}"
dbPassword: "{{ required "Must specify dbPassword" .Values.roman.dbPassword | b64enc }}"
pubKeyBase64: "{{ required "Must specify dbPassword" .Values.roman.pubKeyBase64 | b64enc }}"
15 changes: 15 additions & 0 deletions charts/roman/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: roman
labels:
app: roman
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
selector:
app: roman
25 changes: 25 additions & 0 deletions charts/roman/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Default values for roman.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

roman:
replicaCount: 1
image:
repository: quay.io/wire/roman
# Overrides the image tag whose default is the chart appVersion.
tag: staging
serviceToken: # Provide the roman service token.
# randomly generated for local testing
appKey: b53181dd-6400-4960-8988-f775545588ff-0949f503-421e-4588-a2c5-f64fd9c180fd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would comment out most of these variables. It's useful for people installing the chart to have an idea of what an example value looks like; but it's not a good idea if people mistakenly use these default values as they forget to override them. It would be better to have the chart fail to install if a variable is missing.

wireApiHost: https://nginz-https.example.com
proxyDomain:
# random base 64 string used as certificate, replace with real one
pubKeyBase64: LS0tLS1CRUdJTiBQVcFQvWjcKMlczd1A1TzJveFVCTElDIEtFWS0tLS0tCg==
publicURL: roman.example.com # Link to the subdomain pointing to roman.
dbURL: jdbc:postgresql://postgresql:5432/externalPostgresql # Link to your Postgres server.
dbUser: # Provide your Postgres DB username.
dbPassword: # Provide your Postgres DB password.

tls:
issuerRef:
name: letsencrypt-http01