1

I'm trying to install Traefik on a K8s cluster using ArgoCD to deploy the official Helm chart. But I also need it to us an additional "values.yml" file. When I try to specify in the Application yaml file what additional values file to use, it fails to file not found for it.

Here is what I'm using:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: argo-traefik-chart
  namespace: argocd
spec:
  project: default
  source:
    path: traefik
    repoURL: https://github.com/traefik/traefik-helm-chart.git
    targetRevision: HEAD
    helm:
      valueFiles:
        - /traefik-values.yml
  destination: 
    server: https://kubernetes.default.svc
    namespace: 2195-leaf-dev-traefik
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
    automated:
      prune: true
      selfHeal: true

Here is the traefik-value.yml file.

additionalArguments:
# Configure your CertificateResolver here...
# 
# HTTP Challenge
# ---
# Generic Example:
#   - --certificatesresolvers.generic.acme.email=your-email@example.com
#   - --certificatesresolvers.generic.acme.caServer=https://acme-v02.api.letsencrypt.org/directory
#   - --certificatesresolvers.generic.acme.httpChallenge.entryPoint=web
#   - --certificatesresolvers.generic.acme.storage=/ssl-certs/acme-generic.json
#
# Prod / Staging Example:
#   - --certificatesresolvers.staging.acme.email=your-email@example.com
#   - --certificatesresolvers.staging.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
#   - --certificatesresolvers.staging.acme.httpChallenge.entryPoint=web
#   - --certificatesresolvers.staging.acme.storage=/ssl-certs/acme-staging.json
#   - --certificatesresolvers.production.acme.email=your-email@example.com
#   - --certificatesresolvers.production.acme.caServer=https://acme-v02.api.letsencrypt.org/directory
#   - --certificatesresolvers.production.acme.httpChallenge.entryPoint=web
#   - --certificatesresolvers.production.acme.storage=/ssl-certs/acme-production.json
#
# DNS Challenge
# ---
# Cloudflare Example:
#  - --certificatesresolvers.cloudflare.acme.dnschallenge.provider=cloudflare
#  - --certificatesresolvers.cloudflare.acme.email=your-email@example.com
#  - --certificatesresolvers.cloudflare.acme.dnschallenge.resolvers=1.1.1.1
#  - --certificatesresolvers.cloudflare.acme.storage=/ssl-certs/acme-cloudflare.json
#
# Generic (replace with your DNS provider):
#  - --certificatesresolvers.generic.acme.dnschallenge.provider=generic
#  - --certificatesresolvers.generic.acme.email=your-email@example.com
#  - --certificatesresolvers.generic.acme.storage=/ssl-certs/acme-generic.json

logs:
# Configure log settings here...
  general:
    level: DEBUG

ports:
# Configure your entrypoints here...
  web:
    # (optional) Permanent Redirect to HTTPS
    redirectTo: websecure
  websecure:
    tls:
      enabled: true
      # (optional) Set a Default CertResolver
      # certResolver: cloudflare
  

#env:
# Set your environment variables here...
# 
# DNS Challenge Credentials
# ---
# Cloudflare Example:
#   - name: CF_API_EMAIL
#     valueFrom:
#       secretKeyRef:
#         key: email
#         name: cloudflare-credentials
#   - name: CF_API_KEY
#     valueFrom:
#       secretKeyRef:
#         key: apiKey
#         name: cloudflare-credentials

# Just to do it for now
envFrom:
  - secretRef:
      name: traefik-secrets
  
# Disable Dashboard
ingressRoute:
  dashboard:
    enabled: true

# Persistent Storage
persistence:
  enabled: true
  name: ssl-certs
  size: 1Gi
  path: /ssl-certs

# deployment:
#   initContainers:
#     # The "volume-permissions" init container is required if you run into permission issues.
#     # Related issue: https://github.com/containous/traefik/issues/6972
#     - name: volume-permissions
#       image: busybox:1.31.1
#       command: ["sh", "-c", "chmod -Rv 600 /ssl-certs/*"]
#       volumeMounts:
#         - name: ssl-certs
#           mountPath: /ssl-certs

# Set Traefik as your default Ingress Controller, according to Kubernetes 1.19+ changes.
ingressClass:
  enabled: true
  isDefaultClass: true

The traefik-values.yml file is in the same sub-directory as this file. I fire this of with kubectl apply -f but when I got to look at it in the Argo GUI, it shows an error. I'll paste the entire thing below, but it looks like the important part is this:

` failed exit status 1: Error: open .traefik-values.yml: no such file or directory

It's putting a period before the name of the file. I tried different ways of specifying the file: .traefik-values.yml and ./treafik-values.yml. Those get translated to:

: Error: open .traefik/.traefik-values.yml: no such file or directory

When I do a helm install using the exact same traefik-values.yml file, I get exactly what I expect. And when I run the Argo without the alternate file, it deploys but with out the needed options of course.

Any ideas?

1 Answer 1

1

I assume this is because Argo will look for traefik-values.yml file in the repoURL (so, not in the location where Application file is), and it obviously doesn't exist there.

You can check more about this issue here. There you can also find a couple of proposed solutions. Some of them are:

  • a plugin to do a helm template with your values files
  • a custom CI pipeline to take the content of your values.yaml file and add it to Application manifest
  • putting values directly in Application manifest, skipping the values.yaml file altogether
  • having a chart that depends on a chart like here (I don't like this one as it is downloading twice from two different locations, plus this issue)
  • play around with kustomize
  • or wait for ArgoCD 2.5, it seems it will include a native solution out of the box, according to mentioned github issue
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.