umbrella-chart
by stakater
A Helm chart for Kubernetes
About this chart
Customer-app
Overview
Customer-app is an umbrella-chart that installs the following components with mutual TLS support
Spring based Java Application
Postgreql
Mongodb
Minio
SFTP site
All required certificates are generated using a Cluster Issuer named ca-issuer. It is assumed that the cluster issuer is already present on the cluster the umbrella chart is being deployed to.
The chart uses Secrets to deploy sensitive data such as Database users and passwords. In order to use Sealed Secrets, uncomment line 251-268 in the values file and add the sealed secret values. Lines 270-281 will have to be removed. Similar changes will have to me made in atmoz-sftp.yaml and minio secrets present in the templates folder.
Installation
Create a parent helm Chart and Add the Umbrella Chart as a dependency
Provide the following values in the values file of parent chart.
application:
applicationName: ""
deployment:
replicas: ""
image: ""
repository: ""
tag: ""
postgresql:
enabled: true
fullnameOverride: changeme
tls:
certificatesSecret: changeme
Run:
helm install appname . -n namepspacename
By default, everything apart from the application is disabled. To enable/disable postgres set:
umbrella-chart:
postgresql:
enabled: true
postgresCert:
enabled: true
To enable minio set:
umbrella-chart:
minio:
enabled: true
To enable sftp set:
umbrella-chart:
sftp:
enabled: true
To enable mongo set:
umbrella-chart:
mongodb:
enabled: true
mongodbCert:
enabled: true
Other values that need to be provided
Application:
applicationName:
postgresDatabaseUser: (default set to enento_user)
postgresDatabase: (default set to enento_db)
The DATASOURCE_URL env variable is constructed using application name, application namespace, and database name. This value can, however, be completely overwritten. postgresDatabaseUser also sets the DATASOURCE_USERNAMEenv variable in application
Postgresql
fullnameOverride:
tls:
certificatesSecret: postgres-server-auth-tls
Note: fullnameOverride should be applicationName-postgresql Remember to change the certificatesSecretName for every application that is deployed using the umbrella chart. The need to do this will be removed in future releases.
By default, the chart creates a database enento_db with user enento_user. To change this provide the initdbScripts:
initdbScripts:
init.sql: |
CREATE USER dbUser;
CREATE DATABASE dbName;
GRANT ALL PRIVILEGES ON DATABASE dbName TO dbUser;
Mongodb
fullnameOverride:
extraVolumes:
- name: certs
emptyDir: {}
- name: cert-manager
secret:
secretName: applicationName-mongodb-tls (Replace applicationName)
items:
- key: ca.crt
path: ca.crt
mode: 0640
- key: tls.crt
path: tls.crt
mode: 0640
- key: tls.key
path: tls.key
mode: 0640
initdbScripts:
create_users.js: |
db.getSiblingDB("$external").runCommand(
{
createUser: "userName",
roles: [{ role: "readWrite", db: 'dbName' }]
}
)
fullnameOverride should be applicationName-mongodb Also set the required env variables in application environment. The need to provide extraVolumes will be removed in future releases.
Minio
For minio set the following values in application env
env:
accesskey:
valueFrom:
secretKeyRef:
name: applicationName-object-storage-secret (Replace applicationName)
key: accesskey
secretkey:
valueFrom:
secretKeyRef:
name: applicationName-object-storage-secret (Replace applicationName)
key: secretkey
Deploy umbrella-chart with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has umbrella-chart on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartumbrella-chart is pinned at v0.0.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply