Update README with kubelogin clarity fixes (#72)

This commit is contained in:
Oliver King 2022-06-21 10:26:59 -04:00 коммит произвёл GitHub
Родитель e95c4b242b
Коммит b6860aeae4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 11 добавлений и 29 удалений

Просмотреть файл

@ -66,43 +66,24 @@ You must run [Azure/login](https://github.com/Azure/login) before this action.
cluster-name: "<cluster name>"
```
### Kubelogin
`kubelogin` is at the core of the non-admin user scenario. For more information on `kubelogin`, refer to the documentation [here](https://github.com/Azure/kubelogin).
To run this Action as a non-admin user, you must first install `kubelogin`. To set up `kubelogin`, you may use the following:
```yaml
- name: Set up kubelogin for non-interactive login
run: |
curl -LO https://github.com/Azure/kubelogin/releases/download/v0.0.9/kubelogin-linux-amd64.zip
sudo unzip -j kubelogin-linux-amd64.zip -d /usr/local/bin
rm -f kubelogin-linux-amd64.zip
kubelogin --version
```
### Non-Admin User Example
If you are executing this Action as a non-admin user, you need to toggle the optional `use-kubelogin` Action input to `true` for it to work.
If you are executing this Action as a non-admin user, you need to toggle the optional `use-kubelogin` Action input to `true` for it to work. To run this Action as a non-admin user, you must also install `kubelogin` before running this action.
```yaml
- uses: azure/login@v1
- uses: azure/login@v1 # you can also use the Service Principal with secrets strategy
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- uses: azure/aks-set-context@v2
with:
resource-group: "<resource group name>"
cluster-name: "<cluster name>"
admin: "false"
use-kubelogin: "true"
```
```yaml
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Set up kubelogin
run: |
curl -LO https://github.com/Azure/kubelogin/releases/download/v0.0.9/kubelogin-linux-amd64.zip
sudo unzip -j kubelogin-linux-amd64.zip -d /usr/local/bin
rm -f kubelogin-linux-amd64.zip
kubelogin --version
- uses: azure/aks-set-context@v2
with:
resource-group: "<resource group name>"
@ -111,6 +92,7 @@ If you are executing this Action as a non-admin user, you need to toggle the opt
use-kubelogin: "true"
```
`kubelogin` is at the core of the non-admin user scenario. For more information on `kubelogin`, refer to the documentation [here](https://github.com/Azure/kubelogin).
## Contributing