Skip to content

Commit 991f8bf

Browse files
authored
Merge pull request #9 from ameier38/feature/metabase
feature/metabase: add metabase chart
2 parents aef55bb + cb52899 commit 991f8bf

File tree

14 files changed

+660
-0
lines changed

14 files changed

+660
-0
lines changed

.github/workflows/pull_request.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ jobs:
2525
with:
2626
entrypoint: helm
2727
args: lint charts/eventstore
28+
29+
- name: Lint Metabase
30+
uses: docker://alpine/helm:latest
31+
with:
32+
entrypoint: helm
33+
args: lint charts/metabase

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Andrew's Helm Charts
2+
3+
## Available Charts
4+
- [base-service](./charts/base-service): Chart to deploy simple services.
5+
- [eventstore](./charts/eventstore): Chart to deploy EventStore.
6+
- [metabase](./charts/metabase): Chart to deploy Metabase.

charts/metabase/.helmignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj

charts/metabase/Chart.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
description: The easy, open source way for everyone in your company to ask questions and learn from data.
3+
name: metabase
4+
version: 0.13.2
5+
appVersion: v0.36.3
6+
deprecated: false
7+
home: http://www.metabase.com/
8+
icon: http://www.metabase.com/images/logo.svg
9+
sources:
10+
- https://github.com/metabase/metabase

