From d2fb7094487eeea1d5ce11210b961d1ae8a464ee Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Mon, 8 Jan 2018 17:25:16 -0500 Subject: [PATCH 1/2] Feature gate emptyDir.sizeLimit Add a configurable gate around the `emptyDir.sizeLimit` property, as it is alpha from Kubernets `v1.7.x`, but seems more accessible from `v1.8.x` onward. Also see https://github.com/kubernetes/kubernetes/issues/43607 --- charts/redis/templates/deployment.yaml | 4 ++++ doc/advanced/feature-gates/README.md | 10 ++++++++++ values.yaml | 9 +++++++++ 3 files changed, 23 insertions(+) create mode 100644 doc/advanced/feature-gates/README.md diff --git a/charts/redis/templates/deployment.yaml b/charts/redis/templates/deployment.yaml index 778a97c760..174acbe072 100644 --- a/charts/redis/templates/deployment.yaml +++ b/charts/redis/templates/deployment.yaml @@ -48,7 +48,9 @@ spec: - name: {{ .Release.Name }}-config emptyDir: medium: "Memory" + {{- if .Values.global.emptyDirLimits -}} sizeLimit: 10M + {{- end -}} - name: {{ .Release.Name }} projected: defaultMode: 0644 @@ -72,7 +74,9 @@ spec: claimName: {{ .disk.persistentVolumeClaim }} {{- else }} emptyDir: + {{- if .Values.global.emptyDirLimits -}} sizeLimit: 10G + {{- end -}} {{- end }} {{- end }} {{- end -}} diff --git a/doc/advanced/feature-gates/README.md b/doc/advanced/feature-gates/README.md new file mode 100644 index 0000000000..88a8cddad7 --- /dev/null +++ b/doc/advanced/feature-gates/README.md @@ -0,0 +1,10 @@ +# Feature Gates + +[emptyDirLimits](#emptydirlimits) + +## emptyDirLimits + +We have attempted to be concious of resources wherever possible. To this end, some charts make use of [`emptyDir` volume mounts][emptyDir], which can be backed by the node disk, or via `tmpfs`. In an effort to curtail excessive consumption of either of these resources, we've also implemented the `sizeLimit` feature of the `emptyDir`. The downside to this usage is that `sizeLimit` is not available without a feature flag before Kubernetes `1.8.x`. Starting in Kubernetes `1.7.x`, this is an Alpha feature, and can be enabled individually with the `LocalStorageCapacityIsolation` feature gate. + +[emptyDir]: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir +[emptyDirVolumeSource]: https://v1-8.docs.kubernetes.io/docs/api-reference/v1.8/#emptydirvolumesource-v1-core diff --git a/values.yaml b/values.yaml index 244f818900..c5f46d0ebd 100644 --- a/values.yaml +++ b/values.yaml @@ -25,3 +25,12 @@ gitlab: enabled: false gitlab-shell: enabled: false + +## Global configuration items +global: + ## Configuration + # domain: Top-Level Domain for deployment + ## Feature gating + # emptyDir.sizeLimit is alpha in Kubernetes v1.7.x, standard in v1.8.x + # When available, it is used to limit the size of ephemeral data + emptyDirLimits: true -- GitLab From 05ac90aa48b871e0dda4ae0969db342c06bbbd96 Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Tue, 9 Jan 2018 08:40:12 -0500 Subject: [PATCH 2/2] Doc: add missied documentation about feature gating [ci skip] --- doc/advanced/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/advanced/README.md b/doc/advanced/README.md index aa5a4115ce..98f0f1c775 100644 --- a/doc/advanced/README.md +++ b/doc/advanced/README.md @@ -1,3 +1,5 @@ # Advanced Configuration +Controlling [feature gates](feature-gates/README.md) + Using an [external database](external-db/README.md) -- GitLab