Giter Site home page Giter Site logo

Comments (11)

travisghansen avatar travisghansen commented on August 16, 2024

Thanks for trying it out! Your approach is slightly off actually. The example provided in the readme is a sample values.yaml data for deploying ArgoCD itself. Once it is deployed with the init containers etc then you can create an application with the correct definition and it should work. I’ll send a sample application yaml shortly.

from argo-cd-helmfile.

travisghansen avatar travisghansen commented on August 16, 2024

Sample application source

        source:
          path: monitoring
          plugin:
            env:
            - name: KUBE_VERSION
              value: "1.16"
            - name: HELMFILE_GLOBAL_OPTIONS
              value: --selector name!=kapacitor,name!=elasticsearch,name!=elasticsearch-curator
            name: helmfile
          repoURL: <git url>
          targetRevision: HEAD

from argo-cd-helmfile.

janavenkat avatar janavenkat commented on August 16, 2024

Thanks for trying it out! Your approach is slightly off actually. The example provided in the readme is a sample values.yaml data for deploying ArgoCD itself. Once it is deployed with the init containers etc then you can create an application with the correct definition and it should work. I’ll send a sample application yaml shortly.

Thank you

from argo-cd-helmfile.

travisghansen avatar travisghansen commented on August 16, 2024

Yeah, try it out and make sure it works and then I'll close this down :)

from argo-cd-helmfile.

janavenkat avatar janavenkat commented on August 16, 2024

Can please send me your example application that uses helmfile

from argo-cd-helmfile.

travisghansen avatar travisghansen commented on August 16, 2024

Sure:

kubectl -n argocd get applications.argoproj.io monitoring -o yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  creationTimestamp: "2020-01-09T20:42:22Z"
  generation: 107586
  name: monitoring
  namespace: argocd
  resourceVersion: "177714784"
  selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd/applications/monitoring
  uid: d0bf1e98-af73-464f-8da4-e6ab26d35b9d
spec:
  destination:
    namespace: monitoring
    server: https://kubernetes.default.svc
  project: default
  source:
    path: monitoring
    plugin:
      env:
      - name: KUBE_VERSION
        value: "1.16"
      - name: HELMFILE_GLOBAL_OPTIONS
        value: --selector name!=kapacitor,name!=elasticsearch,name!=elasticsearch-curator
      name: helmfile
    repoURL: <repo>
    targetRevision: HEAD
status:
 ...

from argo-cd-helmfile.

janavenkat avatar janavenkat commented on August 16, 2024

Am using like this

---
apiVersion: "argoproj.io/v1alpha1"
kind: "Application"
metadata:
  name: "hello-file"
spec:
  project: default
  source:
    repoURL: '[email protected]:xxx/exx-demo.git'
    path: "argocd-helm/xxx/test"
    plugin:
      env:
      - name: KUBE_VERSION
        value: "1.15"
      name: helmfile
  destination:
    server: 'xxxxxxx'
    namespace: default

Argocd-repo-server configured like this

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations: ""
  creationTimestamp: "2020-07-23T08:55:38Z"
  generation: 4
  labels:
    app.kubernetes.io/component: repo-server
    app.kubernetes.io/name: argocd-repo-server
    app.kubernetes.io/part-of: argocd
  name: argocd-repo-server
  namespace: argocd
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/name: argocd-repo-server
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/name: argocd-repo-server
    spec:
      automountServiceAccountToken: false
      containers:
      - command:
        - uid_entrypoint.sh
        - argocd-repo-server
        - --redis
        - argocd-redis:6379
        image: argoproj/argocd:v1.6.1
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 8081
          timeoutSeconds: 1
        name: argocd-repo-server
        ports:
        - containerPort: 8081
          protocol: TCP
        - containerPort: 8084
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 8081
          timeoutSeconds: 1
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /app/config/ssh
          name: ssh-known-hosts
        - mountPath: /app/config/tls
          name: tls-certs
        - mountPath: /usr/local/bin/argo-cd-helmfile.sh
          name: custom-tools
          subPath: argo-cd-helmfile.sh
        - mountPath: /usr/local/bin/helmfile
          name: custom-tools
          subPath: helmfile
      dnsPolicy: ClusterFirst
      initContainers:
      - args:
        - wget -qO /custom-tools/argo-cd-helmfile.sh https://raw.githubusercontent.com/travisghansen/argo-cd-helmfile/master/src/argo-cd-helmfile.sh
          && chmod +x /custom-tools/argo-cd-helmfile.sh && wget -qO /custom-tools/helmfile
          https://github.com/roboll/helmfile/releases/download/v0.98.2/helmfile_linux_amd64
          && chmod +x /custom-tools/helmfile
        command:
        - sh
        - -c
        image: alpine:3.8
        imagePullPolicy: IfNotPresent
        name: download-tools
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /custom-tools
          name: custom-tools
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - emptyDir: {}
        name: custom-tools
      - configMap:
          defaultMode: 420
          name: argocd-ssh-known-hosts-cm
        name: ssh-known-hosts
      - configMap:
          defaultMode: 420
          name: argocd-tls-certs-cm
        name: tls-certs

and my argocd-cm is

    configManagementPlugins: |
      - name: helmfile
        init:         
          command: ["argo-cd-helmfile.sh"]
          args: ["init"]

and in my repo am application error like this

image

from argo-cd-helmfile.

travisghansen avatar travisghansen commented on August 16, 2024

OK, I just looked at my configmap and have this:

  configManagementPlugins: |
    - name: helmfile
      init:                          # Optional command to initialize application source directory
        command: ["argo-cd-helmfile.sh"]
        args: ["init"]
      generate:                      # Command to generate manifests YAML
        command: ["argo-cd-helmfile.sh"]
        args: ["generate"]

Try that and then we'll look go from there..

from argo-cd-helmfile.

janavenkat avatar janavenkat commented on August 16, 2024

Oh yeah, I missed that. It works now thank you. Do you think is there any plan for the helm secrets

from argo-cd-helmfile.

travisghansen avatar travisghansen commented on August 16, 2024

I've never messed with helm secrets, nor using them with helmfile so I'd have to do a bit of research. Patches welcome to support it if something extra is required for sure. I'm not entirely sure how those work but don't see why it wouldn't 'just work' regardless.

I'm more inclined to go with something like vault but haven't even done that yet either.

Not sure if it's helpful in your situation, but since helmfile can use ENV vars as values in the various charts, you could just deploy your secret along with the app definition and then reference the ENV vars in your helmfile.

from argo-cd-helmfile.

janavenkat avatar janavenkat commented on August 16, 2024

Thanks for the help

from argo-cd-helmfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.