changed action for arc cluster to use az connectedk8s proxy

This commit is contained in:
Atharva Mulmuley
2021-04-27 16:56:18 +05:30
parent e5a2133107
commit 23202c929e
760 changed files with 85163 additions and 107 deletions

View File

@ -6,6 +6,7 @@ There are two approaches for specifying the deployment target:
- Kubeconfig file provided as input to the action
- Service account approach where the secret associated with the service account is provided as input to the action
- Service principal approach(only applicable for arc cluster) where service principal provided with 'creds' is used as input to action
If inputs related to both these approaches are provided, kubeconfig approach related inputs are given precedence.
@ -22,7 +23,7 @@ In both these approaches it is recommended to store these contents (kubeconfig f
</thead>
<tr>
<td><code>method</code><br/>Method</td>
<td>(Optional) Acceptable values: kubeconfig/service-account. Default value: kubeconfig</td>
<td>(Optional) Acceptable values: kubeconfig/service-account/spn. Default value: kubeconfig</td>
</tr>
<tr>
<td><code>kubeconfig</code><br/>Kubectl config</td>
@ -40,6 +41,26 @@ In both these approaches it is recommended to store these contents (kubeconfig f
<td><code>k8s-secret</code><br/>Secret</td>
<td>(Relevant for service account approach) Secret associated with the service account to be used for deployments</td>
</tr>
<tr>
<td><code>cluster-type</code><br/>Type of cluster</td>
<td>Type of cluster. Acceptable values: generic/arc</td>
</tr>
<tr>
<td><code>creds</code><br/>Service principal credentials for az login</td>
<td>Provide json output of 'az ad sp create-for-rbac --sdk-auth' command</td>
</tr>
<tr>
<td><code>cluster-name</code><br/>Name of arc cluster</td>
<td>Provide name of arc cluster.Applicable for cluster-type of 'arc'.</td>
</tr>
<tr>
<td><code>resource-group</code><br/>resource group</td>
<td>Provide name of resource group that contains the arc cluster.Applicable for cluster-type of 'arc'.</td>
</tr>
<tr>
<td><code>token</code><br/>Service account token</td>
<td>Applicable for 'service-account' method.</td>
</tr>
</table>
## Example usage
@ -101,6 +122,33 @@ kubectl get serviceAccounts <service-account-name> -n <namespace> -o 'jsonpath={
kubectl get secret <service-account-secret-name> -n <namespace> -o yaml
```
### Service account approach for arc cluster
```yaml
- uses: azure/k8s-set-context@v1
with:
method: service-account
cluster-type: 'arc'
creds: '${{ secrets.AZURE_CREDS }}'
cluster-name: <cluster-name>
resource-group: <resource-group>
token: '${{ secrets.SA_TOKEN }}'
id: setcontext
```
### Service principal approach for arc cluster
```yaml
- uses: azure/k8s-set-context@v1
with:
method: spn
cluster-type: 'arc'
creds: '${{ secrets.AZURE_CREDS }}'
cluster-name: <cluster-name>
resource-group: <resource-group>
id: setcontext
```
## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
@ -113,4 +161,4 @@ provided by the bot. You will only need to do this once across all repos using o
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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.