Skip to content

Commit cb182b3

Browse files
committed
helm: source CVMFS client config via extraVolumes/volumeMounts
Defines extraConfigMaps, nodeplugin.extraVolumes and nodeplugin.plugin.extraVolumeMounts values. Using cvmfsConfig field will now fail.
1 parent 99f4ab0 commit cb182b3

File tree

5 files changed

+59
-119
lines changed

5 files changed

+59
-119
lines changed

deployments/helm/cvmfs-csi/templates/_helpers.tpl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,3 @@ component: controllerplugin
139139
{{ include "cvmfs-csi.controllerplugin.matchLabels" . }}
140140
{{- end -}}
141141
{{- end -}}
142-
143-
{{- define "cvmfs-csi.cm.default.local" -}}
144-
{{ (index .Values.cvmfsConfig "default.local" "configMapName") | default (printf "%s-default-local" (include "cvmfs-csi.fullname" .)) }}
145-
{{- end -}}
146-
147-
{{- define "cvmfs-csi.cm.config.d" -}}
148-
{{ (index .Values.cvmfsConfig "config.d" "configMapName") | default (printf "%s-config-d" (include "cvmfs-csi.fullname" .)) }}
149-
{{- end -}}

deployments/helm/cvmfs-csi/templates/cvmfs-config-configmap.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if .Values.cvmfsConfig }}
2+
{{- fail "cvmfsConfig is not supported anymore. Please use extraConfigMaps, extraVolumes and extraVolumeMounts instead." }}
3+
{{- end }}
4+
{{- range .Values.extraConfigMaps }}
5+
---
6+
apiVersion: v1
7+
kind: ConfigMap
8+
metadata:
9+
name: {{ .name }}
10+
labels:
11+
{{- include "cvmfs-csi.common.metaLabels" $ | nindent 4 }}
12+
data:
13+
{{- range $path, $data := .data }}
14+
{{- $path | nindent 2 }}: |
15+
{{- tpl $data $ | nindent 4 }}
16+
{{- end }}
17+
{{- end }}

deployments/helm/cvmfs-csi/templates/nodeplugin-daemonset.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,8 @@ spec:
8888
- name: cvmfs-aliencache
8989
mountPath: /cvmfs-aliencache
9090
{{- end }}
91-
{{- if (index .Values.cvmfsConfig "default.local" "use") }}
92-
- name: cvmfs-config-default-local
93-
mountPath: /etc/cvmfs/default.local
94-
subPath: default.local
95-
{{- end }}
96-
{{- if (index .Values.cvmfsConfig "config.d" "use") }}
97-
- name: cvmfs-config-config-d
98-
mountPath: /etc/cvmfs/config.d
91+
{{- with .Values.nodeplugin.plugin.extraVolumeMounts }}
92+
{{- toYaml . | nindent 12 }}
9993
{{- end }}
10094
{{- with .Values.nodeplugin.plugin.resources }}
10195
resources: {{ toYaml . | nindent 12 }}
@@ -128,15 +122,8 @@ spec:
128122
- name: cvmfs-aliencache
129123
{{- toYaml .Values.cache.alien.volumeSpec | nindent 10 }}
130124
{{- end }}
131-
{{- if (index .Values.cvmfsConfig "default.local" "use") }}
132-
- name: cvmfs-config-default-local
133-
configMap:
134-
name: {{ include "cvmfs-csi.cm.default.local" . }}
135-
{{- end }}
136-
{{- if (index .Values.cvmfsConfig "config.d" "use") }}
137-
- name: cvmfs-config-config-d
138-
configMap:
139-
name: {{ include "cvmfs-csi.cm.config.d" . }}
125+
{{- with .Values.nodeplugin.extraVolumes }}
126+
{{- toYaml . | nindent 8 }}
140127
{{- end }}
141128
{{- with .Values.nodeplugin.affinity }}
142129
affinity: {{ toYaml . | nindent 8 }}

deployments/helm/cvmfs-csi/values.yaml

Lines changed: 38 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,29 @@
11
# This is a YAML-formatted file.
22
# Declare variables to be passed into your templates.
33

