8000 🌐Deploying external-DNS݁ by lamtnguyen989 · Pull Request #230 · acm-uic/IaC · GitHub
[go: up one dir, main page]

Skip to content

🌐Deploying external-DNS݁ - #230

Merged
clee231 merged 7 commits into
mainfrom
umapyoi-eDNS
Dec 1, 2026
Merged

clee231 merged 7 commits into
mainfrom
umapyoi-eDNS

Conversation

@lamtnguyen989
@lamtnguyen989 lamtnguyen989 commented Nov 12, 2026 •
Copy link
Copy Markdown
Member

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 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 include the commands.

The initial rollout uses zero controller replicas pending the cluster signing-key maintenance and activation of the Azure federated credential.

@clee231
clee231 commented Nov 25, 2026
Copy link
Copy Markdown
Contributor

This requires #234 to be merged before this can be merged.

@clee231
clee231 changed the base branch from main to feature/workload-identity November 25, 2026 21:09
@clee231
clee231 added this pull request to stack #236 November 25, 2026 21:09
@clee231 clee231 linked an issue Nov 25, 2026 that may be closed by this pull request
Base automatically changed from feature/workload-identity to main December 1, 2026 06:52
clee231 added a commit that referenced this pull request Dec 1, 2026
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:

- Adds a new ArgoCD `Application` (`azure-workload-identity-webhook`) to
deploy the Azure Workload Identity webhook via Helm, including resource
constraints and automated sync policies.
- Creates the required `Namespace` (`azure-workload-identity-system`)
for the webhook deployment.

# OIDC Discovery Service:

- Adds a new ArgoCD `Application` (`workload-identity-oidc`) to deploy
OIDC discovery resources from the repository, with automated sync and
server-side apply enabled.
- Defines all Kubernetes resources needed to serve OIDC discovery
documents:
- Namespace, ServiceAccount, RBAC (ClusterRole/Binding) for publishing
discovery docs.
- NGINX Deployment (with initContainer to fetch discovery docs),
Service, ConfigMap for NGINX config.
- Shared Cilium Ingress behind the Umapyoi public tunnel for HTTPS at
`k8s-oidc.umapyoi.acmuic.org`, using a cert-manager TLS secret.

## Umapyoi public DNS

Terraform creates `umapyoi.acmuic.org`, delegates it from `acmuic.org`,
and publishes A and AAAA aliases for `tunnel.umapyoi.acmuic.org` against
the existing Azure gateway public IP resources. It points the `k8s-oidc`
CNAME 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:externaldns` from this issuer. It
has Reader on `acm-general` for 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](#230).


The FRP client cutover is tracked in
[#239](#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.

---------

Co-authored-by: Lam Nguyen <lamtnguyen989@gmail.com>
@github-actions
github-actions Bot commented Dec 1, 2026 •
Copy link
Copy Markdown

Terraform plan in azure/terraform/stacks/acm-general in the prod workspace
With var files: azure/terraform/stacks/acm-general/configuration/prod.tfvars

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"
+           "owner"   = "clee231@acmuic.org"
+           "project" = "umapyoi"
        }
+       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"
+           "owner"   = "clee231@acmuic.org"
+           "project" = "umapyoi"
        }
+       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"
+           "owner"   = "clee231@acmuic.org"
+           "project" = "umapyoi"
        }
+       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"
+           "owner"   = "clee231@acmuic.org"
+           "project" = "umapyoi"
        }
+       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"
+           "owner"   = "clee231@acmuic.org"
+           "project" = "umapyoi"
        }

+       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"
+           "owner"   = "clee231@acmuic.org"
+           "project" = "umapyoi"
        }
+       tenant_id           = (known after apply)
    }

Plan: 8 to add, 0 to change, 0 to destroy.

Changes to Outputs:
+   umapyoi_externaldns_client_id      = (known after apply)

✅ Plan applied in Terraform Apply on Azure #69

Outputs
azurerm_dns_zone_acm_uic           = {
    id                        = "/subscriptions/2f98793b-7e2f-4f03-ac5b-7b2ec934dcd7/resourceGroups/acm-general/providers/Microsoft.Network/dnsZones/acmuic.org"
    max_number_of_record_sets = 10000
    name                      = "acmuic.org"
    name_servers              = [
        "ns1-06.azure-dns.com.",
        "ns2-06.azure-dns.net.",
        "ns3-06.azure-dns.org.",
        "ns4-06.azure-dns.info.",
    ]
    number_of_record_sets     = 85
    resource_group_name       = "acm-general"
    tags                      = {}
    timeouts                  = null
}
default_resource_group             = "acm-general"
externaldns_sp_clientid            = "f995b4bc-00a0-4912-9a1a-da9f74407cb8"
externaldns_sp_keyid               = "4851f036-2284-446d-80b5-cd53d66bdb54"
externaldns_sp_password            = (sensitive value)
pfsense_service_principal_id       = "/servicePrincipals/732cd17c-42d8-4463-be7f-ca627b6eee87"
pfsense_service_principal_password = (sensitive value)
subscription_id                    = "2f98793b-7e2f-4f03-ac5b-7b2ec934dcd7"
tenant_id                          = "cad5e02f-bae4-42d6-a06e-4377dd3e386f"
umapyoi_externaldns_client_id      = "6af90cb0-e759-4346-a799-f5fdadffc9d8"

@github-actions
github-actions Bot commented Dec 1, 2026 •
Copy link
Copy Markdown

Terraform plan in azure/terraform/stacks/sysadmin-demo in the prod workspace
With var files: azure/terraform/stacks/sysadmin-demo/configuration/prod.tfvars

No changes. Your infrastructure matches the configuration.
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

✅ Plan applied in Terraform Apply on Azure #69

@clee231
clee231 merged commit 4195a1c into main Dec 1, 2026
3 checks passed
@clee231
clee231 deleted the umapyoi-eDNS branch December 1, 2026 07:07
clee231 added a commit that referenced this pull request Dec 1, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Umapyoi checklist

2 participants

0