-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
127 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Installation | ||
|
||
If you are using [Alibaba Cloud Container Service for Kubernetes (ACK)](https://www.alibabacloud.com/product/kubernetes), | ||
the CSI drivers will be deployed automatically. You can manage them as a component through the | ||
[ACK console](https://www.alibabacloud.com/help/en/ack/ack-managed-and-ack-dedicated/user-guide/manage-system-components). | ||
|
||
If you deploy Kubernetes yourself, you can still use [registered cluster](https://www.alibabacloud.com/help/en/ack/distributed-cloud-container-platform-for-kubernetes/user-guide/overview-9) | ||
to manage the CSI drivers. | ||
|
||
Read on if you want to deploy the drivers manually. | ||
|
||
## Prerequisites | ||
|
||
* Kubernetes version >= 1.26 | ||
* `kubectl` configured to communicate with the cluster | ||
* Helm 3 | ||
* different drivers have their own requirements, please refer to their specific documentation | ||
|
||
## Setup RAM Permissions | ||
|
||
The driver requires RAM permissions to invoke Alibaba Cloud OpenAPIs to manage the volume on user's behalf. | ||
Different drivers requires different permissions, please refer to the [example policies](./ram-policies). | ||
|
||
There are several methods to grant the driver RAM permissions: | ||
|
||
* If the CSI is deployed on ECS, you may use [instance RAM role](https://www.alibabacloud.com/help/en/ecs/user-guide/attach-an-instance-ram-role-to-an-ecs-instance). | ||
Attach the above policies to the instance RAM role and turn on access to ECS metadata for the instances on which the driver Deployment runs. | ||
For Disk driver, all the instances in the cluster need this. | ||
|
||
* use a secret for access key. | ||
1. Create a RAM user, enable OpenAPI access. Once the user is created, record the AccessKey ID and AccessKey Secret. | ||
2. Create a policy, paste in the policies. | ||
3. Authorize the new policy for the new RAM user. | ||
4. Store the AccessKey to Cluster as a secret. | ||
```shell | ||
kubectl create secret -n kube-system generic csi-access-key \ | ||
--from-literal=id='LTA******************GWN' \ | ||
--from-literal=secret='***********' | ||
``` | ||
|
||
## Deploy the Drivers | ||
|
||
You can deploy the drivers using Helm. | ||
|
||
The default values mimic the config of the drivers in ACK cluster. | ||
We provides some configuration presets. Select one of them: | ||
* values-ecs.yaml: for deploy on ECS | ||
* values-nonecs.yaml: for deploy on non-ECS environment, disk driver is disabled | ||
|
||
```shell | ||
git clone https://github.com/kubernetes-sigs/alibaba-cloud-csi-driver.git | ||
cd alibaba-cloud-csi-driver/deploy | ||
helm upgrade --install alibaba-cloud-csi-driver ./chart --values chart/values-ecs.yaml --namespace kube-system | ||
``` | ||
|
||
Please review the [values file](../deploy/chart/values.yaml) before installing. Some important configurations are: | ||
* deploy.accessKey.enabled: if you are using instance RAM role, disable this. | ||
|
||
## Verify | ||
|
||
Check the driver pods are running and ready: | ||
|
||
```shell | ||
kubectl get pods -n kube-system -l app=csi-plugin | ||
kubectl get pods -n kube-system -l app=csi-provisioner | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"Version": "1", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"ecs:AttachDisk", | ||
"ecs:DetachDisk", | ||
"ecs:DescribeDisks", | ||
"ecs:CreateDisk", | ||
"ecs:ResizeDisk", | ||
"ecs:CreateSnapshot", | ||
"ecs:DeleteSnapshot", | ||
"ecs:CreateAutoSnapshotPolicy", | ||
"ecs:ApplyAutoSnapshotPolicy", | ||
"ecs:CancelAutoSnapshotPolicy", | ||
"ecs:DeleteAutoSnapshotPolicy", | ||
"ecs:DescribeAutoSnapshotPolicyEX", | ||
"ecs:ModifyAutoSnapshotPolicyEx", | ||
"ecs:AddTags", | ||
"ecs:RemoveTags", | ||
"ecs:DescribeTags", | ||
"ecs:DescribeSnapshots", | ||
"ecs:ListTagResources", | ||
"ecs:TagResources", | ||
"ecs:UntagResources", | ||
"ecs:ModifyDiskSpec", | ||
"ecs:CreateSnapshot", | ||
"ecs:DescribeSnapshotGroups", | ||
"ecs:CreateSnapshotGroup", | ||
"ecs:DeleteSnapshotGroup", | ||
"ecs:CopySnapshot", | ||
"ecs:DeleteDisk", | ||
"ecs:DescribeInstanceAttribute", | ||
"ecs:DescribeInstanceHistoryEvents", | ||
"ecs:DescribeTaskAttribute", | ||
"ecs:DescribeInstances" | ||
], | ||
"Resource": [ | ||
"*" | ||
], | ||
"Effect": "Allow" | ||
}, | ||
{ | ||
"Action": [ | ||
"kms:ListAliases" | ||
], | ||
"Resource": [ | ||
"*" | ||
], | ||
"Effect": "Allow" | ||
} | ||
] | ||
} |