Skip to content

Commit bf70660

Browse files
add helm-chart
Signed-off-by: Jonathan Irvin <djfoxyslpr@gmail.com>
1 parent 904b428 commit bf70660

File tree

6 files changed

+111
-0
lines changed

6 files changed

+111
-0
lines changed

helm-charts/bingo/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: bingo
3+
description: A Helm chart for a customizable application with a ConfigMap for phrases and configurable ports.
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.0.0"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{/*
2+
Return the chart name.
3+
*/}}
4+
{{- define "bingo.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
*/}}
11+
{{- define "bingo.fullname" -}}
12+
{{- if .Values.fullnameOverride -}}
13+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
14+
{{- else -}}
15+
{{- $name := default .Chart.Name .Values.nameOverride -}}
16+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
17+
{{- end -}}
18+
{{- end }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "bingo.fullname" . }}-config
5+
data:
6+
# The phrases are converted to YAML, making them easily consumable by your application.
7+
phrases: |-
8+
{{ toYaml .Values.phrases | nindent 4 }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "bingo.fullname" . }}
5+
labels:
6+
app: {{ include "bingo.name" . }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
app: {{ include "bingo.name" . }}
12+
template:
13+
metadata:
14+
labels:
15+
app: {{ include "bingo.name" . }}
16+
spec:
17+
containers:
18+
- name: {{ include "bingo.name" . }}
19+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
20+
imagePullPolicy: {{ .Values.image.pullPolicy }}
21+
ports:
22+
- containerPort: {{ .Values.containerPort }}
23+
env:
24+
- name: PORT
25+
value: {{ .Values.env.PORT | quote }}
26+
- name: METRICS_PORT
27+
value: {{ .Values.env.METRICS_PORT | quote }}
28+
volumeMounts:
29+
- name: config
30+
mountPath: /etc/config
31+
volumes:
32+
- name: config
33+
configMap:
34+
name: {{ include "bingo.fullname" . }}-config
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "bingo.fullname" . }}
5+
spec:
6+
type: {{ .Values.service.type }}
7+
ports:
8+
- port: {{ .Values.service.port }}
9+
targetPort: {{ .Values.containerPort }}
10+
protocol: TCP
11+
name: http
12+
selector:
13+
app: {{ include "bingo.name" . }}

helm-charts/bingo/values.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Default values for bingo.
2+
3+
replicaCount: 1
4+
5+
image:
6+
repository: ghcr.io/offendingcommit/bingo
7+
tag: latest
8+
pullPolicy: IfNotPresent
9+
10+
service:
11+
# Kubernetes service type (ClusterIP, NodePort, LoadBalancer)
12+
type: ClusterIP
13+
# Service port (the externally visible port)
14+
port: 80
15+
16+
# Container port (the port on which your app listens)
17+
containerPort: 8080
18+
19+
# Environment variables for the container
20+
env:
21+
PORT: "8080"
22+
METRICS_PORT: "9090"
23+
24+
# ConfigMap data for phrases.
25+
# Edit or extend below key/value pairs as needed.
26+
phrases:
27+
greeting: "Hello, world!"
28+
farewell: "Goodbye, world!"
29+
30+
# Overrides for the fully qualified resource names.
31+
nameOverride: ""
32+
fullnameOverride: ""

0 commit comments

Comments
 (0)