Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: config aliyun oss as artifact repo to enhance user experience #9551

Merged

Conversation

zychina
Copy link
Contributor

@zychina zychina commented Sep 9, 2022

Provide a bash script to use aliyun cli to create oss bucket, ram user with limit permission. Then create ConfigMap and Secret to config artifact repository.

Signed-off-by: yuhui.zy [email protected]

Fixes #TODO

@zychina zychina changed the title doc change to config aliyun oss as artifact repo to enhance user experience docs: config aliyun oss as artifact repo to enhance user experience Sep 9, 2022
Comment on lines +186 to +204
```bash
$ export mybucket=bucket-workflow-artifect
$ export myregion=cn-zhangjiakou
$ # limit permission to read/write the bucket.
$ cat > policy.json <<EOF
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"oss:PutObject",
"oss:GetObject"
],
"Resource": "acs:oss:*:*:$mybucket/*"
}
]
}
EOF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be useful to have.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Comment on lines +205 to +220
$ # create bucket.
$ aliyun oss mb oss:https://$mybucket --region $myregion
$ # show endpoint of bucket.
$ aliyun oss stat oss:https://$mybucket
$ #create a ram user to access bucket.
$ aliyun ram CreateUser --UserName $mybucket-user
$ # create ram policy with the limit permission.
$ aliyun ram CreatePolicy --PolicyName $mybucket-policy --PolicyDocument "$(cat policy.json)"
$ # attch ram policy to the ram user.
$ aliyun ram AttachPolicyToUser --UserName $mybucket-user --PolicyName $mybucket-policy --PolicyType Custom
$ # create access key and secret key for the ram user.
$ aliyun ram CreateAccessKey --UserName $mybucket-user > access-key.json
$ # create secret in demo namespace, replace demo with your namespace.
$ kubectl create secret generic $mybucket-credentials -n demo\
--from-literal "accessKey=$(cat access-key.json | jq -r .AccessKey.AccessKeyId)" \
--from-literal "secretKey=$(cat access-key.json | jq -r .AccessKey.AccessKeySecret)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This felt very verbose. I think we can just link to relevant OSS documentation directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understand. Let me explain.
It includes 3 parts, 1) create oss bucket; 2) create ram user and grant oss permission. 3) kubectl to config user into argo. There is not one document link for these steps. We have relevant two aliyun product(oss and ram) and several documents, like oss bucket creation, ram user creation, grant ram user oss permission. It is difficult for aliyun user to start up artifact.
So I refer AWS S3 configuration to have some cli commands to create oss/ram user, also add two kubectl commands to config argo ConfigMap and secret. It is an end to end steps for user to follow and start up argo workflow artifact.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Sounds good.

@terrytangyuan terrytangyuan enabled auto-merge (squash) September 13, 2022 02:49
@terrytangyuan terrytangyuan merged commit 2951148 into argoproj:master Sep 13, 2022
juchaosong pushed a commit to juchaosong/argo-workflows that referenced this pull request Nov 3, 2022
…rgoproj#9551)

Signed-off-by: yuhui.zy <[email protected]>

Signed-off-by: yuhui.zy <[email protected]>
Co-authored-by: yuhui.zy <[email protected]>
Signed-off-by: juchao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants