I have a private keyvault which has a certifice I need to get from an aks cluster. I have this code to do this:
data "azurerm_user_assigned_identity" "ids" {
name = "${var.organization}-integratiehub-${var.environment}-integratiehub-mi"
resource_group_name = var.resource_group_name
}
resource "helm_release" "ingress-nginx" {
name = "ingress-nginx"
namespace = "ingress"
repository = "https://kubernetes.github.io/ingress-nginx"
chart = "ingress-nginx"
version = "4.10.1"
create_namespace = true
values = [
"${templatefile("${path.module}/values/nginx-values.yaml",
{
private_ip = var.aks_loadbalancer_ip,
cert_certmanager_secret = var.cert_certmanager_secret
client_id = data.azurerm_user_assigned_identity.ids.client_id
})}" ]
set {
name = "controller.config.compute-full-forwarded-for"
value = "true" }
set {
name = "controller.config.enable-real-ip"
value = "true" }
}
The managed identity has key vault certificates user and officer rights (AAD) on the keyvault. The key vault has Allow trusted Microsoft services to bypass this firewall
set. The aks subnet has a service endpoint for keyvault.
When the certificates is accessed, I get this error:
│ RESPONSE 403: 403 Forbidden │
│ ERROR CODE: Forbidden │
│ -------------------------------------------------------------------------------- │
│ { │
│ "error": { │
│ "code": "Forbidden", │
│ "message": "Connection is not an approved private link and caller was ignored because bypass is not set to 'AzureServices' and PublicNetworkAccess is set to │
│ 'Disabled'. rnVault: ***-inthub-main-test;location=westeurope", │
│ "innererror": { │
│ "code": "ForbiddenByConnection" │
│ } │
│ }
| }