Azure / Azure/bicep-extensibility
[Experimental] Can't use the Kubernetes Provider with RBAC/Managed Identity
- Dominant language
- C#
- Stars
- 19
- Forks
- 15
- Avg merge
- 3h 11m
- Merged PRs (30d)
- 20
Description
When on a AKS cluster the Local Accounts are _disabled_ and we can't use SSH Keys the Bicep Kubernetes Provider can't be used. Would like to use the provider with RBAC enabled and Managed Identity.
What I tried:
**Create AKS Cluster without local accounts**
```bicep
resource cluster 'Microsoft.ContainerService/managedClusters@2022-11-01' = {
name: clusterName
properties: {
disableLocalAccounts: true
// linuxProfile: null
}
```
**Use listClusterAdminCredential() to generate kubeConfig.**
```bicep
module clusterRoleBinding './modules/cluster-role-binding.bicep' = {
name: 'clusterRoleBinding'
params: {
kubeConfig: cluster.listClusterAdminCredential().kubeconfigs[0].value
}
}
```
**Use kubeConfig**
```bicep
@secure()
param kubeConfig string
import 'kubernetes@1.0.0' with {
namespace: 'default'
kubeConfig: kubeConfig
} as k8s
```
When deploying this, the following error occurs:
`Getting static credential is not allowed because this cluster is set to disable local accounts.`
Would like to see the provider works without local account and SSH Keys.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.