Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azure/aks-set-context
GitHub Action for setting context (retrieving Kubeconfig) before interacting with Kubernetes cluster
https://github.com/azure/aks-set-context
actions azure deploy github-action github-actions k8s kubernetes
Last synced: about 1 month ago
JSON representation
GitHub Action for setting context (retrieving Kubeconfig) before interacting with Kubernetes cluster
- Host: GitHub
- URL: https://github.com/azure/aks-set-context
- Owner: Azure
- License: mit
- Created: 2019-09-04T06:06:41.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-30T23:33:49.000Z (about 2 months ago)
- Last Synced: 2024-10-06T18:32:59.308Z (about 1 month ago)
- Topics: actions, azure, deploy, github-action, github-actions, k8s, kubernetes
- Language: TypeScript
- Homepage:
- Size: 27.7 MB
- Stars: 47
- Watchers: 19
- Forks: 37
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Azure Kubernetes Service set context
This action can be used to set cluster context before other actions like [`azure/k8s-deploy`](https://github.com/Azure/k8s-deploy/tree/master) and [`azure/k8s-create-secret`](https://github.com/Azure/k8s-create-secret/tree/master). Any kubectl commands (in script) can also be run subsequently in the workflow.
You must run [Azure/login](https://github.com/Azure/login) before this action.
## Action inputs
Action inputs
Description
resource-group
(Required)
Resource group containing the AKS cluster
cluster-name
(Required)
Name of the AKS cluster
subscription
Subscription tied to AKS cluster
admin
Get cluster admin credentials. Values: true or false
use-kubelogin
Allows non-admin users to use the Action via kubelogin
public-fqdn
Get private cluster credential with server address to be public fqdn
## Example
### OIDC Authentication (recommended)
```yaml
- uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}- uses: azure/aks-set-context@v3
with:
resource-group: ''
cluster-name: ''
```### Service Principal Authentication
```yaml
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}- uses: azure/aks-set-context@v3
with:
resource-group: ''
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 action [azure/use-kubelogin][action_use_kubelogin]:
```yaml
- name: Set up kubelogin for non-interactive login
uses: azure/use-kubelogin@v1
with:
kubelogin-version: 'v0.0.24'
```[action_use_kubelogin]: https://github.com/marketplace/actions/setup-kubelogin
### 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.
```yaml
- uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}- uses: azure/aks-set-context@v3
with:
resource-group: ''
cluster-name: ''
admin: 'false'
use-kubelogin: 'true'
``````yaml
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}- uses: azure/aks-set-context@v3
with:
resource-group: ''
cluster-name: ''
admin: 'false'
use-kubelogin: 'true'
```## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.## Support
aks-set-context is an open source project that is [**not** covered by the Microsoft Azure support policy](https://support.microsoft.com/en-us/help/2941892/support-for-linux-and-open-source-technology-in-azure). [Please search open issues here](https://github.com/Azure/aks-set-context/issues), and if your issue isn't already represented please [open a new one](https://github.com/Azure/aks-set-context/issues/new/choose). The project maintainers will respond to the best of their abilities.