Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Chart release not getting deployed via flux #3463

Closed
suvsap opened this issue Apr 15, 2021 · 4 comments
Closed

Chart release not getting deployed via flux #3463

suvsap opened this issue Apr 15, 2021 · 4 comments
Assignees
Labels
blocked-needs-validation Issue is waiting to be validated before we can proceed bug

Comments

@suvsap
Copy link

suvsap commented Apr 15, 2021

Hi ,

I have the below HelmRelease in prj-dev environment:-

suv@Suvankars-MacBook-Pro[6:14:30]:~/thermeon/gke-staging-envs/namespaces/suv/releases$ ls -ltr
total 16
-rw-r--r--  1 suv  staff  266 Apr 13 19:30 elasticsearch.yaml
-rw-r--r--  1 suv  staff  695 Apr 13 19:30 help-wiki.yaml
 
suv@Suvankars-MacBook-Pro[6:44:18]:~/thermeon/gke-staging-envs/namespaces/suv/releases$ cat help-wiki.yaml 
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
  name: help-wiki
  namespace: suv
spec:
  releaseName: help-wiki-suv
  values:
    ingress:
      enabled: true
      tls:
      - secretName: helpwiki.suv.dev.europe-west1.thermeon.io-tls
        hosts:
        - helpwiki.suv.dev.europe-west1.thermeon.io
      hosts:
        - helpwiki.suv.dev.europe-west1.thermeon.io
    elasticsearch: elasticsearch-helpwiki-suv.help-wiki.svc.cluster.local
    db:
      host: 127.0.0.1
      name: helpwiki
      user: helpwiki
    wikiSettingsConfigMapRef: helpwiki-settings
  chart:
    git: git@github.com:thermeon/gke-staging-envs
    path: charts/thermeon-wiki
    ref: prj-dev/europe
suv@Suvankars-MacBook-Pro[6:44:30]:~/thermeon/gke-staging-envs/namespaces/suv/releases$ cat elasticsearch.yaml 
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
  name: elasticsearch
  namespace: suv
spec:
  releaseName: elasticsearch-helpwiki-suv
  chart:
    git: git@github.com:thermeon/gke-staging-envs
    path: charts/elasticsearch
    ref: prj-dev/europe

Even when the flux sync happens in prj-dev, this releases are not getting deployed. I manually tried to deploy the chart and it works fine

suv@Suvankars-MacBook-Pro[6:16:35]:~/thermeon/gke-staging-envs/namespaces/suv/releases$ helm list | grep suv
suv-elasticsearch           1           Fri Apr  9 18:23:35 2021     DEPLOYED      elasticsearch-0.1.0                1.0              suv           
suv-helpwiki                1           Tue Apr 13 20:53:48 2021     DEPLOYED      thermeon-wiki-0.2.0                1.0.0            suv        


Can you kindly let me know how to check why the HelmRelease are not getting deployed via Flux? How to troubleshoot this kind of issues? Thanks

@suvsap suvsap added blocked-needs-validation Issue is waiting to be validated before we can proceed bug labels Apr 15, 2021
@kingdonb
Copy link
Member

I don't want to assume you have installed Helm Operator correctly just because the CRD seems to be available. However, since you haven't mentioned Helm Operator, I also can't assume you have installed it correctly...

If you run kubectl get helmreleases -A do you see any status indications?

Flux itself is not responsible for installing Helm releases, it will only sync HelmRelease definitions (CRD-custom resources) to the cluster and wait for the operator to take action on them. When the operator reconciles a HelmRelease, if all goes well, it will be installed with a helm client, as any other (non-operator-managed) helm releases, where you can find it with helm list.

If you have installed Helm Operator to go with Flux, and kubectl get helmreleases indicates the HelmRelease CRs have been applied successfully, the next thing to check is the Helm Operator logs. Has it tried to reconcile your helmreleases, and did it succeed or fail? Use kubectl logs -f deploy/helm-operator -n [flux-namespace] to find out.

Based on the API versions in the snips you posted, it looks like you are either working from a very old tutorial, or with a very old cluster that has an older Helm Operator installation on it. The flux.weave.works/v1beta1 API version was replaced with a newer helm.fluxcd.io/v1 for the Helm Operator's helmreleases CRD. Support can only be provided for the latest version of Helm Operator in maintenance mode, at a guess you could have some mismatched versions, or you could be feeding the Helm Operator helmreleases of an obsolete api version, so it's ignoring them rather than applying them to the cluster.

helmreleases.helm.fluxcd.io

Helm Operator and Flux v1 are deprecated for Flux v2 (#3320) and have been effectively replaced by Helm Controller, which has passed feature parity some time ago, definitely receives more attention, and is currently in active development.

Please consider upgrading to Flux v2. In the mean time, if an upgrade across MAJOR releases isn't practical right now, please at least make sure your Helm Operator and Helm Operator CRDs are all on the latest version before seeking support. Many issues have been fixed, and will continue to be fixed while these repos remain in maintenance status.

The latest Flux v2 documentation and other materials can be found at https://toolkit.fluxcd.io

For documentation on Flux v1 and helm operator, it can still be found at https://docs.fluxcd.io

@kingdonb kingdonb self-assigned this Apr 15, 2021
@suvsap
Copy link
Author

suvsap commented Apr 16, 2021

@kingdonb - Thanks so much for the prompt response.

Actually my Kubernetes cluster has been upgraded to 1.17.17-gke.2800 but some of the api's referenced in the Helm chart and Release are still old. So currently i am trying to update the apiversion of chart and releases as per doc - here

For example:- (This is just to help if someone references this issue for a similar problem)

suv@Suvankars-MacBook-Pro[7:52:41]:~/thermeon/gke-staging-envs/namespaces/suv/releases$ cat elasticsearch.yaml 
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
  name: elasticsearch
  namespace: suv
spec:
  releaseName: elasticsearch-helpwiki-suv
  chart:
    git: git@github.com:thermeon/gke-staging-envs
    path: charts/elasticsearch
    ref: prj-dev/europe

The above helm release will be modified as below to change the apiversion which was depreceated

suv@Suvankars-MacBook-Pro[8:02:17]:~/thermeon/gke-staging-envs/namespaces/suv/releases$ cat elasticsearch.yaml 
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: elasticsearch
  namespace: suv
spec:
  helmVersion: v2
  releaseName: elasticsearch-helpwiki-suv
  chart:
    git: git@github.com:thermeon/gke-staging-envs
    path: charts/elasticsearch
    ref: prj-dev/europe

Once i am done resolving the issue i will update the issue again

@kingdonb
Copy link
Member

Is there any update on this? I'd like to close.

@suvsap
Copy link
Author

suvsap commented Apr 23, 2021

Thanks @kingdonb so much for your help. Post making the change it is working now. Appreciate your help

@suvsap suvsap closed this as completed Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked-needs-validation Issue is waiting to be validated before we can proceed bug
Projects
None yet
Development

No branches or pull requests

2 participants