Skip to content

Commit

Permalink
Merge branch 'rook:master' into test-helm-on-multiple-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHellier committed Dec 1, 2021
2 parents cf5601f + baa67c8 commit c941d4d
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Documentation/helm-ceph-cluster.md
Expand Up @@ -88,6 +88,7 @@ The `cephBlockPools` array in the values file will define a list of CephBlockPoo
| `storageClass.parameters` | See [Block Storage](ceph-block.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
| `storageClass.allowVolumeExpansion` | Whether [volume expansion](https://kubernetes.io/docs/concepts/storage/storage-classes/#allow-volume-expansion) is allowed by default. | `true` |
| `storageClass.mountOptions` | Specifies the mount options for storageClass | `[]` |

### Ceph File Systems

Expand All @@ -101,6 +102,7 @@ The `cephFileSystems` array in the values file will define a list of CephFileSys
| `storageClass.name` | The name of the storage class | `ceph-filesystem` |
| `storageClass.parameters` | See [Shared Filesystem](ceph-filesystem.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
| `storageClass.mountOptions` | Specifies the mount options for storageClass | `[]` |

### Ceph Object Stores

Expand Down
1 change: 1 addition & 0 deletions Documentation/helm-operator.md
Expand Up @@ -110,6 +110,7 @@ The following tables lists the configurable parameters of the rook-operator char
| `csi.provisionerReplicas` | Set replicas for csi provisioner deployment. | `2` |
| `csi.enableGrpcMetrics` | Enable Ceph CSI GRPC Metrics. | `false` |
| `csi.enableCSIHostNetwork` | Enable Host Networking for Ceph CSI nodeplugins. | `false` |
| `csi.enablePluginSelinuxHostMount` | Enable Host mount for /etc/selinux directory for Ceph CSI nodeplugins. | `false` |
| `csi.provisionerTolerations` | Array of tolerations in YAML format which will be added to CSI provisioner deployment. | <none> |
| `csi.provisionerNodeAffinity` | The node labels for affinity of the CSI provisioner deployment (***) | <none> |
| `csi.pluginTolerations` | Array of tolerations in YAML format which will be added to CephCSI plugin DaemonSet | <none> |
Expand Down
6 changes: 6 additions & 0 deletions deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml
Expand Up @@ -22,5 +22,11 @@ parameters:
{{ toYaml $blockpool.storageClass.parameters | indent 2 }}
reclaimPolicy: {{ default "Delete" $blockpool.storageClass.reclaimPolicy }}
allowVolumeExpansion: {{ default "true" $blockpool.storageClass.allowVolumeExpansion }}
{{- if $blockpool.storageClass.mountOptions }}
mountOptions:
{{- range $blockpool.storageClass.mountOptions }}
- {{ . }}
{{- end }}
{{- end }}
{{ end }}
{{ end }}
6 changes: 6 additions & 0 deletions deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml
Expand Up @@ -23,5 +23,11 @@ parameters:
{{ toYaml $filesystem.storageClass.parameters | indent 2 }}
reclaimPolicy: {{ default "Delete" $filesystem.storageClass.reclaimPolicy }}
allowVolumeExpansion: {{ default "true" $filesystem.storageClass.allowVolumeExpansion }}
{{- if $filesystem.storageClass.mountOptions }}
mountOptions:
{{- range $filesystem.storageClass.mountOptions }}
- {{ . }}
{{- end }}
{{- end }}
{{ end }}
{{ end }}
2 changes: 2 additions & 0 deletions deploy/charts/rook-ceph-cluster/values.yaml
Expand Up @@ -329,6 +329,7 @@ cephBlockPools:
isDefault: true
reclaimPolicy: Delete
allowVolumeExpansion: true
mountOptions: []
# see https://github.com/rook/rook/blob/master/Documentation/ceph-block.md#provision-storage for available configuration
parameters:
# (optional) mapOptions is a comma-separated list of map options.
Expand Down Expand Up @@ -381,6 +382,7 @@ cephFileSystems:
name: ceph-filesystem
reclaimPolicy: Delete
allowVolumeExpansion: true
mountOptions: []
# see https://github.com/rook/rook/blob/master/Documentation/ceph-filesystem.md#provision-storage for available configuration
parameters:
# The secrets contain Ceph admin credentials.
Expand Down
2 changes: 2 additions & 0 deletions deploy/charts/rook-ceph/templates/deployment.yaml
Expand Up @@ -89,6 +89,8 @@ spec:
value: {{ .Values.csi.enableOMAPGenerator | quote }}
- name: CSI_ENABLE_VOLUME_REPLICATION
value: {{ .Values.csi.volumeReplication.enabled | quote }}
- name: CSI_PLUGIN_ENABLE_SELINUX_HOST_MOUNT
value: {{ .Values.csi.enablePluginSelinuxHostMount | quote }}
{{- if .Values.csi.enableCSIHostNetwork }}
- name: CSI_ENABLE_HOST_NETWORK
value: {{ .Values.csi.enableCSIHostNetwork | quote }}
Expand Down
2 changes: 2 additions & 0 deletions deploy/charts/rook-ceph/values.yaml
Expand Up @@ -66,6 +66,8 @@ csi:
enableCephfsSnapshotter: true
# set to false to disable deployment of snapshotter container in RBD provisioner pod.
enableRBDSnapshotter: true
# set to false if the selinux is not enabled or unavailable in cluster nodes.
enablePluginSelinuxHostMount : false
# (Optional) set user created priorityclassName for csi plugin pods.
# pluginPriorityClassName: system-node-critical

Expand Down
4 changes: 4 additions & 0 deletions deploy/examples/operator-openshift.yaml
Expand Up @@ -154,6 +154,10 @@ data:

# (Optional) Allow starting unsupported ceph-csi image
ROOK_CSI_ALLOW_UNSUPPORTED_VERSION: "false"

# (Optional) control the host mount of /etc/selinux for csi plugin pods.
CSI_PLUGIN_ENABLE_SELINUX_HOST_MOUNT: "false"

# The default version of CSI supported by Rook will be started. To change the version
# of the CSI driver to something other than what is officially supported, change
# these images to the desired release of the CSI driver.
Expand Down
4 changes: 4 additions & 0 deletions deploy/examples/operator.yaml
Expand Up @@ -72,6 +72,10 @@ data:

# (Optional) Allow starting unsupported ceph-csi image
ROOK_CSI_ALLOW_UNSUPPORTED_VERSION: "false"

# (Optional) control the host mount of /etc/selinux for csi plugin pods.
CSI_PLUGIN_ENABLE_SELINUX_HOST_MOUNT: "false"

# The default version of CSI supported by Rook will be started. To change the version
# of the CSI driver to something other than what is officially supported, change
# these images to the desired release of the CSI driver.
Expand Down
10 changes: 10 additions & 0 deletions deploy/olm/assemble/metadata-common.yaml
Expand Up @@ -153,6 +153,16 @@ spec:
version: v1
displayName: Ceph Object Store Zone
description: Represents a Ceph Object Store Zone.
- kind: CephBucketNotification
name: cephbucketnotifications.ceph.rook.io
version: v1
displayName: Ceph Bucket Notification
description: Represents a Ceph Bucket Notification.
- kind: CephBucketTopic
name: cephbuckettopics.ceph.rook.io
version: v1
displayName: Ceph Bucket Topic
description: Represents a Ceph Bucket Topic.
displayName: Rook-Ceph
description: |
Expand Down
12 changes: 12 additions & 0 deletions deploy/olm/generate-rook-csv.sh
Expand Up @@ -10,6 +10,7 @@ ASSEMBLE_FILE_K8S="$OLM_CATALOG_DIR/assemble/metadata-k8s.yaml"
ASSEMBLE_FILE_OCP="$OLM_CATALOG_DIR/assemble/metadata-ocp.yaml"
ASSEMBLE_FILE_OKD="$OLM_CATALOG_DIR/assemble/metadata-okd.yaml"
PACKAGE_FILE="$OLM_CATALOG_DIR/assemble/rook-ceph.package.yaml"
CRDS_FILE="deploy/examples/crds.yaml"
SUPPORTED_PLATFORMS='k8s|ocp|okd'

operator_sdk="${OPERATOR_SDK:-operator-sdk}"
Expand Down Expand Up @@ -262,6 +263,17 @@ function apply_rook_op_img(){
"${YQ_CMD_WRITE[@]}" "$CSV_FILE_NAME" spec.install.spec.deployments[0].spec.template.spec.containers[0].image "$ROOK_OP_VERSION"
}

function validate_crds() {
crds=$(awk '/Kind:/ {print $2}' $CRDS_FILE | grep -vE "ObjectBucketList|ObjectBucketClaimList" | sed 's/List//' | sort)
csv_crds=$(awk '/kind:/ {print $3}' "$CSV_FILE_NAME" | sort)
if [ "$crds" != "$csv_crds" ]; then
echo "CRDs in $CSV_FILE_NAME do not match CRDs in $CRDS_FILE, see the diff below"
echo ""
diff <(echo "$crds") <(echo "$csv_crds")
exit 1
fi
}

########
# MAIN #
########
Expand Down
5 changes: 5 additions & 0 deletions pkg/operator/ceph/csi/spec.go
Expand Up @@ -51,6 +51,7 @@ type Param struct {
PluginPriorityClassName string
ProvisionerPriorityClassName string
VolumeReplicationImage string
EnablePluginSelinuxHostMount bool
EnableCSIHostNetwork bool
EnableOMAPGenerator bool
EnableRBDSnapshotter bool
Expand Down Expand Up @@ -316,6 +317,10 @@ func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerI
tp.RBDPluginUpdateStrategy = rollingUpdate
}

if strings.EqualFold(k8sutil.GetValue(r.opConfig.Parameters, "CSI_PLUGIN_ENABLE_SELINUX_HOST_MOUNT", "false"), "true") {
tp.EnablePluginSelinuxHostMount = true
}

logger.Infof("Kubernetes version is %s.%s", ver.Major, ver.Minor)

tp.ResizerImage = k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_RESIZER_IMAGE", DefaultResizerImage)
Expand Down
10 changes: 10 additions & 0 deletions pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin.yaml
Expand Up @@ -105,6 +105,11 @@ spec:
mountPath: /tmp/csi/keys
- name: host-run-mount
mountPath: /run/mount
{{ if .EnablePluginSelinuxHostMount }}
- name: etc-selinux
mountPath: /etc/selinux
readOnly: true
{{ end }}
- name: liveness-prometheus
securityContext:
privileged: true
Expand Down Expand Up @@ -166,3 +171,8 @@ spec:
- name: host-run-mount
hostPath:
path: /run/mount
{{ if .EnablePluginSelinuxHostMount }}
- name: etc-selinux
hostPath:
path: /etc/selinux
{{ end }}
10 changes: 10 additions & 0 deletions pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml
Expand Up @@ -106,6 +106,11 @@ spec:
mountPath: /tmp/csi/keys
- name: host-run-mount
mountPath: /run/mount
{{ if .EnablePluginSelinuxHostMount }}
- name: etc-selinux
mountPath: /etc/selinux
readOnly: true
{{ end }}
- name: liveness-prometheus
securityContext:
privileged: true
Expand Down Expand Up @@ -176,3 +181,8 @@ spec:
- name: host-run-mount
hostPath:
path: /run/mount
{{ if .EnablePluginSelinuxHostMount }}
- name: etc-selinux
hostPath:
path: /etc/selinux
{{ end }}

0 comments on commit c941d4d

Please sign in to comment.