How to access AKS clusters generated by pltf.
Kubeconfig
- Fetch outputs:
Note
k8s_cluster_name,k8s_endpoint, andk8s_ca_data(output names may be prefixed if there are duplicates). - Authenticate and update kubeconfig:
Use the subscription from
az login az aks get-credentials \ --name <cluster> \ --resource-group pltf-<env> \ --subscription <subscription-id>environments.<env>.account.
Generated Terraform already configures Kubernetes and Helm providers using these outputs when you run pltf terraform plan/apply.
Azure RBAC and Kubernetes RBAC
AKS uses Azure RBAC + Kubernetes RBAC. Assign access through AAD groups and Kubernetes bindings.
Example cluster role binding:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: platform-admins
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: Group
name: "<aad-group-object-id>"
apiGroup: rbac.authorization.k8s.io
Summary
- Use
az aks get-credentialsto access the cluster. - Manage access with AAD groups and Kubernetes RBAC bindings.