4-
# CVMFS configuration to be sourced into /etc/cvmfs.
5-
# It is exposed as a set of ConfigMaps deployed in the same namespace
6-
# as the CVMFS CSI driver.
7-
cvmfsConfig:
8-
9-
# ConfigMap for /etc/cvmfs/default.local file.
10-
default.local:
11-
12-
# Name of the ConfigMap (to use or create).
13-
# If left empty, a name will be generated
14-
# using the cvmfs-csi.fullname template.
15-
configMapName: cvmfs-csi-default-local
16-
17-
# Whether to use this ConfigMap in /etc/cvmfs/default.local.
18-
use: true
19-
20-
# Whether to create default.local ConfigMap with data entries defined below.
21-
# If not, and `use` is set to true, it is expected the ConfigMap is already present.
22-
create: true
23-
24-
data:
25-
26-
default.local: |
27-
CVMFS_USE_GEOAPI=yes
28-
CVMFS_HTTP_PROXY="http://ca-proxy.cern.ch:3128"
29-
30-
# It is advised to change these configs in the cache section of the helm values
31-
# and leave them unchanged here, so they auto-generate.
32-
CVMFS_QUOTA_LIMIT={{ .Values.cache.local.cvmfsQuotaLimit }}
33-
CVMFS_CACHE_BASE=/cvmfs-localcache
34-
35-
{{- if .Values.cache.alien.enabled }}
36-
CVMFS_ALIEN_CACHE=/cvmfs-aliencache
37-
# When alien cache is used, CVMFS does not control the size of the cache.
38-
CVMFS_QUOTA_LIMIT=-1
39-
# Whether repositories should share a cache directory or each have their own.
40-
CVMFS_SHARED_CACHE=no
41-
{{- end -}}
42-
43-
# ConfigMap for /etc/cvmfs/config.d directory.
44-
config.d:
45-
46-
# Name of the ConfigMap (to use or create).
47-
# If left empty, a name will be generated
48-
# using the cvmfs-csi.fullname template.
49-
configMapName: cvmfs-csi-config-d
50-
51-
# Whether to use this ConfigMap in /etc/cvmfs/config.d.
52-
use: true
53-
54-
# Whether to create ConfigMap with data entries defined below.
55-
create: true
56-
57-
data: {}
58-
59-
# CERN
60-
61-
# cern.ch.conf: |
62-
# CVMFS_SERVER_URL="http://cvmfs-stratum-one.cern.ch/cvmfs/@fqrn@;http://cernvmfs.gridpp.rl.ac.uk/cvmfs/@fqrn@;http://cvmfs.racf.bnl.gov/cvmfs/@fqrn@;http://cvmfs.fnal.gov/cvmfs/@fqrn@"
63-
# CVMFS_PUBLIC_KEY='/etc/cvmfs/config.d/cern.ch.pub'
64-
65-
# cern.ch.pub: |
66-
# -----BEGIN PUBLIC KEY-----
67-
# MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgHvy9PFYteIdwD5OxEosZoqpSUxP
68-
# LddA+zRwD0lWfavbFoCJOJS23zPpIimQ0gzH3FAebR3x9JzVVa3JFLxIUj4Fv3d6
69-
# /3fWhyK4Nmxc7B1Qh7wrRYlYtcDszGGk2DB0ETI83Jbzvfx1slvhMkqjWQ0c30w8
70-
# BWglnUvav0hRRwJRAgMBAAE=
71-
# -----END PUBLIC KEY-----
4+
# Extra ConfigMaps to create and manage by the chart release.
5+
# These can be used e.g. when defining CVMFS client configuration.
6+
# ConfigMap data supports go-template expressions.
7+
extraConfigMaps:
8+
# /etc/cvmfs/default.local
9+
- name: cvmfs-csi-default-local
10+
data:
11+
default.local: |
12+
CVMFS_USE_GEOAPI=yes
13+
CVMFS_HTTP_PROXY="http://ca-proxy.cern.ch:3128"
14+
15+
# It is advised to change these configs in the cache section of the helm values
16+
# and leave them unchanged here, so they auto-generate.
17+
CVMFS_QUOTA_LIMIT={{ .Values.cache.local.cvmfsQuotaLimit }}
18+
CVMFS_CACHE_BASE=/cvmfs-localcache
19+
20+
{{- if .Values.cache.alien.enabled }}
21+
CVMFS_ALIEN_CACHE=/cvmfs-aliencache
22+
# When alien cache is used, CVMFS does not control the size of the cache.
23+
CVMFS_QUOTA_LIMIT=-1
24+
# Whether repositories should share a cache directory or each have their own.
25+
CVMFS_SHARED_CACHE=no
26+
{{- end -}}
7227
7328
# Cache configuration for storing CVMFS client data.
7429
# CVMFS CSI supports two kinds of caches:
@@ -99,13 +54,25 @@ nodeplugin:
9954
# and to generate DaemonSet name.
10055
name: nodeplugin
10156

57+
# Extra volumes to be appended to nodeplugin's Pod.spec.volumes.
58+
extraVolumes:
59+
- name: etc-cvmfs-default-conf
60+
configMap:
61+
name: cvmfs-csi-default-local
62+
10263
# CVMFS CSI image and container resources specs.
10364
plugin:
10465
image:
10566
repository: registry.cern.ch/magnum/cvmfs-csi
10667
tag: v2.0.0
10768
pullPolicy: IfNotPresent
10869
resources: {}
70+
# Extra volume mounts to append to nodeplugin's
71+
# Pod.spec.containers[name="nodeplugin"].volumeMounts.
72+
extraVolumeMounts:
73+
- name: etc-cvmfs-default-conf
74+
mountPath: /etc/cvmfs/default.local
75+
subPath: default.local
10976

11077
# csi-node-driver-registrar image and container resources specs.
11178
registrar:
@@ -170,13 +137,16 @@ controllerplugin:
170137
# Number of Deployment replicas. In general, one is sufficient.
171138
replicas: 1
172139

140+
extraVolumes: []
141+
173142
# CVMFS CSI image and container resources specs.
174143
plugin:
175144
image:
176145
repository: registry.cern.ch/magnum/cvmfs-csi
177146
tag: v2.0.0
178147
pullPolicy: IfNotPresent
179148
resources: {}
149+
extraVolumeMounts: []
180150

181151
# CSI external-provisioner image and container resources specs.
182152
provisioner:

0 commit comments

Comments
 (0)