Flux Extension gitops issue when adding from terraform

Dhandapani, Shankar 0 Reputation points
2024-02-27T09:33:23.82+00:00

Hi,

When I am trying to add flux extension to azure Kubernetes cluster, I am getting the below error Terraform code: resource "azurerm_kubernetes_cluster_extension" "flux_ext" { name = join("-", [var.cluster_name, "flux", "ext"]) cluster_id = var.cluster_id extension_type = "microsoft.flux" } resource "azurerm_kubernetes_flux_configuration" "flux_conf" { name = var.flux_conf_name cluster_id = var.cluster_id namespace = var.flux_namespace scope = "cluster" git_repository { url = var.git_repo_url reference_type = var.reference_type reference_value = var.reference_value ssh_private_key_base64 = var.ssh_private_key_base64 sync_interval_in_seconds = 120 } kustomizations { name = var.cluster_name path = var.kustomization_path sync_interval_in_seconds = 120 retry_interval_in_seconds = 120 recreating_enabled = var.recreating_enabled garbage_collection_enabled = var.garbage_collection_enabled } depends_on = [ azurerm_kubernetes_cluster_extension.flux_ext ] }

Error:

│ Error: creating Scoped Flux Configuration (Scope: "/subscriptions/e0e501b0-9a08-497b-b994-f302ab3d46e0/resourceGroups/l-use-cluster08-rg/providers/Microsoft.ContainerService/managedClusters/l-use-cluster08-aks" │ Flux Configuration Name: "cluster-config"): polling after CreateOrUpdate: context deadline exceeded │ with module.cluster_flux_conf.azurerm_kubernetes_flux_configuration.flux_conf, │ on ../../../modules/common/flux_azurerm/main.tf line 13, in resource "azurerm_kubernetes_flux_configuration" "flux_conf": │ 13: resource "azurerm_kubernetes_flux_configuration" "flux_conf" { │ creating Scoped Flux Configuration (Scope: │ "/subscriptions/e0e501b0-9a08-497b-b994-f302ab3d46e0/resourceGroups/l-use-cluster08-rg/providers/Microsoft.ContainerService/managedClusters/l-use-cluster08-aks" │ Flux Configuration Name: "cluster-config"): polling after CreateOrUpdate: │ context deadline exceeded

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,072 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 19,782 Reputation points Microsoft Employee
    2024-02-27T21:46:24.06+00:00

    @Dhandapani, Shankar I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer. Accepted answers show up at the top, resulting in improved discoverability for others.

    Issue: When customer is trying to add flux extension to azure Kubernetes cluster via terraform, getting the error: "context deadline exceeded".

    Solution: Customer shared - When I investigated the cluster, flux-config-agent replica sets had been stalled. Once I fixed that, it worked.


    If your issue remains unresolved or have further questions, please let us know in the comments how we can assist. We are here to help you and strive to make your experience better and value your feedback.

    User's image

    0 comments No comments

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.