charts/metabase/README.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Metabase
2+
3+
[Metabase](http://metabase.com) is the easy, open source way for everyone in your company to ask questions and learn from data.
4+
5+
## TL;DR;
6+
7+
```bash
8+
helm repo add ameier38 https://ameier38.github.io/charts
9+
helm repo update
10+
helm install -n metabase ameier38/metabase
11+
```
12+
13+
## Introduction
14+
15+
This chart bootstraps a [Metabase](https://github.com/metabase/metabase) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
16+
17+
## Prerequisites
18+
19+
- Kubernetes 1.4+ with Beta APIs enabled
20+
21+
## Installing the Chart
22+
23+
To install the chart with the release name `my-release`:
24+
25+
```bash
26+
helm install -n my-release ameier38/metabase
27+
```
28+
29+
The command deploys Metabase on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
30+
31+
> **Tip**: List all releases using `helm list`
32+
33+
## Uninstalling the Chart
34+
35+
To uninstall/delete the `my-release` deployment:
36+
37+
```bash
38+
helm delete my-release
39+
```
40+
41+
The command removes all the Kubernetes components associated with the chart and deletes the release.
42+
43+
## Configuration
44+
45+
The following table lists the configurable parameters of the Metabase chart and their default values.
46+
47+
| Parameter | Description | Default |
48+
| ------------------------------- | ----------------------------------------------------------- | ----------------- |
49+
| replicaCount | desired number of controller pods | 1 |
50+
| podAnnotations | controller pods annotations | {} |
51+
| podLabels | extra pods labels | {} |
52+
| image.repository | controller container image repository | metabase/metabase |
53+
| image.tag | controller container image tag | v0.36.3 |
54+
| image.pullPolicy | controller container image pull policy | IfNotPresent |
55+
| fullnameOverride | String to fully override metabase.fullname template | null |
56+
| listen.host | Listening on a specific network host | 0.0.0.0 |
57+
| listen.port | Listening on a specific network port | 3000 |
58+
| ssl.enabled | Enable SSL to run over HTTPS | false |
59+
| ssl.port | SSL port | null |
60+
| ssl.keyStore | The key store in JKS format | null |
61+
| ssl.keyStorePassword | The password for key Store | null |
62+
| database.type | Backend database type | h2 |
63+
| database.encryptionKey | Secret key for encrypt sensitive information into database | null |
64+
| database.connectionURI | Database connection URI (alternative to the below settings) | null |
65+
| database.host | Database host | null |
66+
| database.port | Database port | null |
67+
| database.dbname | Database name | null |
68+
| database.username | Database username | null |
69+
| database.password | Database password | null |
70+
| database.existingSecret | Exising secret for database credentials | null |
71+
| database.existingSecretUsernameKey | Username key for exising secret | null |
72+
| database.existingSecretPasswordKey | Password key for exising secret | null |
73+
| database.existingSecretConnectionURIKey | ConnectionURI key for exising secret | null |
74+
| password.complexity | Complexity requirement for Metabase account's password | normal |
75+
| password.length | Minimum length required for Metabase account's password | 6 |
76+
| timeZone | Service time zone | UTC |
77+
| emojiLogging | Get a funny emoji in service log | true |
78+
| javaOpts | JVM options | null |
79+
| pluginsDirectory | A directory with Metabase plugins | null |
80+
| livenessProbe.initialDelaySeconds | Delay before liveness probe is initiated | 120 |
81+
| livenessProbe.timeoutSeconds | When the probe times out | 30 |
82+
| livenessProbe.failureThreshold | Minimum consecutive failures for the probe | 6 |
83+
| readinessProbe.initialDelaySeconds | Delay before readiness probe is initiated | 30 |
84+
| readinessProbe.timeoutSeconds | When the probe times out | 3 |
85+
| readinessProbe.periodSeconds | How often to perform the probe | 5 |
86+
| service.type | ClusterIP, NodePort, or LoadBalancer | ClusterIP |
87+
| service.loadBalancerSourceRanges | Array of Source Ranges | null |
88+
| service.externalPort | Service external port | 80 |
89+
| service.internalPort | Service internal port, should be the same as `listen.port` | 3000 |
90+
| service.nodePort | Service node port | null |
91+
| service.annotations | Service annotations | {} |
92+
| ingress.enabled | Enable ingress controller resource | false |
93+
| ingress.hosts | Ingress resource hostnames | null |
94+
| ingress.path | Ingress path | / |
95+
| ingress.labels | Ingress labels configuration | null |
96+
| ingress.annotations | Ingress annotations configuration | {} |
97+
| ingress.tls | Ingress TLS configuration | null |
98+
| log4jProperties | Custom `log4j.properties` file | null |
99+
| resources | Server resource requests and limits | {} |
100+
| nodeSelector | Node labels for pod assignment | {} |
101+
| tolerations | Toleration labels for pod assignment | [] |
102+
| affinity | Affinity settings for pod assignment | {} |
103+
| jetty.maxThreads | Jetty max number of threads | null |
104+
| jetty.minThreads | Jetty min number of threads | null |
105+
| jetty.maxQueued | Jetty max queue size | null |
106+
| jetty.maxIdleTime | Jetty max idle time | null |
107+
| siteUrl | Base URL, useful for serving behind a reverse proxy | null |
108+
| session.maxSessionAge | Session expiration defined in minutes | 20160 |
109+
| session.sessionCookies | When browser is closed, user login session will expire | null |
110+
111+
The above parameters map to the env variables defined in [metabase](http://github.com/metabase/metabase). For more information please refer to the [metabase documentations](http://www.metabase.com/docs/v0.36.3/).
112+
113+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
114+
115+
```bash
116+
helm install --name my-release \
117+
--set timeZone=US/Pacific,password.complexity=strong,password.length=10 \
118+
ameier38/metabase
119+
```
120+
121+
The above command sets the time zone to `US/Pacific`, `strong` user password complexity and minimum length at `10`
122+
123+
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
124+
125+
```bash
126+
helm install --name my-release -f values.yaml ameier38/metabase
127+
```
128+
129+
> **Tip**: You can use the default [values.yaml](values.yaml)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.hostname }}
3+
http://{{- .Values.ingress.hostname }}
4+
{{- else if contains "NodePort" .Values.service.type }}
5+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "metabase.fullname" . }})
6+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
7+
echo http://$NODE_IP:$NODE_PORT
8+
{{- else if contains "LoadBalancer" .Values.service.type }}
9+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
10+
You can watch the status of by running 'kubectl get svc -w {{ template "metabase.fullname" . }}'
11+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "metabase.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
12+
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
13+
{{- else if contains "ClusterIP" .Values.service.type }}
14+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "metabase.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
15+
echo "Visit http://127.0.0.1:8080 to use your application"
16+
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 8080:{{ .Values.service.internalPort }}
17+
{{- end }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "metabase.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "metabase.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- printf .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Return the apiVersion of deployment.
29+
*/}}
30+
{{- define "deployment.apiVersion" -}}
31+
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
32+
{{- print "extensions/v1beta1" -}}
33+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
34+
{{- print "apps/v1" -}}
35+
{{- end -}}
36+
{{- end -}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ template "metabase.fullname" . }}-config
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
app: {{ template "metabase.name" . }}
8+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9+
release: {{ .Release.Name }}
10+
heritage: {{ .Release.Service }}
11+
data:
12+
{{- if .Values.log4jProperties }}
13+
log4j.properties:
14+
{{ toYaml .Values.log4jProperties | indent 4}}
15+
{{- end}}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{- if and (ne (.Values.database.type | lower) "h2") (not .Values.database.existingSecret) }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ template "metabase.fullname" . }}-database
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
app: {{ template "metabase.name" . }}
9+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10+
release: {{ .Release.Name }}
11+
heritage: {{ .Release.Service }}
12+
type: Opaque
13+
data:
14+
{{- if .Values.database.encryptionKey }}
15+
encryptionKey: {{ .Values.database.encryptionKey | b64enc | quote }}
16+
{{- end }}
17+
{{- if .Values.database.connectionURI }}
18+
connectionURI: {{ .Values.database.connectionURI | b64enc | quote }}
19+
{{- else }}
20+
username: {{ .Values.database.username | b64enc | quote }}
21+
password: {{ .Values.database.password | b64enc | quote }}
22+
{{- end }}
23+
{{- end }}

0 commit comments

Comments
 (0)