Authentication

This section describes how to configure authentication for accessing private Git repositories and OCI registries with Argo CD.

Authentication ensures that Argo CD can securely identify itself to external sources and retrieve the Git configuration and OCI Helm artifacts required for deploying PAS-X MES. Depending on your operational model and security requirements, authentication can be configured either declaratively using Kubernetes Secrets or imperatively via the Argo CD CLI.

Choose the method that best aligns with your deployment strategy (GitOps-driven or CLI-based setup).

Supported Methods

Method Suitable For

Declarative Secret-Based Configuration

Recommended for users preferring plain Kubernetes manifests and GitOps-first workflows. This approach is flexible and can be executed either before or after the Argo CD installation.

CLI-Based Configuration

Users who are comfortable with the Argo CD CLI and prefer an imperative setup after Argo CD is running.

Declarative Secret-Based Configuration

Argo CD supports configuring access to private Git and OCI sources by defining Secrets in the same Kubernetes namespace as the Argo CD installation. Argo CD automatically discovers and uses these Secrets.

Requirements:

  • Secret must exist in the same namespace as Argo CD.

  • Secret must be of type Opaque.

  • Secret must have a label argocd.argoproj.io/secret-type:

    • repository for Git repositories

    • repo-creds for OCI registries

  • Secrets must include a url, type and name field

    • url is the URL of the repository or registry

    • type can be git for Git repositories or helm for OCI registries

    • name is a unique identifier for the repository or registry

  • Additional authentication fields depend on your connection method (see below)

For more information and advanced options, refer to the official Argo CD documentation:

Connection Methods and additional Required Fields

Depending on the connection type, additional data fields are required:

Use Case Required Fields

HTTPS with username/password

username, password

(tlsClientCertData, tlsClientCertKey → only required if mTLS is enforced)

SSH with private key

sshPrivateKey

GitHub App integration

githubAppPrivateKey, githubAppID, githubAppInstallationID

(tlsClientCertData, tlsClientCertKey → only required if mTLS is enforced)

OCI Helm registry

username, password, enableOCI: "true"

(tlsClientCertData, tlsClientCertKey → only required if mTLS is enforced)

For more information and advanced options, refer to the official Argo CD documentation:

Example: YAML manifest for a Git Repository Secret with Username/Password and optional mTLS
apiVersion: v1
kind: Secret
metadata:
  name: argocd-repo-my-git
  namespace: <my-namespace>
  labels:
    argocd.argoproj.io/secret-type: repository
type: Opaque
stringData:
  name: "<name>"
  url: "<url>"
  type: "git"
  username: "<username>"
  password: "<token>"

  # Optional – only required if the server enforces mutual TLS (mTLS)
  tlsClientCertData: |
    -----BEGIN CERTIFICATE-----
    <client-certificate-pem>
    -----END CERTIFICATE-----

  tlsClientCertKey: |
    -----BEGIN PRIVATE KEY-----
    <client-private-key-pem>
    -----END PRIVATE KEY-----
Example: YAML manifest for an OCI Registry Secret
apiVersion: v1
kind: Secret
metadata:
  name: argocd-creds-my-oci
  namespace: <my-namespace>
  labels:
    argocd.argoproj.io/secret-type: repo-creds
type: Opaque
stringData:
  name: "<name>"
  url: "<url>"
  type: "helm"
  username: "<username>"
  password: "<token>"
  enableOCI: "true"

  # Optional – only required if the server enforces mutual TLS (mTLS)
  tlsClientCertData: |
    -----BEGIN CERTIFICATE-----
    <client-certificate-pem>
    -----END CERTIFICATE-----

  tlsClientCertKey: |
    -----BEGIN PRIVATE KEY-----
    <client-private-key-pem>
    -----END PRIVATE KEY-----

CLI-Based Configuration

As an alternative to declarative secrets, you can use the Argo CD CLI to configure the repository and registry access interactively. This method stores the credentials as Kubernetes Secrets in the Argo CD namespace in the background.

Prerequisites

Usage

Argo CD CLI offers two commands for configuring access to private Git repositories and Helm OCI registries:

Command Purpose

argocd repo add

Registers a specific repository with connection credentials. Required when you want Argo CD to explicitly manage that repository as part of its configuration. Use this when you want to define a named repository with credentials and sync settings.

argocd repocreds add

Adds credentials for one or more registries that share a common URL prefix. This is useful when working with multiple registries hosted under the same domain or when you want to apply shared authentication settings.

The required parameters depend on your authentication method. For further details, refer to the official Argo CD documentation:

Example: Argo CD CLI command to add a Git repository with Username/Password and optional mTLS
argocd repo add <git-url> \
  --type git \
  --name <name> \
  --username <username> \
  --password <token-or-password> \
  --client-crt <client-cert-file> \
  --client-crt-key <client-cert-key-file>

The flags --client-cert and --client-cert-key are optional.

They are only required if the Git repository enforces mutual TLS (mTLS). If mTLS is not configured on the server side, these parameters must be omitted.

Example: Argo CD CLI command to add an OCI Helm registry
argocd repocreds add <oci-registry-url> \
  --enable-oci \
  --type helm \
  --username <username> \
  --password <token-or-password>\
  --client-crt <client-cert-file> \
  --client-crt-key <client-cert-key-file>

The flags --client-cert and --client-cert-key are optional.

They are only required if the Git repository enforces mutual TLS (mTLS). If mTLS is not configured on the server side, these parameters must be omitted.