Skip to content

Commit

Permalink
Update fluid addon
Browse files Browse the repository at this point in the history
Signed-off-by: zhujian <jiazhu@redhat.com>
  • Loading branch information
zhujian7 committed Jul 8, 2024
1 parent 9498948 commit 94798a7
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 13 deletions.
24 changes: 13 additions & 11 deletions fluid-addon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```
10 changes: 10 additions & 0 deletions fluid-addon/deploy/addon/addon-template-fluid-0.0.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion fluid-addon/deploy/addon/cma-fluid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion fluid-addon/deploy/sample/mca-fluid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions fluid-addon/quick-start/app.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions fluid-addon/quick-start/dataset.yaml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions fluid-addon/quick-start/runtime.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 94798a7

Please sign in to comment.