1

I've just started working with Weavework's Flux GitOps system in Kubernetes. I have regular deployments (deployments, services, volumes, etc.) working fine. I'm trying for the first time to deploy a Helm chart.

I've followed the instructions in this tutorial: https://github.com/fluxcd/helm-operator-get-started and have its sample service working after making a few small changes. So I believe that I have all the right tooling in place, including the custom HelmRelease K8s operator.

I want to deploy Jenkins via Helm, which if I do manually is as simple as this Helm command:

helm install --set persistence.existingClaim=jenkins --set master.serviceType=LoadBalancer jenkins stable/jenkins

I want to convert this to a HelmRelease object in my Flex-managed GitHub repo. Here's what I've got, per what documentation I can find:

apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: jenkins
  namespace: jenkins
updating-applications/
    fluxcd.io/ignore: "false"
spec:
  releaseName: jenkins
  chart:
    git: https://github.com/helm/charts/tree/master
    path: stable/jenkins
    ref: master
  values:
    persistence:
        existingClaim: jenkins
    master:
        serviceType: LoadBalancer

I have this in the file 'jenkins/jenkins.yaml' from the root of the location in my git repo that Flex is monitoring. Adding this file does nothing...I get no new K8s objects, no HelmRelease object, and no new Helm release when I run "helm list -n jenkins".

I see some mention of having to have 'image' tags in my 'values' section, but since I don't need to specify any images in my manual call to Helm, I'm not sure what I would add in terms of 'image' tags. I've also seen examples of HelmRelease definitions that don't have 'image' tags, so it seems that they aren't absolutely necessary.

I've played around with adding a few annotations to my 'metadata' section:

annotations:
#    fluxcd.io/automated: "true"
    # per: https://blog.baeke.info/2019/10/10/gitops-with-weaveworks-flux-installing-and-updating-applications/
    fluxcd.io/ignore: "false"

But none of that has helped to get things rolling. Can anyone tell me what I have to do to get the equivalent of the simple Helm command I gave at the top of this post to work with Flex/GitOps?

1 Answers1

0

Have you tried checking the logs on the fluxd and flux-helm-operator pods? I would start there to see what error message you're getting. One thing that i'm seeing is that you're using https for git. You may want to double check, but I don't recall ever seeing any documentation configuring chart pulls via git to use anything other than SSH. Moreover, I'd recommend just pulling that chart from the stable helm repository anyhow:

apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: jenkins
  namespace: jenkins
  annotations: #not sure what updating-applications/ was?
    fluxcd.io/ignore: "false" #pretty sure this is false by default and can be omitted
spec:
  releaseName: jenkins
  chart:
    repository: https://kubernetes-charts.storage.googleapis.com/
    name: jenkins
    version: 1.9.16
  values:
    persistence:
        existingClaim: jenkins
    master:
        serviceType: LoadBalancer
DiamonW
  • 259
  • 1
  • 6
  • 12
  • 1
    Thanks! That was it. I'm thinking that my main mistake was the 'https' vs 'git'. Maybe it would have worked if I'd just changed that. But I took your other recommendation and used the main helm repo. I don't know if it was just timing (I didn't wait long enough), or if it mattered, but I took out the annotation before it worked. If that;s the case then, maybe 'ignore' doesn't default to 'false'. I got that from some other example online, so at least one other person thought it needed to be made explicit. Bottom line. I've got Jenkins via Helm! – Margaret Abba Feb 02 '20 at 17:55
  • 1
    I was also wondering how to look at the logs for flux. I forget that everything exists in its own pod, so the obvious thing is to just look at the output of various pods. I'm going to take that advice to heart moving forward. Thanks so much for that! – Margaret Abba Feb 02 '20 at 17:58