Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/kubernetes_cluster: handling breaking changes in the AKS API #6095

Merged
merged 31 commits into from
Apr 6, 2020

Commits on Apr 1, 2020

  1. Potential fix for hashicorp#6020

    If autoscaling is disabled on default_node_pool, those values are set to `0`
    Steffen Wagner authored and tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    50fda65 View commit details
    Browse the repository at this point in the history
  2. always set count

    Steffen Wagner authored and tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    5498920 View commit details
    Browse the repository at this point in the history
  3. Updates due to API upgrade

    WodansSon authored and tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    9be600d View commit details
    Browse the repository at this point in the history
  4. Add test case to test list

    WodansSon authored and tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    6e8b682 View commit details
    Browse the repository at this point in the history
  5. Added more tests

    WodansSon authored and tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    ec70994 View commit details
    Browse the repository at this point in the history
  6. update lower bound in docs

    WodansSon authored and tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    79c93b7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    385d8a7 View commit details
    Browse the repository at this point in the history
  8. Fix for hashicorp#6235

    WodansSon authored and tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    860dae6 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d064ab2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    358b454 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3b31417 View commit details
    Browse the repository at this point in the history
  12. r/kubernetes_cluster: conditionally specifying either the service_pri…

    …ncipal or MSI blocks
    
    Previously it was possible to use a Service Principal for an AKS Cluster and also give it a
    Managed Identity. However due to a breaking change in the AKS API this is no longer possible.
    
    Instead attempting to do this via the API creates an MSI Enabled cluster and ignores the Service
    Principal that's specified - as such it's only possible to create a Service Principal or MSI cluster,
    not the Service Principal cluster with a Managed Identity attached as before.
    tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    edb4e3a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    42d37f2 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    56de89e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    5a17ea9 View commit details
    Browse the repository at this point in the history
  16. r/kubernetes_cluster: moving the rest of the functions into parse/val…

    …idate since these now exist
    tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    57b6e9a View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    673f47b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    4c1a4ef View commit details
    Browse the repository at this point in the history
  19. test cleanup

    tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    23b8cbb View commit details
    Browse the repository at this point in the history
  20. r/kubernetes_cluster(_node_pool): requiring that min_count and `max…

    …_count` are set to `null` not 0 when undefined
    
    This updates the error message to match the behaviour of the existing resources, where the `_count` fields
    can be set to `null` rather than `0` in a coalesce function - for example:
    
    ```
    locals {
      enable_auto_scale = false
      fixed_count = 2
      min_count   = 1
      max_count   = 4
    }
    
    resource "azurerm_kubernetes_cluster" "test" {
      # ...
    
      default_node_pool {
        enable_auto_scaling = local.enable_auto_scale
        node_count          = local.enable_auto_scale ? null : local.fixed_count
        min_count           = local.enable_auto_scale ? local.min_count : null
        max_count           = local.enable_auto_scale ? local.max_count : null
      }
    }
    ```
    tombuildsstuff committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    6819422 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2020

  1. r/kubernetes_cluster: messaging the behavioural differences in the AK…

    …S API
    
    Due to a breaking change in the AKS API - it's no longer possible to create
    mixed-mode clusters (e.g. using both a Service Principal and a Managed Identity).
    
    This commit attempts to correctly message this behaviour, whilst trying to ensure
    we can adequately capture this behaviour within Terraform
    tombuildsstuff committed Apr 2, 2020
    Configuration menu
    Copy the full SHA
    1837de7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f3a1905 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2020

  1. Configuration menu
    Copy the full SHA
    fa97d31 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3de8ac9 View commit details
    Browse the repository at this point in the history
  3. r/kubernetes_cluster(_node_pool): ensuring that tags are set on the d…

    …efault node pool
    
    Also fixing a bug where min/max count would be unmodified during updates
    tombuildsstuff committed Apr 3, 2020
    Configuration menu
    Copy the full SHA
    c5e87d8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6472a45 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2020

  1. r/kubernetes_cluster_node_pool: explicitly requiring null rather th…

    …an `0`
    
    When coalescing between these values - this should be set to `null` rather
    than `0` - and fixes the error message which caused the initial confusion.
    Whilst setting this field to `0` is convenient - it breaks validation for
    when auto-scaling is enabled - as such `0` shouldn't be an allowed value
    for `min_count` or `max_count` (since node pools can't be scaled to `0` in
    the API)
    
    Instead users can coaslesce this via:
    
    ```
    locals {
      enable_auto_scale = false
      fixed_count = 2
      min_count   = 1
      max_count   = 4
    }
    
    resource "azurerm_kubernetes_cluster_node_pool" "test" {
      # ...
      enable_auto_scaling = local.enable_auto_scale
      node_count          = local.enable_auto_scale ? null : local.fixed_count
      min_count           = local.enable_auto_scale ? local.min_count : null
      max_count           = local.enable_auto_scale ? local.max_count : null
    }
    ```
    tombuildsstuff committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    977b202 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    824e57f View commit details
    Browse the repository at this point in the history
  3. r/kubernetes_cluster(_node_pool): updating the docs to handle `min_co…

    …unt`/`max_count` being null
    tombuildsstuff committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    3b8c9de View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    667d71c View commit details
    Browse the repository at this point in the history
  5. linting

    tombuildsstuff committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    4abba5e View commit details
    Browse the repository at this point in the history