πŸš€ Argo CD Master Guide: Fully Conquering argocd-cm Core Properties

Hello everyone! Today, we’re going to dive deep into the argocd-cm configuration, which is like the heart of Argo CD, the most powerful tool for realizing GitOps in a Kubernetes environment. πŸ› οΈ

If you want to go beyond simple installation, enhance security, check custom statuses, and efficiently manage resources, please read this article to the end!


1. πŸ›‘οΈ Enable GPG Signature Verification (gpg.enabled)

Security cannot be overemphasized. When you want to verify that content committed to a Git repository was indeed authored by a trusted user, you use GPG (GNU Privacy Guard) signature verification.

  • Role: Ensures Argo CD verifies the GPG signature of a commit when fetching manifests from Git.
  • Reason for setting: Even if an unauthorized user tampers with and pushes code, if the signature is invalid, Argo CD will refuse to synchronize, thereby protecting the cluster.

πŸ’» Configuration Code Example

YAML

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
  namespace: argocd
data:
  # Enable GPG signature verification πŸ”
  gpg.enabled: "true"

πŸ’‘ Note: After enabling this setting, you must register public keys with Argo CD. Please add trusted keys using the argocd gpg add command!


2. πŸ₯ Custom Resource Health Check (resource.customizations.health)

Argo CD can inherently determine the status (Healthy, Progressing, etc.) of standard resources like Deployments and Services. However, for CRDs (Custom Resource Definitions) or certain open-source resources, Argo CD might not be able to determine “Is this normal?” and may remain in a perpetually Progressing state.

This is where Lua scripts come in handy for custom health checks.

πŸ’» Configuration Code Example (e.g., SealedSecrets resource)

YAML

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
  namespace: argocd
data:
  # Define custom health check logic per resource 🩺
  resource.customizations.health.bitnami.com_SealedSecret: |
    hs = {}
    -- λ¦¬μ†ŒμŠ€μ˜ status ν•„λ“œκ°€ μžˆλŠ”μ§€ 확인
    if obj.status ~= nil then
      -- 쑰건별 μƒνƒœ 둜직 μž‘μ„± (Lua 문법)
      if obj.status.observedGeneration < obj.metadata.generation then
        hs.status = "Progressing"
        hs.message = "λŒ€κΈ° 쀑: μƒˆλ‘œμš΄ 사양 반영 쀑..."
        return hs
      end
    end
    hs.status = "Healthy"
    hs.message = "정상: μ‹œν¬λ¦Ώμ΄ μ„±κ³΅μ μœΌλ‘œ λ³΅ν˜Έν™”λ˜μ—ˆμŠ΅λ‹ˆλ‹€."
    return hs
  • Important: The format resource.customizations.health._ must be followed.
  • Tip: For performance, it’s better to simply read the resource’s status field value rather than performing complex operations.

3. πŸŽ–οΈ Enable Status Badge (statusbadge.enabled)

Do you want to quickly show your team whether a currently running service is successfully synchronized (Synced) or if there’s an issue? Try adding an Argo CD badge to your GitHub README or internal dashboards!

  • Feature: Allows external parties to retrieve the synchronization status of a specific Application in the form of an image link.

πŸ’» Configuration Code Example

YAML

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
  namespace: argocd
data:
  # Enable status badge feature 🎨
  statusbadge.enabled: "true"

After activation, you can use the badge via the following URL format: https:///api/badge?name=


4. πŸ—οΈ Kustomize Binary Version Management (kustomize.binary.path)

Many teams use Kustomize for manifest management. Argo CD uses its built-in Kustomize version, but sometimes specific version features are needed, or a security-patched, newer version must be specified separately.

πŸ’» Configuration Code Example

First, you need to mount a volume containing the desired version of the binary to the Argo CD Repo Server container or build a custom image. Then, specify the path in argocd-cm.

YAML

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
  namespace: argocd
data:
  # Specify path for a specific Kustomize version πŸ› οΈ
  #(The binary must be located at this path beforehand)
  kustomize.path.v4.5.7: "/usr/local/bin/kustomize-4-5-7"

   # Or custom flags can be added via build options
  kustomize.buildOptions: "--load-restrictor LoadRestrictionsNone"

Hold on! As mentioned in a previous discussion, if you want to support multiple versions, you can use the kustomize.path.vX.X.X format to flexibly respond to different development environments.


πŸ“ Full Configuration Summary (Full YAML)

Here’s what the argocd-cm file looks like, combining all the details explained above. Please read the comments carefully!

YAML

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
  namespace: argocd
  labels:
    app.kubernetes.io/part-of: argocd
data:
   # 1. Security settings: GPG signature verification
  gpg.enabled: "true"

   # 2. Visibility: Expose status badge
  statusbadge.enabled: "true"

   # 3. Kustomize: Configure specific version usage
   # Multiple versions can be specified as needed.
  kustomize.path.v5.0.0: "/custom-bin/kustomize"

   # 4. Status management: Custom resource (e.g., Argo Rollouts) health check
   # Helps Argo CD determine the success of non-standard resources.
  resource.customizations.health.argoproj.io_Rollout: |
    hs = {}
    if obj.status ~= nil then
      if obj.status.phase == "Paused" then
        hs.status = "Suspended"
        hs.message = "배포가 μΌμ‹œ μ€‘μ§€λ˜μ—ˆμŠ΅λ‹ˆλ‹€ (Canary/BlueGreen)"
        return hs
      end
    end
    hs.status = "Healthy"
    return hs

   # 5. Other useful settings (including past discussions)
   # Used when customizing the Help menu in the UI
  help.chat.url: "https://slack.com/your-channel"
  help.chat.text: "데브옡슀 νŒ€μ—κ²Œ λ¬Έμ˜ν•˜κΈ°"

πŸ’‘ Conclusion

The argocd-cm properties we covered today are essential elements that elevate Argo CD from a simple deployment tool to an enterprise-grade GitOps platform.

In particular, health checks via resource.customizations are a game-changer for increasing the reliability of Argo CD’s dashboard in complex microservice architectures. 🎯

Why not apply these to your cluster right now? If you have any questions, please leave a comment!



Comments

Leave a Reply

Your email address will not be published. Required fields are marked *