Repository navigation
🌐 Adding Azure Workload Identity webhook and OIDC setup - #234
Conversation
ae15934 to
8e82c57
Compare
|
Change for the failed kube-linter's |
|
Terraform plan in azure/terraform/stacks/acm-general in the prod workspace Plan: 8 to add, 0 to change, 0 to destroy. Changes to Outputs.Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# azurerm_dns_a_record.umapyoi_tunnel will be created
+ resource "azurerm_dns_a_record" "umapyoi_tunnel" {
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "tunnel"
+ resource_group_name = "acm-general"
+ tags = {
+ "SIG" = "SIGSysAdmin"
}
+ target_resource_id = "************************************************************************************************************************************************"
+ ttl = 300
+ zone_name = "umapyoi.acmuic.org"
}
# azurerm_dns_aaaa_record.umapyoi_tunnel will be created
+ resource "azurerm_dns_aaaa_record" "umapyoi_tunnel" {
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "tunnel"
+ resource_group_name = "acm-general"
+ tags = {
+ "SIG" = "SIGSysAdmin"
}
+ target_resource_id = "************************************************************************************************************************************************"
+ ttl = 300
+ zone_name = "umapyoi.acmuic.org"
}
# azurerm_dns_cname_record.umapyoi_oidc will be created
+ resource "azurerm_dns_cname_record" "umapyoi_oidc" {
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "k8s-oidc"
+ record = "tunnel.umapyoi.acmuic.org"
+ resource_group_name = "acm-general"
+ tags = {
+ "SIG" = "SIGSysAdmin"
}
+ ttl = 300
+ zone_name = "umapyoi.acmuic.org"
}
# azurerm_dns_ns_record.umapyoi will be created
+ resource "azurerm_dns_ns_record" "umapyoi" {
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "umapyoi"
+ records = (known after apply)
+ resource_group_name = "acm-general"
+ tags = {
+ "SIG" = "SIGSysAdmin"
}
+ ttl = 300
+ zone_name = "acmuic.org"
}
# azurerm_dns_zone.umapyoi will be created
+ resource "azurerm_dns_zone" "umapyoi" {
+ id = (known after apply)
+ max_number_of_record_sets = (known after apply)
+ name = "umapyoi.acmuic.org"
+ name_servers = (known after apply)
+ number_of_record_sets = (known after apply)
+ resource_group_name = "acm-general"
+ tags = {
+ "SIG" = "SIGSysAdmin"
}
+ soa_record (known after apply)
}
# azurerm_role_assignment.umapyoi_externaldns_contributor will be created
+ resource "azurerm_role_assignment" "umapyoi_externaldns_contributor" {
+ id = (known after apply)
+ name = (known after apply)
+ principal_id = (known after apply)
+ principal_type = "ServicePrincipal"
+ role_definition_id = (known after apply)
+ role_definition_name = "DNS Zone Contributor"
+ scope = (known after apply)
+ skip_service_principal_aad_check = (known after apply)
}
# azurerm_role_assignment.umapyoi_externaldns_reader will be created
+ resource "azurerm_role_assignment" "umapyoi_externaldns_reader" {
+ id = (known after apply)
+ name = (known after apply)
+ principal_id = (known after apply)
+ principal_type = "ServicePrincipal"
+ role_definition_id = (known after apply)
+ role_definition_name = "Reader"
+ scope = "/subscriptions/2f98793b-7e2f-4f03-ac5b-7b2ec934dcd7/resourceGroups/acm-general"
+ skip_service_principal_aad_check = (known after apply)
}
# azurerm_user_assigned_identity.umapyoi_externaldns will be created
+ resource "azurerm_user_assigned_identity" "umapyoi_externaldns" {
+ client_id = (known after apply)
+ id = (known after apply)
+ location = "northcentralus"
+ name = "umapyoi-externaldns"
+ principal_id = (known after apply)
+ resource_group_name = "acm-general"
+ tags = {
+ "SIG" = "SIGSysAdmin"
}
+ tenant_id = (known after apply)
}
Plan: 8 to add, 0 to change, 0 to destroy.
Changes to Outputs:
!~ azurerm_dns_zone_acm_uic = {
id = "/subscriptions/2f98793b-7e2f-4f03-ac5b-7b2ec934dcd7/resourceGroups/acm-general/providers/Microsoft.Network/dnsZones/acmuic.org"
name = "acmuic.org"
!~ number_of_record_sets = 83 -> 85
tags = {}
# (4 unchanged attributes hidden)
}
+ umapyoi_externaldns_client_id = (known after apply)❌ Error applying plan in Terraform Apply on Azure #68 |
|
Terraform plan in azure/terraform/stacks/sysadmin-demo in the prod workspace No changes. Your infrastructure matches the configuration.✅ Plan applied in Terraform Apply on Azure #68 |
Scaffold the deployment of `external-dns` The Umapyoi controller creates and updates records in `umapyoi.acmuic.org` with a cluster-specific TXT owner ID. Terraform owns the OIDC issuer record and the A/AAAA records for `tunnel.umapyoi.acmuic.org`. Both names are excluded from reconciliation. The Azure ConfigMap is in the controller's `external-dns` namespace. Merge and apply [#234](#234) first. Before the first Argo CD sync, verify the public issuer and bind the `externaldns` service account to the new managed identity's Azure-assigned client ID. The [rollout instructions](https://github.com/acm-uic/IaC/blob/umapyoi-eDNS/kubernetes/argocd/umapyoi/external-dns/README.md) include the commands. The initial rollout uses zero controller replicas pending the cluster signing-key maintenance and activation of the Azure federated credential. --------- Co-authored-by: Chase 李 <chase@acm.cs.uic.edu>
Move the Umapyoi FRP client to `tunnel.umapyoi.acmuic.org`. The client uses this name for both its control connection and the TLS server name. The gateway VM and public addresses stay in service throughout the rename. ## Before merging - Apply #234 and confirm the new A and AAAA records resolve to the gateway's existing addresses. #230 reserves this name in ExternalDNS and updates the application CNAME example. - The live TCP 7000 listener now presents the rotated certificate for both hostnames. The existing client token was preserved and both FRP proxies reconnected using the overlapping trust bundle. Merging triggers the Argo CD client rollout with the final CA bundle. The Cilium chart explicitly configures ADS for the agent and Envoy, and the OIDC Ingress allows HTTP-01 challenges to reach cert-manager. Keep the old DNS records until both FRP proxies reconnect, public application traffic passes, and other consumers have migrated. The [cutover and rollback instructions](https://github.com/acm-uic/IaC/blob/codex/umapyoi-tunnel-hostname/azure/terraform/stacks/frp-gateway/OPERATIONS.md#move-the-tunnel-hostname) include the final parent-zone cleanup. ## Verification Kustomize and KubeLinter passed for the client. The isolated FRP 0.72.0 smoke test passed with the new tunnel hostname for IPv4 and IPv6 HTTP/HTTPS and after client and server restarts. OpenTofu formatting and validation passed for the gateway stack.
This pull request introduces Kubernetes manifests to support Azure Workload Identity and OIDC discovery within the Umapyoi infrastructure. The changes add ArgoCD applications for managing these components and define all necessary resources for securely serving OIDC discovery documents in the cluster.
Azure Workload Identity Integration:
Application(azure-workload-identity-webhook) to deploy the Azure Workload Identity webhook via Helm, including resource constraints and automated sync policies.Namespace(azure-workload-identity-system) for the webhook deployment.OIDC Discovery Service:
Application(workload-identity-oidc) to deploy OIDC discovery resources from the repository, with automated sync and server-side apply enabled.k8s-oidc.umapyoi.acmuic.org, using a cert-manager TLS secret.Umapyoi public DNS
Terraform creates
umapyoi.acmuic.org, delegates it fromacmuic.org, and publishes A and AAAA aliases fortunnel.umapyoi.acmuic.orgagainst the existing Azure gateway public IP resources. It points thek8s-oidcCNAME at that hostname so Entra can reach discovery before ExternalDNS starts. The ACM app cluster's ExternalDNS configuration excludes this delegated zone.When federation is enabled, the dedicated managed identity trusts
system:serviceaccount:external-dns:externaldnsfrom this issuer. It has Reader onacm-generalfor zone discovery and DNS Zone Contributor on the child zone. Apply this PR and configure the API server issuer, public JWKS URI, before deploying #230.The FRP client cutover is tracked in #239. Apply the DNS additions here before switching the client.
The initial rollout stages the overlapping FRP trust roots and uses a namespaced ACME Issuer for discovery HTTPS. Azure token exchange is disabled pending the cluster signing-key maintenance.