1

I have successfully installed flux-cd using helmChart

Using CRD, I have deployed a gitrepos resource as required but error occured when i try to apply my kustomize yaml in kubernetes

Sops is implemented with gpg key. Private key is stored in Kubernetes secret and public key is stored in our git repo

Following this guide: https://github.com/giantswarm/flux-app and this https://fluxcd.io/docs/guides/mozilla-sops/

When i try to enter kubectl get kustomization, i get this error enter image description here

torek
  • 448,244
  • 59
  • 642
  • 775
Jordan
  • 505
  • 5
  • 13
  • Where did you find the command `kubectl get kustomization`? It doesn't show up in either of the linked docs. – larsks Jul 21 '22 at 00:33
  • it isn't when you installed fluxCD in k8s, some pods will be deployed along with some custom resources will be installed. One of them will be gitrepository ```kubectl get gitrepository``` and other will be kustomization resource. Please search GitOps and flux, you will find more answer about it – Jordan Jul 21 '22 at 08:08
  • Any luck? I have same problem. In my case I have one kustomization for main branch which is ok. But for another branch 2nd kustomization gets same error. Can't figure out what do I need to do. – Alex K Aug 29 '22 at 23:29
  • This error can appear as a generic error for kustomization errors such as mispellings or missing variable definitions. Try to remove dependencies until the error goes away to narrow down the issue. – brettinternet Jul 19 '23 at 16:06

1 Answers1

0

It's hard to tell your problem from the information you provided but that's an error that can happen if you have a missing kustomization.yaml file in your flux repository where it's required.

Taking this simple example of a flux repo as a reference: https://github.com/fluxcd/flux2-kustomize-helm-example you would need a kustomization.yaml in apps/base/podinfo otherwise flux will complain with that there is a missing kustomization file (because it's being loaded via the kustomization.yaml in apps/production/kustomization.yaml with ../base/podinfo).

You can go to the base directory and just execute this to generate the missing kustomization.yaml file:

$ kustomize create --recursive --autodetect
Pigueiras
  • 18,778
  • 10
  • 64
  • 87