Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RBAC to project #1355

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ bin/terrafile: ## Install terrafile to manage terraform modules
bin/yaq:
mkdir -p bin | curl -sL https://github.com/uk-devops/yaq/releases/download/v0.0.3/yaq_linux_amd64_v0.0.3.zip -o yaq.zip && unzip -o yaq.zip -d ./bin/ && rm yaq.zip

development_aks:
development_aks: test-cluster
$(eval include global_config/development_aks.sh)

test_aks:
test_aks: test-cluster
$(eval include global_config/test_aks.sh)

production_aks:
production_aks: production-cluster
$(eval include global_config/production_aks.sh)

local_aks:
Expand Down Expand Up @@ -103,3 +103,15 @@ arm-deployment: set-azure-account set-key-vault-names
deploy-arm-resources: arm-deployment

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

test-cluster:
$(eval CLUSTER_RESOURCE_GROUP_NAME=s189t01-tsc-ts-rg)
$(eval CLUSTER_NAME=s189t01-tsc-test-aks)

production-cluster:
$(eval CLUSTER_RESOURCE_GROUP_NAME=s189p01-tsc-pd-rg)
$(eval CLUSTER_NAME=s189p01-tsc-production-aks)

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)
107 changes: 107 additions & 0 deletions terraform/aks/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
Loading