From 69f1ba8c694e200217088d58ba1847958439ad56 Mon Sep 17 00:00:00 2001 From: ssz1997 Date: Thu, 30 Nov 2023 17:57:00 -0800 Subject: [PATCH 1/3] configurable fuse mount path on host machine --- api/v1alpha1/alluxiocluster_types.go | 23 ++++++++++--------- api/v1alpha1/zz_generated.deepcopy.go | 5 ++++ ...-operator.alluxio.com_alluxioclusters.yaml | 4 +++- .../alluxio/templates/csi/csi-fuse.yaml | 2 +- .../alluxio/templates/fuse/daemonset.yaml | 2 +- deploy/charts/alluxio/values.yaml | 2 ++ ...-operator.alluxio.com_alluxioclusters.yaml | 4 +++- 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/api/v1alpha1/alluxiocluster_types.go b/api/v1alpha1/alluxiocluster_types.go index bf46fbd3d..c3f075679 100644 --- a/api/v1alpha1/alluxiocluster_types.go +++ b/api/v1alpha1/alluxiocluster_types.go @@ -141,17 +141,18 @@ type ProxySpec struct { } type FuseSpec struct { - Affinity corev1.Affinity `json:"affinity,omitempty" yaml:"affinity,omitempty"` - Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"` - Group *int `json:"group,omitempty" yaml:"group,omitempty"` - JvmOptions []string `json:"jvmOptions,omitempty" yaml:"jvmOptions,omitempty"` - MountOptions []string `json:"mountOptions,omitempty" yaml:"mountOptions,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"` - PodAnnotations map[string]string `json:"podAnnotations,omitempty" yaml:"podAnnotations,omitempty"` - Resources ResourcesSpec `json:"resources,omitempty" yaml:"resources,omitempty"` - Tolerations []Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"` - User *int `json:"user,omitempty" yaml:"user,omitempty"` + Affinity corev1.Affinity `json:"affinity,omitempty" yaml:"affinity,omitempty"` + Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"` + Group *int `json:"group,omitempty" yaml:"group,omitempty"` + HostPathForMount string `json:"hostPathForMount,omitempty" yaml:"hostPathForMount,omitempty"` + JvmOptions []string `json:"jvmOptions,omitempty" yaml:"jvmOptions,omitempty"` + MountOptions []string `json:"mountOptions,omitempty" yaml:"mountOptions,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"` + PodAnnotations map[string]string `json:"podAnnotations,omitempty" yaml:"podAnnotations,omitempty"` + Resources ResourcesSpec `json:"resources,omitempty" yaml:"resources,omitempty"` + Tolerations []Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"` + User *int `json:"user,omitempty" yaml:"user,omitempty"` } type ResourcesSpec struct { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 35ab6bb58..4a9f9dbcb 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -765,6 +765,11 @@ func (in *MetastoreSpec) DeepCopyInto(out *MetastoreSpec) { *out = new(bool) **out = **in } + if in.HostPath != nil { + in, out := &in.HostPath, &out.HostPath + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetastoreSpec. diff --git a/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml b/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml index 39d6390c2..a19bf40b0 100644 --- a/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml +++ b/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml @@ -1007,6 +1007,8 @@ spec: type: object group: type: integer + hostPathForMount: + type: string jvmOptions: items: type: string @@ -2099,7 +2101,7 @@ spec: enabled: type: boolean hostPath: - type: string + type: boolean size: type: string storageClass: diff --git a/deploy/charts/alluxio/templates/csi/csi-fuse.yaml b/deploy/charts/alluxio/templates/csi/csi-fuse.yaml index e4273ec14..80b1f7157 100644 --- a/deploy/charts/alluxio/templates/csi/csi-fuse.yaml +++ b/deploy/charts/alluxio/templates/csi/csi-fuse.yaml @@ -118,7 +118,7 @@ data: volumes: - name: alluxio-fuse-mount hostPath: - path: {{ $hostMountPath }} + path: {{ .Values.fuse.hostPathForMount }} type: DirectoryOrCreate - name: {{ $fullName }}-alluxio-conf configMap: diff --git a/deploy/charts/alluxio/templates/fuse/daemonset.yaml b/deploy/charts/alluxio/templates/fuse/daemonset.yaml index 5c89de4da..817889dfa 100644 --- a/deploy/charts/alluxio/templates/fuse/daemonset.yaml +++ b/deploy/charts/alluxio/templates/fuse/daemonset.yaml @@ -177,7 +177,7 @@ spec: volumes: - name: alluxio-fuse-mount hostPath: - path: {{ $hostMountPath }} + path: {{ .Values.fuse.hostPathForMount }} type: DirectoryOrCreate - name: {{ $fullName }}-alluxio-conf configMap: diff --git a/deploy/charts/alluxio/values.yaml b/deploy/charts/alluxio/values.yaml index 25ff0f267..947614d2c 100644 --- a/deploy/charts/alluxio/values.yaml +++ b/deploy/charts/alluxio/values.yaml @@ -299,6 +299,8 @@ proxy: fuse: # Whether to launch Fuse pods enabled: false + # The path on the host machine for mount Alluxio Fuse + hostPathForMount: /mnt/alluxio/fuse # The path on the host machine for storing fuse log hostPathForLogs: /mnt/alluxio/logs/fuse # User and Group that override the global value diff --git a/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml b/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml index 39d6390c2..a19bf40b0 100644 --- a/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml +++ b/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml @@ -1007,6 +1007,8 @@ spec: type: object group: type: integer + hostPathForMount: + type: string jvmOptions: items: type: string @@ -2099,7 +2101,7 @@ spec: enabled: type: boolean hostPath: - type: string + type: boolean size: type: string storageClass: From 3f054050bf4cea2796ad1c4879ea44743d40835b Mon Sep 17 00:00:00 2001 From: ssz1997 Date: Thu, 30 Nov 2023 18:07:16 -0800 Subject: [PATCH 2/3] fix metastore type typo --- api/v1alpha1/alluxiocluster_types.go | 2 +- api/v1alpha1/zz_generated.deepcopy.go | 5 ----- .../crds/k8s-operator.alluxio.com_alluxioclusters.yaml | 2 +- resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml | 2 +- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/api/v1alpha1/alluxiocluster_types.go b/api/v1alpha1/alluxiocluster_types.go index c3f075679..c5c9f248f 100644 --- a/api/v1alpha1/alluxiocluster_types.go +++ b/api/v1alpha1/alluxiocluster_types.go @@ -122,7 +122,7 @@ type PagestoreSpec struct { type MetastoreSpec struct { Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - HostPath *bool `json:"hostPath,omitempty" yaml:"hostPath,omitempty"` + HostPath string `json:"hostPath,omitempty" yaml:"hostPath,omitempty"` Size string `json:"size,omitempty" yaml:"size,omitempty"` StorageClass string `json:"storageClass,omitempty" yaml:"storageClass,omitempty"` Type string `json:"type,omitempty" yaml:"type,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 4a9f9dbcb..35ab6bb58 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -765,11 +765,6 @@ func (in *MetastoreSpec) DeepCopyInto(out *MetastoreSpec) { *out = new(bool) **out = **in } - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(bool) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetastoreSpec. diff --git a/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml b/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml index a19bf40b0..46081970c 100644 --- a/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml +++ b/deploy/charts/alluxio-operator/crds/k8s-operator.alluxio.com_alluxioclusters.yaml @@ -2101,7 +2101,7 @@ spec: enabled: type: boolean hostPath: - type: boolean + type: string size: type: string storageClass: diff --git a/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml b/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml index a19bf40b0..46081970c 100644 --- a/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml +++ b/resources/crds/k8s-operator.alluxio.com_alluxioclusters.yaml @@ -2101,7 +2101,7 @@ spec: enabled: type: boolean hostPath: - type: boolean + type: string size: type: string storageClass: From 2d5f6f844a0827de98d209a64e8f136447635f8a Mon Sep 17 00:00:00 2001 From: ssz1997 Date: Thu, 30 Nov 2023 19:05:51 -0800 Subject: [PATCH 3/3] mount parent path --- deploy/charts/alluxio/templates/csi/csi-fuse.yaml | 2 +- deploy/charts/alluxio/templates/fuse/daemonset.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/charts/alluxio/templates/csi/csi-fuse.yaml b/deploy/charts/alluxio/templates/csi/csi-fuse.yaml index 80b1f7157..8651d6ca1 100644 --- a/deploy/charts/alluxio/templates/csi/csi-fuse.yaml +++ b/deploy/charts/alluxio/templates/csi/csi-fuse.yaml @@ -118,7 +118,7 @@ data: volumes: - name: alluxio-fuse-mount hostPath: - path: {{ .Values.fuse.hostPathForMount }} + path: {{ .Values.fuse.hostPathForMount | dir }} type: DirectoryOrCreate - name: {{ $fullName }}-alluxio-conf configMap: diff --git a/deploy/charts/alluxio/templates/fuse/daemonset.yaml b/deploy/charts/alluxio/templates/fuse/daemonset.yaml index 817889dfa..e7d3d42c9 100644 --- a/deploy/charts/alluxio/templates/fuse/daemonset.yaml +++ b/deploy/charts/alluxio/templates/fuse/daemonset.yaml @@ -177,7 +177,7 @@ spec: volumes: - name: alluxio-fuse-mount hostPath: - path: {{ .Values.fuse.hostPathForMount }} + path: {{ .Values.fuse.hostPathForMount | dir }} type: DirectoryOrCreate - name: {{ $fullName }}-alluxio-conf configMap: