AKS icon indicating copy to clipboard operation
AKS copied to clipboard

[Question] GitOps (FluxCD), HelmRepisitory, HelmRelease - code works in one namespace but doesn't in the other

Open macpak opened this issue 3 years ago • 44 comments

Describe scenario I've enabled GitOps for a repository that contains HelmRepository/HelmRelease for instaling Istio. GitOps is enabled in flux-system namespace, Cluster wide.

In my repo, under /istio/system I've 2 files:

  • istio.yaml
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
  name: istio
  namespace: istio-system
  labels:
    app.kubernetes.io/part-of: istio
spec:
  interval: 1m0s
  url: https://istio-release.storage.googleapis.com/charts
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: istio-base
  namespace: istio-system
  labels:
    app.kubernetes.io/part-of: istio
spec:
  chart:
    spec:
      version: "1.14"
      chart: base
      sourceRef:
        kind: HelmRepository
        name: istio
        namespace: istio-system
  interval: 1m0s
  • namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: istio-system

There's also a kustomization that looks like:

apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: istio-system
  namespace: flux-system
spec:
  interval: 10m0s
  path: ./istio/system
  prune: true
  wait: true
  sourceRef:
    kind: GitRepository
    name: istio

When I create a GitOps configuration in AKS, I also create a new kustomization that points to the kustomization file above. This configuration above doesn't work, no helms are installed + the istio kustomization is stuck in running health checks with a timeout. However, when I change istio-system to flux-system namespace, everything works ok. I thought that it may be related to RBAC, but checked and it seems all ClusterRoleBindings are added.

Question What's wrong with the configuration above ? Why it does work in flux-system and doesn't in istio-system ?

macpak avatar Jul 21 '22 15:07 macpak

Action required from @Azure/aks-pm

ghost avatar Aug 20 '22 19:08 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Sep 05 '22 00:09 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Sep 20 '22 00:09 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Oct 05 '22 06:10 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Oct 22 '22 00:10 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Nov 06 '22 06:11 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Nov 25 '22 00:11 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Dec 10 '22 00:12 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Dec 25 '22 06:12 ghost

There is a multi-tenancy flag for the flux extension that you can turn off to allow cross namespace operations. Not sure if that’s the issue here but worth a try. https://github.com/fluxcd/flux2/issues/3182

joshuadmatthews avatar Dec 25 '22 15:12 joshuadmatthews

Issue needing attention of @Azure/aks-leads

ghost avatar Jan 09 '23 18:01 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jan 25 '23 00:01 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Feb 09 '23 06:02 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Feb 24 '23 12:02 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Mar 11 '23 18:03 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Mar 26 '23 18:03 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Apr 11 '23 00:04 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Apr 26 '23 06:04 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar May 11 '23 12:05 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar May 26 '23 18:05 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jun 11 '23 00:06 ghost

Did you figure any of this out in the end?

SebSa avatar Jun 13 '23 19:06 SebSa

This fixed it for me today https://github.com/fluxcd/flux2/issues/3182#issuecomment-1275152211

unique-dominik avatar Jun 16 '23 15:06 unique-dominik

Issue needing attention of @Azure/aks-leads

ghost avatar Jul 01 '23 18:07 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jul 17 '23 00:07 ghost

Toggling the Multi tenancy enforce flag worked for me too.

SebSa avatar Jul 17 '23 09:07 SebSa

Issue needing attention of @Azure/aks-leads

ghost avatar Aug 01 '23 12:08 ghost

@macpak Did any of the proposed fixes in this thread work for you?

RooMaiku avatar Jan 04 '24 21:01 RooMaiku

Issue needing attention of @Azure/aks-leads

Issue needing attention of @Azure/aks-leads