https://pulumi.com logo
#general
Title
# general
f

fast-ice-1848

05/30/2020, 9:25 AM
hi folks, i tried to deploy AKS cluster on Azure Gov and got this error
Addon 'azurepolicy' is not supported in this cloud environment.
It comes from terraform azure provider, doesn't it? Is there any solution or work around available? Thanks
w

white-balloon-205

05/30/2020, 2:41 PM
I believe a workaround is to find one addon that is supported in Azure Gov, but that you don’t need - and configure the addons to provide just that one with
enabled: false
. That will override the defaults and avoid trying to configure addons that aren’t supported in the environment you are targeting. The defaults here ultimately should be fixed in the upstream provider though as you say.
f

fast-ice-1848

05/30/2020, 3:42 PM
yes, i tried to disable azure policy since i don't really need it. But somehow i got the error below
Copy code
aks = KubernetesCluster(
    "aksCluster",
    resource_group_name=resource_group.name,
    kubernetes_version="1.18.1",
    dns_prefix="dns",
    linux_profile={"adminUsername": "aksuser", "ssh_key": {"keyData": SSHKEY}},
    service_principal={"client_id": app.application_id, "client_secret": sppwd.value},
    default_node_pool={
        "name": "type1",
        "node_count": 2,
        "vm_size": "Standard_B2ms",
    },
    addon_profiles={
        "azurePolicy" : {
            "enabled" : False
        }
    },
Copy code
File "./__main__.py", line 50, in <module>
        "enabled" : False
    TypeError: __init__() got an unexpected keyword argument 'addon_profiles'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
w

white-balloon-205

05/30/2020, 4:49 PM
f

fast-ice-1848

05/30/2020, 5:07 PM
😅thank you so much, Luke. Remove
s
and it worked like charm
Oops! It doesn't disable azurePolicy as expected and the aks provisioning still failed. Do you have any idea about how to correctly disable it?
g

gentle-diamond-70147

06/01/2020, 3:48 PM
@fast-ice-1848 can you try with
"azurepolicy"
as the addon name?