Skip to content

Commit

Permalink
Merge pull request #10 from ivan-cai/ackone-config
Browse files Browse the repository at this point in the history
support  getting ackone kubeconfig
  • Loading branch information
ivan-cai authored Sep 6, 2023
2 parents d2631e5 + e2d75ff commit 6616253
Show file tree
Hide file tree
Showing 4 changed files with 497 additions and 402 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# Setting context for Kubernetes cluster of Alibaba Cloud Kubernetes Service (ACK)
Use this GitHub Action to [set context for Kubernetes cluster of Alibaba Cloud Kubernetes (ACK)](https://www.aliyun.com/product/kubernetes).
Use this GitHub Action to [set context for Kubernetes cluster of Alibaba Cloud Kubernetes (ACK)](https://www.aliyun.com/product/kubernetes) or [set context for cluster of Alibaba Distributed Cloud Container Platform for Kubernetes (ACK One)](https://www.aliyun.com/product/aliware/adcp).


Set the ```KUBECONFIG``` environment variable by cluster id for K8s cluster managed by ACK.
Set the ```KUBECONFIG``` environment variable by cluster id for K8s cluster managed by ACK or for ACK One hub cluster.


```yaml
- uses: aliyun/ack-set-context@v1
with:
access-key-id: '<access key id>'
access-key-secret: '<access key secret>'
## optional, supports 'ACK' or 'One', default is 'ACK'
cluster-type: '<cluster type>'
## if cluster-type is 'One', please filling up ACK One Fleet cluster id
cluster-id: '<cluster id>'
```
Refer to the action metadata file for details about all the inputs: [action.yml](https://github.com/aliyun/ack-set-context/blob/master/action.yml)
### Prerequisite
Get the access-key-id and access-key-secret of Alibaba Cloud and add them as as [secrets](https://developer.github.com/actions/managing-workflows/storing-secrets/) in the GitHub repository.
1. Get the access-key-id and access-key-secret of Alibaba Cloud and add them as [secrets](https://developer.github.com/actions/managing-workflows/storing-secrets/) in the GitHub repository.
2. Please keep permissions of AKSK to be minimized. If cluster-type is 'One', you can refer to [Grant permissions to a RAM user](https://www.alibabacloud.com/help/en/ack/distributed-cloud-container-platform-for-kubernetes/user-guide/grant-permissions-to-a-ram-user-1?spm=a2c63.p38356.0.0.60f81fd4if2ccM) to configure AliyunAdcpReadOnlyAccess RAM permissions and RBAC role including admin or dev.
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: 'Setting context for Kubernetes cluster of Alibaba Cloud Kubernetes Service (ACK)'
description: 'Setting context for Kubernetes cluster of Alibaba Cloud Kubernetes Service (ACK)'
inputs:
inputs:
cluster-type:
description: 'Cluster type. "ACK" or "One"'
required: false
access-key-id:
description: 'Access key id for Alibaba Cloud'
required: true
Expand Down
Loading

0 comments on commit 6616253

Please sign in to comment.