Skip to content

Commit

Permalink
used RBAC
Browse files Browse the repository at this point in the history
  • Loading branch information
Tope Emmanuel committed Jan 30, 2024
1 parent 4f8d6ea commit c857be0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/actions/deploy_v2/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ runs:
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}

- uses: DFE-Digital/github-actions/set-arm-environment-variables@master

- uses: DFE-Digital/github-actions/set-kubelogin-environment@master
with:
azure-credentials: ${{ inputs.azure-credentials }}

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,7 @@ arm-deployment: set-azure-account set-key-vault-names
deploy-arm-resources: arm-deployment

validate-arm-resources: set-what-if arm-deployment

get-cluster-credentials: set-azure-account
az aks get-credentials --overwrite-existing -g ${CLUSTER_RESOURCE_GROUP_NAME} -n ${CLUSTER_NAME}
kubelogin convert-kubeconfig -l $(if ${GITHUB_ACTIONS},spn,azurecli)
10 changes: 10 additions & 0 deletions terraform/aks/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ provider "kubernetes" {
client_certificate = module.cluster_data.kubernetes_client_certificate
client_key = module.cluster_data.kubernetes_client_key
cluster_ca_certificate = module.cluster_data.kubernetes_cluster_ca_certificate

dynamic "exec" {
for_each = module.cluster_data.azure_RBAC_enabled ? [1] : []
content {
api_version = "client.authentication.k8s.io/v1beta1"
command = "kubelogin"
args = module.cluster_data.kubelogin_args
}
}

}

provider "statuscake" {
Expand Down

0 comments on commit c857be0

Please sign in to comment.