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

Add step for creating Exoscale API key for CSI driver during installation #347

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/modules/ROOT/pages/how-tos/exoscale/install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,40 @@ export APPCAT_ACCESSKEY=$(echo "${appcat_credentials}" | jq -r '.key')
export APPCAT_SECRETKEY=$(echo "${appcat_credentials}" | jq -r '.secret')
----

. Create restricted API key for Exoscale CSI driver
+
[source,bash]
----
# Create AppCat Provider Exoscale IAM role, if it doesn't exist yet in the organization
HappyTetrahedron marked this conversation as resolved.
Show resolved Hide resolved
csidriver_role_id=$(exo iam role list -O json | \
jq -r '.[] | select(.name=="csi-driver-exoscale") | .key')
if [ -z "${csidriver_role_id}" ]; then
echo '{
"default-service-strategy": "deny",
"services": {
"compute": {
"type": "rules",
"rules": [
{
"expression": "operation in ['list-zones', 'get-block-storage-volume', 'list-block-storage-volumes', 'create-block-storage-volume', 'delete-block-storage-volume', 'attach-block-storage-volume-to-instance', 'detach-block-storage-volume', 'update-block-storage-volume-labels', 'resize-block-storage-volume', 'get-block-storage-snapshot', 'list-block-storage-snapshots', 'create-block-storage-snapshot', 'delete-block-storage-snapshot']",
"action": "allow"
}
]
}
}
}' | \
exo iam role create csi-driver-exoscale \
--description "Exoscale CSI Driver: Access to storage operations and zone list" \
--policy -
fi
# Create access key
csi_credentials=$(exo iam api-key create -O json \
csi-driver-exoscale csi-driver-exoscale)
export CSI_ACCESSKEY=$(echo "${csi_credentials}" | jq -r '.key')
export CSI_SECRETKEY=$(echo "${csi_credentials}" | jq -r '.secret')
----


[#_bootstrap_bucket]
=== Set up S3 bucket for cluster bootstrap

Expand Down Expand Up @@ -186,6 +220,11 @@ vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/cluster-backup \
vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/appcat/provider-exoscale \
access-key=${APPCAT_ACCESSKEY} \
secret-key=${APPCAT_SECRETKEY}

# Set the CSI Driver Exoscale Credentials
vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/exoscale/csi_driver \
s3_access_key=${CSI_ACCESSKEY} \
s3_secret_key=${CSI_SECRETKEY}
----

include::partial$get-hieradata-token-from-vault.adoc[]
Expand Down