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

refactor(publick8s,privatek8s) define infraciadmin SA with a terraform module #448

Merged
merged 1 commit into from
Aug 9, 2023
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
16 changes: 16 additions & 0 deletions privatek8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@ output "privatek8s_public_ip_address" {
value = azurerm_public_ip.public_privatek8s.ip_address
}

# Configure the jenkins-infra/kubernetes-management admin service account
module "privatek8s_admin_sa" {
providers = {
kubernetes = kubernetes.privatek8s
}
source = "./.shared-tools/terraform/modules/kubernetes-admin-sa"
cluster_name = azurerm_kubernetes_cluster.privatek8s.name
cluster_hostname = azurerm_kubernetes_cluster.privatek8s.kube_config.0.host
cluster_ca_certificate_b64 = azurerm_kubernetes_cluster.privatek8s.kube_config.0.cluster_ca_certificate
}

output "kubeconfig_privatek8s" {
sensitive = true
value = module.privatek8s_admin_sa.kubeconfig
}

output "privatek8s_kube_config_command" {
value = "az aks get-credentials --name ${azurerm_kubernetes_cluster.privatek8s.name} --resource-group ${azurerm_kubernetes_cluster.privatek8s.resource_group_name}"
}
16 changes: 16 additions & 0 deletions publick8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ output "ldap_jenkins_io_ipv4_address" {
value = azurerm_public_ip.ldap_jenkins_io_ipv4.ip_address
}

# Configure the jenkins-infra/kubernetes-management admin service account
module "publick8s_admin_sa" {
providers = {
kubernetes = kubernetes.publick8s
}
source = "./.shared-tools/terraform/modules/kubernetes-admin-sa"
cluster_name = azurerm_kubernetes_cluster.publick8s.name
cluster_hostname = azurerm_kubernetes_cluster.publick8s.kube_config.0.host
cluster_ca_certificate_b64 = azurerm_kubernetes_cluster.publick8s.kube_config.0.cluster_ca_certificate
}

output "kubeconfig_publick8s" {
sensitive = true
value = module.publick8s_admin_sa.kubeconfig
}

output "publick8s_kube_config_command" {
value = "az aks get-credentials --name ${azurerm_kubernetes_cluster.publick8s.name} --resource-group ${azurerm_kubernetes_cluster.publick8s.resource_group_name}"
}