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:-
repositoryfor Git repositories -
repo-credsfor OCI registries
-
-
Secrets must include a
url,typeandnamefield-
urlis the URL of the repository or registry -
typecan begitfor Git repositories orhelmfor OCI registries -
nameis 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 |
( |
SSH with private key |
|
GitHub App integration |
( |
OCI Helm registry |
( |
For more information and advanced options, refer to the official Argo CD documentation:
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-----
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
-
Argo CD must be installed and running.
-
Argo CD CLI must be installed (see CLI Installation Guide).
-
You must log in to the Argo CD API server (see Login Instructions).
Usage
Argo CD CLI offers two commands for configuring access to private Git repositories and Helm OCI registries:
| Command | Purpose |
|---|---|
|
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. |
|
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:
-
argocd repo documentation
-
argocd repocreds documentation
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 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. |
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 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. |