https://pulumi.com logo
Title
h

handsome-state-59775

05/19/2021, 2:35 PM
As part of setting up an AKS cluster, I create a system node pool and one or more user node pools - with the system node pools to be reserved for system pods via a taint. For whatever reason, the first stack I brought up did not apply the taint to the system node pool (maybe I had a bug in there at the time), but every new stack gets it. Now that the taint is being applied properly, I expect it to be applied to the first stack when I do a
pulumi up -r --skip-preview -y
on it as an update - however, this is not the case. Code in thread; any insights?
def prepare_node_pool_profiles(
        node_pools: Mapping[str, List[Mapping[str, str]]],
) -> List[cs.ManagedClusterAgentPoolProfileArgs]:
    """Prepares a list of node pool profiles from configuration."""
    node_pool_profiles: List[cs.ManagedClusterAgentPoolProfileArgs] = []

    for pool_mode in cs.AgentPoolMode:
        pool_type = pool_mode.lower()
        node_pools_type = node_pools.get(pool_type)
        if not node_pools_type:
            continue

        mode = cs.AgentPoolMode(pool_mode)
        node_taints = [
            'CriticalAddonsOnly=true:NoSchedule',
        ] if pool_mode is cs.AgentPoolMode.SYSTEM else None

        for idx, pool in enumerate(
                iterable=node_pools_type,
                start=1,
        ):
            name = f'{pool_type}{idx}'
            vm_size = pool['vmSize']
            min_count = int(pool['minCount'])
            max_count = int(pool['maxCount'])
            enable_auto_scaling = \
                str(pool['enableAutoScaling']).lower() == 'true'

            node_pool_profiles.append(
                    cs.ManagedClusterAgentPoolProfileArgs(
                            name=name,
                            mode=mode,
                            vm_size=vm_size,
                            min_count=min_count,
                            max_count=max_count,
                            count=min_count,
                            enable_auto_scaling=enable_auto_scaling,
                            node_taints=node_taints,
                    ),
            )

    return node_pool_profiles
^
import pulumi_azure_native.containerservice as cs