From 3fb125f28df009b3d26d9203bad730cde0a8ab34 Mon Sep 17 00:00:00 2001 From: Christian Ingenhaag Date: Sun, 27 Jan 2019 01:07:52 +0100 Subject: [PATCH] insert suggestions from reviews in #5180 Signed-off-by: Christian Ingenhaag --- stable/nextcloud/templates/_helpers.tpl | 11 ++++++++- stable/nextcloud/templates/deployment.yaml | 16 +++++++++++-- stable/nextcloud/values.yaml | 27 ++++++++++++++++------ 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/stable/nextcloud/templates/_helpers.tpl b/stable/nextcloud/templates/_helpers.tpl index a0b5d352d80d..0c406c3aa1f2 100644 --- a/stable/nextcloud/templates/_helpers.tpl +++ b/stable/nextcloud/templates/_helpers.tpl @@ -9,11 +9,20 @@ Expand the name of the chart. {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. */}} {{- define "nextcloud.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} +{{- end -}} {{/* Create a default fully qualified app name. @@ -49,4 +58,4 @@ Create chart name and version as used by the chart label. */}} {{- define "nextcloud.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/stable/nextcloud/templates/deployment.yaml b/stable/nextcloud/templates/deployment.yaml index 2afa185ad247..e06a1041a18c 100644 --- a/stable/nextcloud/templates/deployment.yaml +++ b/stable/nextcloud/templates/deployment.yaml @@ -29,9 +29,9 @@ spec: {{- end}} {{- end }} containers: - - name: {{ template "nextcloud.fullname" . }} + - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{- if .Values.internalDatabase.enabled }} - name: SQLITE_DATABASE @@ -121,6 +121,18 @@ spec: - name: nextcloud-data mountPath: /var/www/html/themes subPath: themes + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: nextcloud-data {{- if .Values.persistence.enabled }} diff --git a/stable/nextcloud/values.yaml b/stable/nextcloud/values.yaml index bdaf34253646..8dd04872445c 100644 --- a/stable/nextcloud/values.yaml +++ b/stable/nextcloud/values.yaml @@ -8,6 +8,9 @@ image: # pullSecrets: # - myRegistrKeySecretName +nameOverride: "" +fullnameOverride: "" + # Number of replicas to be deployed replicaCount: 1 @@ -120,7 +123,7 @@ service: ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ## persistence: - enabled: true + enabled: false ## nextcloud data Persistent Volume Storage Class ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning @@ -138,10 +141,20 @@ persistence: accessMode: ReadWriteOnce size: 8Gi -## Configure resource requests and limits -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## resources: {} -# requests: -# memory: 512Mi -# cpu: 300m + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {}