https://pulumi.com logo
#azure
Title
# azure
s

some-elephant-30417

03/13/2021, 11:21 AM
Hi! I am trying to deploy AKS and use the kubeconfig output to provision the cluster with
pulumi-kubernetes
. However I get the value:
{}
, from the
kube_config_raw
and
kube_config_admin_raw
outputs. Any idea what am I doing wrong? Thank you!
Copy code
from pulumi_azure.containerservice import Registry, KubernetesCluster

...

        cluster = KubernetesCluster(
            f'aks-{args.resource_suffix}',
            name=f'aks-{args.resource_suffix}',
            location=args.resource_group.location,
            resource_group_name=args.resource_group.name,
            kubernetes_version='1.19.6',
            dns_prefix='dns',
            role_based_access_control={'enabled': 'true'},
            linux_profile=(
                {
                    'adminUsername': args.cluster_profile_admin_username,
                    'ssh_key': {
                        'keyData': args.cluster_profile_admin_ssh_key
                    }
                }
            ),
            service_principal=(
                {
                    'clientId': args.application.application_id,
                    'clientSecret': args.service_principal_password,
                }
            ),
            default_node_pool=(
                {
                    'name': 'default',
                    'node_count': 2,
                    'vm_size': 'Standard_D2s_v3',
                    'max_pods': 30,
                    'vnet_subnet_id': subnet.id,
                }
            ),
            network_profile=(
                {
                    'networkPlugin': 'azure',
                    'serviceCidr': '10.10.0.0/16',
                    'dns_service_ip': '10.10.0.10',
                    'dockerBridgeCidr': '172.17.0.1/16'
                }
            ),
            tags=args.tags,
            opts=ResourceOptions.merge(
                child_opts,
                ResourceOptions(depends_on=[container_registry_assignment, subnet_assignment])
            ),
        )

        self.cluster_name = cluster.name
        self.cluster_network_profile = cluster.network_profile
        self.kubeconfig = cluster.kube_admin_config_raw
        self.register_outputs({})
ok. I found it. Should have thought better on the async:
Copy code
self.cluster_name = cluster.name.apply(lambda x: x)
        self.cluster_network_profile = cluster.network_profile.apply(lambda x: x)
        self.kubeconfig = cluster.kube_config_raw.apply(lambda x: x)
3 Views