diff --git a/.gitignore b/.gitignore index 3f764fc511..3bb2086582 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,5 @@ terraform.tfstate* id_rsa* kube.conf out.env -infra/**/kustomization.yaml -infra/**/workload-identity.yaml +infra/**/peer-pods-config.yaml uplosi.conf* diff --git a/cli/genpolicy/config.go b/cli/genpolicy/config.go index 19a5c07611..b61a717f20 100644 --- a/cli/genpolicy/config.go +++ b/cli/genpolicy/config.go @@ -43,7 +43,7 @@ func NewConfig(platform platforms.Platform) *Config { Settings: aksSettings, Bin: aksGenpolicyBin, } - case platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX: + case platforms.AKSPeerSNP, platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX: return &Config{ Rules: kataRules, Settings: kataSettings, diff --git a/cli/main.go b/cli/main.go index 54e3889e13..9bc6e1589e 100644 --- a/cli/main.go +++ b/cli/main.go @@ -105,7 +105,7 @@ func buildVersionString() (string, error) { switch platform { case platforms.AKSCloudHypervisorSNP: fmt.Fprintf(versionsWriter, "\tgenpolicy version:\t%s\n", constants.MicrosoftGenpolicyVersion) - case platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX: + case platforms.AKSPeerSNP, platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX: fmt.Fprintf(versionsWriter, "\tgenpolicy version:\t%s\n", constants.KataGenpolicyVersion) } } diff --git a/infra/azure-peerpods/main.tf b/infra/azure-peerpods/main.tf index cafda48249..e85106c78e 100644 --- a/infra/azure-peerpods/main.tf +++ b/infra/azure-peerpods/main.tf @@ -69,14 +69,6 @@ resource "azurerm_role_assignment" "ra_network_contributor" { principal_id = azuread_service_principal.sp.object_id } -resource "azuread_application_federated_identity_credential" "federated_credentials" { - display_name = local.name - application_id = azuread_application.app.id - issuer = azurerm_kubernetes_cluster.cluster.oidc_issuer_url - subject = "system:serviceaccount:confidential-containers-system:cloud-api-adaptor" - audiences = ["api://AzureADTokenExchange"] -} - resource "azuread_application_password" "cred" { application_id = azuread_application.app.id } @@ -128,65 +120,45 @@ resource "local_file" "kubeconfig" { content = azurerm_kubernetes_cluster.cluster.kube_config_raw } -resource "local_file" "workload_identity" { - filename = "./workload-identity.yaml" +data "local_file" "id_rsa" { + filename = "id_rsa.pub" +} + +resource "local_file" "peer-pods-config" { + filename = "./peer-pods-config.yaml" file_permission = "0777" content = <