Skip to content

Commit

Permalink
feat(chart): package hermitcrab with chart (optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMrqes committed Mar 22, 2024
1 parent 4372310 commit 11c47a7
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 0 deletions.
83 changes: 83 additions & 0 deletions deploy/charts/burrito/templates/hermitcrab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{{- if .Values.hermitcrab.enabled }}
{{- with mergeOverwrite (deepCopy .Values.global) .Values.hermitcrab }}
{{- if .persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: burrito-hermitcrab
annotations:
{{- toYaml .metadata.annotations | nindent 4 }}
labels:
{{- toYaml .metadata.labels | nindent 4 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .persistence.size }}
{{- if .persistence.storageClassName }}
storageClassName: {{ .persistence.storageClassName }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: burrito-hermitcrab
spec:
selector:
{{- toYaml .metadata.labels | nindent 4 }}
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: burrito-hermitcrab
labels:
{{- toYaml .metadata.labels | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- toYaml .metadata.labels | nindent 6 }}
template:
metadata:
labels:
{{- toYaml .metadata.labels | nindent 6 }}
spec:
automountServiceAccountToken: false
containers:
- name: hermitcrab
image: "{{ .deployment.image.repository }}:{{ .deployment.image.tag }}"
imagePullPolicy: {{ .deployment.image.pullPolicy }}
resources:
{{- toYaml .deployment.resources | nindent 12 }}
env:
{{- toYaml .deployment.env | nindent 12 }}
envFrom:
{{- toYaml .deployment.envFrom | nindent 12 }}
ports:
{{- toYaml .deployment.ports | nindent 12 }}
livenessProbe:
{{- toYaml .deployment.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .deployment.readinessProbe | nindent 12 }}
{{- if .persistence.enabled }}
volumeMounts:
- name: data
mountPath: /var/run/hermitcrab
{{- end }}
{{- if .persistence.enabled }}
volumes:
- name: data
persistentVolumeClaim:
claimName: burrito-hermitcrab
{{- end }}
{{- end }}
{{- end }}
50 changes: 50 additions & 0 deletions deploy/charts/burrito/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,56 @@ redis:
port: 6379
targetPort: 6379

hermitcrab:
enabled: false
metadata:
labels:
app.kubernetes.io/component: hermitcrab
app.kubernetes.io/name: burrito-hermitcrab
persistence:
enabled: true
size: 1Gi
deployment:
image:
pullPolicy: Always
repository: sealio/hermitcrab
tag: main
resources:
limits:
cpu: '2'
memory: '4Gi'
requests:
cpu: '500m'
memory: '512Mi'
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
startupProbe:
failureThreshold: 10
periodSeconds: 5
httpGet:
port: 80
path: /readyz
readinessProbe:
failureThreshold: 3
timeoutSeconds: 5
periodSeconds: 5
httpGet:
port: 80
path: /readyz
livenessProbe:
failureThreshold: 10
timeoutSeconds: 5
periodSeconds: 10
httpGet:
httpHeaders:
- name: "User-Agent"
value: ""
port: 80
path: /livez

global:
metadata:
labels:
Expand Down

0 comments on commit 11c47a7

Please sign in to comment.