From 94798a7c277047c2d079c630895cf0a478626bad Mon Sep 17 00:00:00 2001 From: zhujian Date: Tue, 2 Jul 2024 07:39:31 +0000 Subject: [PATCH] Update fluid addon Signed-off-by: zhujian --- fluid-addon/README.md | 24 ++++++++++--------- .../addon/addon-template-fluid-0.0.1.yaml | 10 ++++++++ fluid-addon/deploy/addon/cma-fluid.yaml | 4 +++- fluid-addon/deploy/sample/mca-fluid.yaml | 2 +- fluid-addon/quick-start/app.yaml | 17 +++++++++++++ fluid-addon/quick-start/dataset.yaml | 9 +++++++ fluid-addon/quick-start/runtime.yaml | 16 +++++++++++++ 7 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 fluid-addon/quick-start/app.yaml create mode 100644 fluid-addon/quick-start/dataset.yaml create mode 100644 fluid-addon/quick-start/runtime.yaml diff --git a/fluid-addon/README.md b/fluid-addon/README.md index 852ca791..9426b606 100644 --- a/fluid-addon/README.md +++ b/fluid-addon/README.md @@ -19,17 +19,7 @@ $ kubectl get addontemplate fluid-0.0.1 ## Enable the fluid addon for a managed cluster -Then apply a managedclusteraddon to enable the fluid for a managed cluster(eg cluster1) by: - -``` -# Replace 'cluster1' with the managed cluster name - -$ MANAGED_CLUSTER=cluster1 \ - sed -e "s,MANAGED_CLUSTER,${MANAGED_CLUSTER}," deploy/sample/mca-fluid.yaml | \ - kubectl apply -f - -``` - -OR use the [clusteradm](https://github.com/open-cluster-management-io/clusteradm/) cli: +Then apply a managedclusteraddon to enable the fluid for a managed cluster(eg cluster1) by the tool [clusteradm](https://github.com/open-cluster-management-io/clusteradm/) cli: ``` clusteradm addon enable --names=fluid --clusters=cluster1 @@ -59,6 +49,18 @@ fluidapp-controller-6c59d668cf-pxhjc 1/1 Running 0 16m ## Verify the fluid addon is functioning +### As a Managed cluster admin + Switch context to the Managed cluster. Please refer to the [Get Started of the fluid doc to crate a dataset](https://github.com/fluid-cloudnative/fluid/blob/v0.9.2/docs/en/userguide/get_started.md#create-a-dataset) to verify that the fluid is functioning properly. + +### As a Hub cluster admin + +Switch context to the Hub cluster. Distribute fluid resources by manifestworks to the managed cluster. + +``` +# clusteradm create work dataset-demo -c cluster1 -f quick-start/dataset.yaml +# clusteradm create work runtime-demo -c cluster1 -f quick-start/runtime.yaml +# clusteradm create work app-demo -c cluster1 -f quick-start/app.yaml +``` diff --git a/fluid-addon/deploy/addon/addon-template-fluid-0.0.1.yaml b/fluid-addon/deploy/addon/addon-template-fluid-0.0.1.yaml index c0f4c38a..c0ef878e 100644 --- a/fluid-addon/deploy/addon/addon-template-fluid-0.0.1.yaml +++ b/fluid-addon/deploy/addon/addon-template-fluid-0.0.1.yaml @@ -57,6 +57,16 @@ spec: type: ServerSideApply workload: manifests: + - apiVersion: rbac.authorization.k8s.io/v1 + kind: ClusterRole + metadata: + name: open-cluster-management:klusterlet-work:fluid-clusterrole + labels: + open-cluster-management.io/aggregate-to-work: "true" # with this label, the clusterRole will be selected to aggregate + rules: + - apiGroups: ["data.fluid.io"] + resources: ['*'] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiVersion: apps/v1 kind: Deployment metadata: diff --git a/fluid-addon/deploy/addon/cma-fluid.yaml b/fluid-addon/deploy/addon/cma-fluid.yaml index 11a5d034..30c44337 100644 --- a/fluid-addon/deploy/addon/cma-fluid.yaml +++ b/fluid-addon/deploy/addon/cma-fluid.yaml @@ -6,7 +6,9 @@ metadata: name: fluid spec: addOnConfiguration: {} - addOnMeta: {} + addOnMeta: + displayName: Fluid + description: Fluid is an open source Kubernetes-native Distributed Dataset Orchestrator and Accelerator for data-intensive applications, such as big data and AI applications. installStrategy: type: Manual supportedConfigs: diff --git a/fluid-addon/deploy/sample/mca-fluid.yaml b/fluid-addon/deploy/sample/mca-fluid.yaml index 46076ef2..f37c94cd 100644 --- a/fluid-addon/deploy/sample/mca-fluid.yaml +++ b/fluid-addon/deploy/sample/mca-fluid.yaml @@ -2,6 +2,6 @@ apiVersion: addon.open-cluster-management.io/v1alpha1 kind: ManagedClusterAddOn metadata: name: fluid - namespace: MANAGED_CLUSTER + namespace: cluster1 spec: installNamespace: open-cluster-management-agent-addon diff --git a/fluid-addon/quick-start/app.yaml b/fluid-addon/quick-start/app.yaml new file mode 100644 index 00000000..4295c620 --- /dev/null +++ b/fluid-addon/quick-start/app.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Pod +metadata: + name: demo-app + namespace: default +spec: + containers: + - name: demo + image: nginx + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /data + name: demo + volumes: + - name: demo + persistentVolumeClaim: + claimName: demo diff --git a/fluid-addon/quick-start/dataset.yaml b/fluid-addon/quick-start/dataset.yaml new file mode 100644 index 00000000..e3232d14 --- /dev/null +++ b/fluid-addon/quick-start/dataset.yaml @@ -0,0 +1,9 @@ +apiVersion: data.fluid.io/v1alpha1 +kind: Dataset +metadata: + name: demo + namespace: default +spec: + mounts: + - mountPoint: https://mirrors.bit.edu.cn/apache/spark/ + name: spark diff --git a/fluid-addon/quick-start/runtime.yaml b/fluid-addon/quick-start/runtime.yaml new file mode 100644 index 00000000..07f899da --- /dev/null +++ b/fluid-addon/quick-start/runtime.yaml @@ -0,0 +1,16 @@ +apiVersion: data.fluid.io/v1alpha1 +kind: AlluxioRuntime +metadata: + name: demo + namespace: default +spec: + replicas: 1 + tieredstore: + levels: + - mediumtype: MEM + #path: /dev/shm + #quota: 64Mi + path: /home/tmp/fluid + quota: 2Gi + high: "0.95" + low: "0.7"