Skip to content

Commit ddfedef

Browse files
nithyanatarajanjskswamy
authored andcommitted
Add sample helm chart for dobby
1 parent df1e83e commit ddfedef

File tree

6 files changed

+233
-0
lines changed

6 files changed

+233
-0
lines changed

examples/helm/.helmignore

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

examples/helm/Chart.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v2
2+
name: dobby
3+
description: A Helm chart for dobby
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
#appVersion: 1.0.0
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "dobby.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 "dobby.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+
{{- .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+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "dobby.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
32+
{{- end }}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "dobby.labels" -}}
38+
helm.sh/chart: {{ include "dobby.chart" . }}
39+
{{ include "dobby.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
app.kubernetes.io/managed-by: {{ .Release.Service }}
44+
{{- end }}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "dobby.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "dobby.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
app: {{ .Release.Name }}
53+
{{- end }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "dobby.fullname" . }}
5+
labels:
6+
{{- include "dobby.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "dobby.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
{{- with .Values.podAnnotations }}
15+
annotations:
16+
{{- toYaml . | nindent 8 }}
17+
{{- end }}
18+
labels:
19+
{{- include "dobby.selectorLabels" . | nindent 8 }}
20+
spec:
21+
{{- with .Values.imagePullSecrets }}
22+
imagePullSecrets:
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
{{- with .Values.podSecurityContext }}
26+
securityContext:
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
containers:
30+
- name: {{ .Chart.Name }}
31+
{{- with .Values.securityContext }}
32+
securityContext:
33+
{{- toYaml . | nindent 12 }}
34+
{{- end }}
35+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
36+
imagePullPolicy: {{ .Values.image.pullPolicy }}
37+
ports:
38+
- name: http
39+
containerPort: {{ .Values.application.port }}
40+
protocol: TCP
41+
livenessProbe:
42+
httpGet:
43+
path: {{ .Values.application.livenessPath }}
44+
port: http
45+
readinessProbe:
46+
httpGet:
47+
path: {{ .Values.application.readinessPath }}
48+
port: http
49+
{{- with .Values.resources }}
50+
resources:
51+
{{- toYaml . | nindent 12 }}
52+
{{- end }}
53+
{{- with .Values.nodeSelector }}
54+
nodeSelector:
55+
{{- toYaml . | nindent 8 }}
56+
{{- end }}
57+
{{- with .Values.affinity }}
58+
affinity:
59+
{{- toYaml . | nindent 8 }}
60+
{{- end }}
61+
{{- with .Values.tolerations }}
62+
tolerations:
63+
{{- toYaml . | nindent 8 }}
64+
{{- end }}
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 "dobby.fullname" . }}
5+
labels:
6+
{{- include "dobby.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
selector:
15+
{{- include "dobby.selectorLabels" . | nindent 4 }}

examples/helm/values.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Default values for dobby.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
replicaCount: 1
6+
7+
application:
8+
port: 4444
9+
livenessPath: /health
10+
readinessPath: /readiness
11+
12+
image:
13+
repository: thecasualcoder/dobby
14+
pullPolicy: IfNotPresent
15+
# Overrides the image tag whose default is the chart appVersion.
16+
tag: "latest"
17+
18+
imagePullSecrets: []
19+
nameOverride: ""
20+
fullnameOverride: ""
21+
22+
podAnnotations: {}
23+
24+
podSecurityContext: {}
25+
# fsGroup: 2000
26+
27+
securityContext: {}
28+
# capabilities:
29+
# drop:
30+
# - ALL
31+
# readOnlyRootFilesystem: true
32+
# runAsNonRoot: true
33+
# runAsUser: 1000
34+
35+
service:
36+
type: ClusterIP
37+
port: 80
38+
39+
resources: {}
40+
# We usually recommend not to specify default resources and to leave this as a conscious
41+
# choice for the user. This also increases chances charts run on environments with little
42+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
43+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
44+
# limits:
45+
# cpu: 100m
46+
# memory: 128Mi
47+
# requests:
48+
# cpu: 100m
49+
# memory: 128Mi
50+
51+
nodeSelector: {}
52+
53+
tolerations: []
54+
55+
affinity: {}

0 commit comments

Comments
 (0)