AKS Flux Extension ImageUpdateAutomation support

alexey.buzdin 16 Reputation points
2022-07-18T10:03:53.393+00:00

Hi

Flux has a feature to automatically watch for Docker image version changes in Docker Container Registry and update GitOps git repository.

The feature is described in Flux official documentation:
https://fluxcd.io/docs/guides/image-update/

The feature requires Flux to bootstrap image-reflector-controller and image-automation-controller Pods in Kubernetes Cluster to work and Kubernetes Custom Resources (CRD) to enable the functionality.

After provisioning Flux with Azure Kubernetes Extension Manager we can see that CRDs (ImageUpdateAutomation, ImageRepository and ImagePolicy) are setup in the AKS cluster, but
image-reflector-controller and image-automation-controller are not.

From what we understand in some older Flux version to enable the functionality a special component-extra flag must be set in order to provision the controllers during flux bootstrap phase.

--components-extra=image-reflector-controller,image-automation-controller

Sadly in the official ARM/Bicep fluxConfigurations resource, which does flux bootstrap under the hood, we haven't found an option to pass the components-extra to enable the feature.

https://video2.skills-academy.com/en-us/azure/templates/microsoft.kubernetesconfiguration/2022-03-01/fluxconfigurations?tabs=bicep#gitrepositorydefinition

Could you please suggest how/if possible could we enabled ImageUpdateAutomation and if/when the setup would be officially documented in Azure GitOps Documentation?

https://video2.skills-academy.com/en-us/azure/azure-arc/kubernetes/tutorial-use-gitops-flux2#for-azure-kubernetes-service-clusters

Thank you in advance,
Best regards

Azure Arc
Azure Arc
A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
399 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,062 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. alexey.buzdin 16 Reputation points
    2022-07-21T11:10:31.46+00:00

    Found the solution thanks to Bernardo Pinheiro,

    It is possible to enabled image-automation-controller in Azure Flux, as described here:

    https://video2.skills-academy.com/en-us/azure/azure-arc/kubernetes/tutorial-use-gitops-flux2#control-which-controllers-are-deployed-with-the-flux-cluster-extension

    To do that in Bicep one need to do the following:

    resource fluxExtensions 'Microsoft.KubernetesConfiguration/extensions@2022-03-01' = {  
      name: 'flux'  
      scope: aks  
      properties: {  
        extensionType: 'microsoft.flux'  
        scope: {  
          cluster: {  
            releaseNamespace: 'flux-system'  
          }  
        }  
        configurationSettings: {  
          'image-automation-controller.enabled': 'true'   
          'image-reflector-controller.enabled': 'true'  
        }  
        autoUpgradeMinorVersion: true  
        version: '1.3.0'  
      }  
    }  
    

    This configuration of Flux must be done on Microsoft.KubernetesConfiguration/extensions level instead of Microsoft.KubernetesConfiguration/fluxConfigurations

    3 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.