Skip to content

Commit 136dc4a

Browse files
breardon2011greptile-apps[bot]motatoes
authored
Add Helm chart for taco-statesman (#2144)
* Add Helm chart for taco-statesman - Add minimalist Helm chart for taco-statesman service - Support for memory and S3 storage configurations - Use Kubernetes secrets for S3 credentials - Include health checks and basic service configuration * adjust test * adjust configuration * Update helm-charts/taco-statesman/templates/_helpers.tpl Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update helm-charts/taco-statesman/templates/_helpers.tpl Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * adjust line after greptile mangled it * Update helm-charts/taco-statesman/values.yaml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update helm-charts/taco-statesman/templates/deployment.yaml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update helm-charts/taco-statesman/templates/deployment.yaml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Mohamed Habib <[email protected]>
1 parent d0b1c0b commit 136dc4a

File tree

7 files changed

+226
-0
lines changed

7 files changed

+226
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
name: taco-statesman
3+
description: A minimalist Helm chart for Taco Statesman service
4+
type: application
5+
version: 0.1.0
6+
appVersion: "v0.1.0"
7+
icon: https://raw.githubusercontent.com/diggerhq/digger/main/docs/logo/digger-logo.png
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Taco Statesman Helm Chart
2+
3+
A minimalist Helm chart for deploying the Taco Statesman service.
4+
5+
## Quick Start
6+
7+
```bash
8+
# Install with default settings (memory storage)
9+
helm install taco-statesman ./helm-charts/taco-statesman
10+
11+
# Install with S3 storage
12+
helm install taco-statesman ./helm-charts/taco-statesman \
13+
--set taco.storage.type=s3 \
14+
--set taco.storage.s3.bucket=my-bucket \
15+
--set taco.storage.s3.region=us-east-1
16+
17+
# Disable authentication (development)
18+
helm install taco-statesman ./helm-charts/taco-statesman \
19+
--set taco.auth.disable=true
20+
```
21+
22+
## Configuration
23+
24+
| Parameter | Description | Default |
25+
|-----------|-------------|---------|
26+
| `taco.image.repository` | Image repository | `ghcr.io/diggerhq/digger/taco-statesman` |
27+
| `taco.image.tag` | Image tag | `v0.1.0` |
28+
| `taco.replicaCount` | Number of replicas | `1` |
29+
| `taco.service.port` | Service port | `8080` |
30+
| `taco.storage.type` | Storage type (`memory` or `s3`) | `memory` |
31+
| `taco.auth.disable` | Disable authentication | `false` |
32+
33+
## Storage
34+
35+
- **Memory**: Default, no configuration needed
36+
- **S3**: Set `taco.storage.type=s3` and provide S3 credentials
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "taco-statesman.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 "taco-statesman.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 "taco-statesman.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "taco-statesman.labels" -}}
37+
helm.sh/chart: {{ include "taco-statesman.chart" . }}
38+
{{ include "taco-statesman.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 "taco-statesman.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "taco-statesman.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 "taco-statesman.serviceAccountName" -}}
57+
{{- default "default" .Values.taco.serviceAccount.name }}
58+
{{- end }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "taco-statesman.fullname" . }}
5+
labels:
6+
{{- include "taco-statesman.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.taco.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "taco-statesman.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "taco-statesman.selectorLabels" . | nindent 8 }}
16+
spec:
17+
containers:
18+
image: "{{ .Values.taco.image.repository }}:{{ .Values.taco.image.tag | default .Chart.AppVersion }}"
19+
imagePullPolicy: {{ .Values.taco.image.pullPolicy | default "IfNotPresent" }}
20+
imagePullPolicy: {{ .Values.taco.image.pullPolicy | default "IfNotPresent" }}
21+
ports:
22+
- name: http
23+
containerPort: {{ .Values.taco.service.port }}
24+
protocol: TCP
25+
env:
26+
- name: OPENTACO_PORT
27+
value: "{{ .Values.taco.service.port }}"
28+
- name: OPENTACO_STORAGE
29+
value: "{{ .Values.taco.storage.type }}"
30+
{{- if .Values.taco.auth.disable }}
31+
- name: OPENTACO_AUTH_DISABLE
32+
value: "true"
33+
{{- end }}
34+
{{- if and (eq .Values.taco.storage.type "s3") .Values.taco.storage.s3.bucket }}
35+
- name: OPENTACO_S3_BUCKET
36+
value: "{{ .Values.taco.storage.s3.bucket }}"
37+
{{- end }}
38+
{{- if and (eq .Values.taco.storage.type "s3") .Values.taco.storage.s3.region }}
39+
- name: OPENTACO_S3_REGION
40+
value: "{{ .Values.taco.storage.s3.region }}"
41+
{{- end }}
42+
{{- if and (eq .Values.taco.storage.type "s3") .Values.taco.storage.s3.secretName }}
43+
- name: OPENTACO_S3_ACCESS_KEY_ID
44+
valueFrom:
45+
secretKeyRef:
46+
name: {{ .Values.taco.storage.s3.secretName }}
47+
key: access-key-id
48+
- name: OPENTACO_S3_SECRET_ACCESS_KEY
49+
valueFrom:
50+
secretKeyRef:
51+
name: {{ .Values.taco.storage.s3.secretName }}
52+
key: secret-access-key
53+
{{- end }}
54+
livenessProbe:
55+
httpGet:
56+
path: /healthz
57+
port: http
58+
initialDelaySeconds: 30
59+
periodSeconds: 10
60+
readinessProbe:
61+
httpGet:
62+
path: /healthz
63+
port: http
64+
initialDelaySeconds: 5
65+
periodSeconds: 5
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "taco-statesman.fullname" . }}
5+
labels:
6+
{{- include "taco-statesman.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.taco.service.type }}
9+
ports:
10+
- port: {{ .Values.taco.service.port }}
11+
targetPort: {{ .Values.taco.service.port }}
12+
protocol: TCP
13+
name: http
14+
selector:
15+
{{- include "taco-statesman.selectorLabels" . | nindent 4 }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: "{{ include "taco-statesman.fullname" . }}-test-connection"
5+
labels:
6+
{{- include "taco-statesman.labels" . | nindent 4 }}
7+
annotations:
8+
"helm.sh/hook": test
9+
spec:
10+
restartPolicy: Never
11+
containers:
12+
- name: wget
13+
image: busybox
14+
command: ['wget']
15+
args: ['--spider', '--quiet', 'http://{{ include "taco-statesman.fullname" . }}:{{ .Values.taco.service.port }}/healthz']
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# values.yaml
2+
3+
taco:
4+
# Image configuration
5+
image:
6+
repository: ghcr.io/diggerhq/digger/taco-statesman
7+
tag: "v0.1.0"
8+
pullPolicy: "IfNotPresent"
9+
10+
# Number of replicas
11+
replicaCount: 1
12+
13+
# Service configuration
14+
service:
15+
type: ClusterIP
16+
port: 8080
17+
18+
# Storage type: "memory" or "s3"
19+
storage:
20+
type: "memory"
21+
# S3 configuration (if using S3 storage)
22+
s3:
23+
bucket: ""
24+
region: "us-east-1"
25+
# Use Kubernetes secrets for credentials
26+
secretName: "taco-s3-credentials"
27+
28+
# Authentication
29+
auth:
30+
disable: false

0 commit comments

Comments
 (0)