Created
August 20, 2025 08:11
-
-
Save johnybradshaw/76f61334914c8f2a81bdb3127f0d59a8 to your computer and use it in GitHub Desktop.
Useful shortcuts for Linode Object Storage, LKE, etc.
This file contains hidden or 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
| # Create Access + Secret Keys for a single bucket | |
| LINODE_BUCKET="stackable" | |
| LINODE_REGION="fr-par" | |
| linode-cli object-storage keys-create \ | |
| --label "${LINODE_BUCKET}-only" \ | |
| --bucket_access.region $LINODE_REGION \ | |
| --bucket_access.cluster "${LINODE_REGION}-1" \ | |
| --bucket_access.bucket_name $LINODE_BUCKET \ | |
| --bucket_access.permissions read_write \ | |
| --json | jq -r '.[0] | "ACCESS_KEY=\(.access_key)\nSECRET_KEY=\(.secret_key)"' | |
| # Create API Token – expires in 3 days | |
| linode-cli profile token-create \ | |
| --label "tmp-full-access" \ | |
| --scopes '*' \ | |
| --expiry "$(date -u -v+3d '+%Y-%m-%dT%H:%M:%S')" \ | |
| --json | jq -r '.[0].token' | pbcopy | |
| # Find your cluster ID | |
| linode-cli lke clusters-list --format id,label,region --no-headers | |
| # Save kubeconfig to pasteboard (replace 12345 with your cluster ID) | |
| linode-cli lke kubeconfig-view 12345 --text | sed 1d | base64 --decode | pbcopy | |
| # (Optional) Merge into your main kubeconfig and pick the new context | |
| KUBECONFIG=~/.kube/config:~/.kube/lke-12345.yaml kubectl config view --flatten > ~/.kube/tmp && mv ~/.kube/tmp ~/.kube/config | |
| kubectl config get-contexts # then kubectl config use-context <the-new-one> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment