mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
helm: add option to enable read affinity for CephFS
This commit adds --enable-read-affinity flag to enable read affinity for CephFS. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
parent
4d466843b9
commit
7e26beb51e
@ -164,6 +164,8 @@ charts and their default values.
|
||||
| `provisioner.podSecurityPolicy.enabled` | Specifies whether podSecurityPolicy is enabled | `false` |
|
||||
| `provisionerSocketFile` | The filename of the provisioner socket | `csi-provisioner.sock` |
|
||||
| `pluginSocketFile` | The filename of the plugin socket | `csi.sock` |
|
||||
| `readAffinity.enabled` | Enable read affinity for CephFS subvolumes. Recommended to set to true if running kernel 5.8 or newer. | `false` |
|
||||
| `readAffinity.crushLocationLabels` | Define which node labels to use as CRUSH location. This should correspond to the values set in the CRUSH map. For more information, click [here](https://github.com/ceph/ceph-csi/blob/v3.9.0/docs/deploy-rbd.md#read-affinity-using-crush-locations-for-rbd-volumes)| `[]` |
|
||||
| `kubeletDir` | Kubelet working directory | `/var/lib/kubelet` |
|
||||
| `driverName` | Name of the csi-driver | `cephfs.csi.ceph.com` |
|
||||
| `configMapName` | Name of the configmap which contains cluster configuration | `ceph-csi-config` |
|
||||
|
19
charts/ceph-csi-cephfs/templates/nodeplugin-clusterrole.yaml
Normal file
19
charts/ceph-csi-cephfs/templates/nodeplugin-clusterrole.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
{{- if .Values.rbac.create -}}
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }}
|
||||
labels:
|
||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
||||
component: {{ .Values.nodeplugin.name }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
|
||||
rules:
|
||||
{{- if and .Values.readAffinity .Values.readAffinity.enabled }}
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
verbs: ["get"]
|
||||
{{- end }}
|
||||
{{- end -}}
|
@ -0,0 +1,21 @@
|
||||
{{- if .Values.rbac.create -}}
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }}
|
||||
labels:
|
||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
||||
component: {{ .Values.nodeplugin.name }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "ceph-csi-cephfs.serviceAccountName.nodeplugin" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }}
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
{{- end -}}
|
@ -85,6 +85,10 @@ spec:
|
||||
- "--drivername=$(DRIVER_NAME)"
|
||||
{{- if .Values.nodeplugin.profiling.enabled }}
|
||||
- "--enableprofiling={{ .Values.nodeplugin.profiling.enabled }}"
|
||||
{{- end }}
|
||||
- "--enable-read-affinity={{ and .Values.readAffinity .Values.readAffinity.enabled }}"
|
||||
{{- if and .Values.readAffinity .Values.readAffinity.enabled }}
|
||||
- "--crush-location-labels={{ .Values.readAffinity.crushLocationLabels | join "," }}"
|
||||
{{- end }}
|
||||
env:
|
||||
- name: POD_IP
|
||||
|
@ -222,6 +222,17 @@ provisioner:
|
||||
|
||||
affinity: {}
|
||||
|
||||
# readAffinity:
|
||||
# Enable read affinity for CephFS subvolumes. Recommended to
|
||||
# set to true if running kernel 5.8 or newer.
|
||||
# enabled: false
|
||||
# Define which node labels to use as CRUSH location.
|
||||
# This should correspond to the values set in the CRUSH map.
|
||||
# NOTE: the value here serves as an example
|
||||
# crushLocationLabels:
|
||||
# - topology.kubernetes.io/region
|
||||
# - topology.kubernetes.io/zone
|
||||
|
||||
# Mount the host /etc/selinux inside pods to support
|
||||
# selinux-enabled filesystems
|
||||
selinuxMount: true
|
||||
|
@ -175,7 +175,7 @@ install_cephcsi_helm_charts() {
|
||||
fi
|
||||
# install ceph-csi-cephfs and ceph-csi-rbd charts
|
||||
# shellcheck disable=SC2086
|
||||
"${HELM}" install --namespace ${NAMESPACE} --set provisioner.fullnameOverride=csi-cephfsplugin-provisioner --set nodeplugin.fullnameOverride=csi-cephfsplugin --set configMapName=ceph-csi-config --set provisioner.replicaCount=1 --set-json='commonLabels={"app.kubernetes.io/name": "ceph-csi-cephfs", "app.kubernetes.io/managed-by": "helm"}' ${SET_SC_TEMPLATE_VALUES} ${CEPHFS_SECRET_TEMPLATE_VALUES} ${CEPHFS_CHART_NAME} "${SCRIPT_DIR}"/../charts/ceph-csi-cephfs
|
||||
"${HELM}" install --namespace ${NAMESPACE} --set provisioner.fullnameOverride=csi-cephfsplugin-provisioner --set nodeplugin.fullnameOverride=csi-cephfsplugin --set configMapName=ceph-csi-config --set provisioner.replicaCount=1 --set-json='commonLabels={"app.kubernetes.io/name": "ceph-csi-cephfs", "app.kubernetes.io/managed-by": "helm"}' ${SET_SC_TEMPLATE_VALUES} ${CEPHFS_SECRET_TEMPLATE_VALUES} ${CEPHFS_CHART_NAME} "${SCRIPT_DIR}"/../charts/ceph-csi-cephfs --set readAffinity.enabled=true --set readAffinity.crushLocationLabels="{${CRUSH_LOCATION_REGION_LABEL},${CRUSH_LOCATION_ZONE_LABEL}}"
|
||||
check_deployment_status app=ceph-csi-cephfs "${NAMESPACE}"
|
||||
check_daemonset_status app=ceph-csi-cephfs "${NAMESPACE}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user