Skip to content

Commit

Permalink
feat(hermitcrab): use ephemeral storage or emptydir + sharding
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMrqes committed Jun 4, 2024
1 parent fb0d4a3 commit 1c3e547
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 34 deletions.
50 changes: 23 additions & 27 deletions deploy/charts/burrito/templates/hermitcrab.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
{{- if .Values.config.burrito.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:
Expand All @@ -42,7 +22,7 @@ metadata:
labels:
{{- toYaml .metadata.labels | nindent 4 }}
spec:
replicas: 1
replicas: {{ .deployment.replicas }}
selector:
matchLabels:
{{- toYaml .metadata.labels | nindent 6 }}
Expand All @@ -68,9 +48,10 @@ spec:
{{- toYaml .deployment.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .deployment.readinessProbe | nindent 12 }}
{{- if or .storage.emptyDir.enabled .storage.ephemeral.enabled .tls.certManager.use .deployment.extraVolumeMounts }}
volumeMounts:
{{- if .persistence.enabled }}
- name: data
{{- if or .storage.emptyDir.enabled .storage.ephemeral.enabled }}
- name: provider-cache
mountPath: /var/run/hermitcrab
{{- end }}
{{- if .tls.certManager.use }}
Expand All @@ -80,11 +61,25 @@ spec:
{{- if .deployment.extraVolumeMounts }}
{{- toYaml .deployment.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- end }}
{{- if or .storage.emptyDir.enabled .storage.ephemeral.enabled .tls.certManager.use .deployment.extraVolumes }}
volumes:
{{- if .persistence.enabled }}
- name: data
persistentVolumeClaim:
claimName: burrito-hermitcrab
{{- if or .storage.emptyDir.enabled .storage.ephemeral.enabled }}
- name: provider-cache
{{- if .storage.emptyDir.enabled }}
emptyDir:
medium: {{ .storage.emptyDir.medium }}
sizeLimit: {{ .storage.emptyDir.sizeLimit }}
{{- else if .storage.ephemeral.enabled }}
ephemeral:
volumeClaimTemplate:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .storage.ephemeral.storageClassName }}
resources:
requests:
storage: {{ .storage.ephemeral.size }}
{{- end }}
{{- end }}
{{- if .tls.certManager.use }}
- name: burrito-hermitcrab-tls
Expand All @@ -94,6 +89,7 @@ spec:
{{- if .deployment.extraVolumes }}
{{- toYaml .deployment.extraVolumes | nindent 8 }}
{{- end }}
{{- end }}
---
{{- if .tls.certManager.use }}
apiVersion: cert-manager.io/v1
Expand Down
21 changes: 14 additions & 7 deletions deploy/charts/burrito/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ hermitcrab:
labels:
app.kubernetes.io/component: hermitcrab
app.kubernetes.io/name: burrito-hermitcrab
persistence:
enabled: true
size: 1Gi
storage:
emptyDir:
enabled: true
medium: ""
sizeLimit: "2Gi"
ephemeral:
enabled: false
size: "2Gi"
storageClassName: ""
tls:
certManager:
use: true
Expand All @@ -88,6 +94,7 @@ hermitcrab:
kind: Issuer

deployment:
replicas: 1
image:
pullPolicy: Always
repository: sealio/hermitcrab
Expand All @@ -99,11 +106,11 @@ hermitcrab:
value: /etc/hermitcrab/tls/tls.key
resources:
limits:
cpu: '2'
memory: '4Gi'
cpu: '1'
memory: '2Gi'
requests:
cpu: '500m'
memory: '512Mi'
cpu: '300m'
memory: '256Mi'
ports:
- name: http
containerPort: 80
Expand Down

0 comments on commit 1c3e547

Please sign in to comment.