Skip to content

Support for image_cleaner & image_cleaner_interval_hours #342

@aevlogiev

Description

@aevlogiev

Is there an existing issue for this?

  • I have searched the existing issues

Description

image_cleaner_enabled - (Optional) Specifies whether Image Cleaner is enabled.
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#image_cleaner_enabled

image_cleaner_interval_hours - (Optional) Specifies the interval in hours when images should be cleaned up. Defaults to 48
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#image_cleaner_interval_hours

This feature helps clean the unused images, although it can be updated manually on a cluster level, doing it manually triggers terraform change, along with the missing lifecycle option, we need to enable it each time we run terraform

This requires that the Preview Feature Microsoft.ContainerService/EnableImageCleanerPreview is enabled and the Resource Provider is re-registered, see the documentation for more information.

New or Affected Resource(s)/Data Source(s)

module.aks.azurerm_kubernetes_cluster.main

Potential Terraform Configuration

module "aks" {
  source  = "Azure/aks/azurerm"
  version = "6.7.1"
  image_cleaner_enabled = true/false (defaults to false)
  image_cleaner_interval_hours = 48
}

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions