diff --git a/deploy/charts/burrito/templates/hermitcrab.yaml b/deploy/charts/burrito/templates/hermitcrab.yaml index 5c69a2af..28d79402 100644 --- a/deploy/charts/burrito/templates/hermitcrab.yaml +++ b/deploy/charts/burrito/templates/hermitcrab.yaml @@ -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: @@ -42,7 +22,7 @@ metadata: labels: {{- toYaml .metadata.labels | nindent 4 }} spec: - replicas: 1 + replicas: {{ .deployment.replicas }} selector: matchLabels: {{- toYaml .metadata.labels | nindent 6 }} @@ -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 }} @@ -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 @@ -94,6 +89,7 @@ spec: {{- if .deployment.extraVolumes }} {{- toYaml .deployment.extraVolumes | nindent 8 }} {{- end }} + {{- end }} --- {{- if .tls.certManager.use }} apiVersion: cert-manager.io/v1 diff --git a/deploy/charts/burrito/values.yaml b/deploy/charts/burrito/values.yaml index 27ba163d..40d53b5c 100644 --- a/deploy/charts/burrito/values.yaml +++ b/deploy/charts/burrito/values.yaml @@ -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 @@ -88,6 +94,7 @@ hermitcrab: kind: Issuer deployment: + replicas: 1 image: pullPolicy: Always repository: sealio/hermitcrab @@ -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