Who gets into Argo CD
and what they can do.
Four scenarios: login through LDAP, login through Active Directory, an Argo CD role for each group, and restricting who reaches the pods. Each one covers: the chart default, what changes in the cluster, and the values file commented line by line.
The tdp-argo chart starts Argo CD with only the local admin account, with no directory login, no RBAC policy and no NetworkPolicy. Security is turned on in the values file: login through LDAP or Active Directory goes through Dex, with the bind credentials in a Secret created by you; the RBAC policy gives each group a role; and a custom NetworkPolicy restricts who reaches the pods. The initial admin password and how to change it are in the first contact of the Argo CD Configuration.
Your environment
If you fill in your environment details here, the examples and commands on the page use what you entered. The namespace, the release name and the values file are your choices, not the chart's.
Scenarios
- 1 · Login through LDAP
- 2 · Active Directory
- 3 · Roles and groups
- 4 · Network
Dex on, the bind credentials in a Secret and the connector that looks up users and groups.
You want each person to sign in to Argo CD with the company directory account, and not with the local admin account. Argo CD does this login through Dex, a built-in identity provider that comes off. Turning it on means writing three things: a Secret with the technical bind account and its password, created before the installation; the LDAP connector in dex.config, with the directory address, where to look up users and where to look up groups; and dex.enabled: true. The bind password does not go in the values file: the connector reads it from the Secret, by reference.
Dex off (dex.enabled) and dex.config empty: the login screen does not show the SSO button. Helm creates argocd-secret (configs.secret.createSecret).
Argo CD installed as in the first contact of the Configuration, and the UI reachable at the address that goes in configs.cm.url (Publish at a URL).
The configs.cm.url is already https://argo. followed by the TDP_DOMAIN domain. A new ./deploy.sh --install rebuilds the Argo CD values from the variables file and discards manual adjustments.
The login path, with and without LDAP
Who signs in to Argo CD
- Who signs in. Only the local admin account, with the password generated on first start, which you change after the first login. Chart default:
local admin account. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url)
Who signs in to Argo CD: Only the admin account (default)
- Who signs in. Only the local admin account, with the password generated on first start, which you change after the first login. Chart default:
local admin account. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url)
Who signs in to Argo CD: LDAP users
- Who signs in. Each person clicks the SSO button on the login screen and signs in with the directory account. The username and password form keeps serving only the local Argo CD accounts. Chart default:
local admin account. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url) - Dex. Built-in identity provider. With the technical account from the Secret, it looks up the user in the directory, checks the password and returns to Argo CD who signed in and, with groupSearch, their groups. Chart default:
off. (tdp-argo.dex.enabled: true · tdp-argo.configs.cm.dex.config) - Bind credentials Secret. Created by you before the installation, with the dex.ldap.bindDN and dex.ldap.bindPW keys, which the connector reads by reference. With createSecret: false, Helm does not manage it, and it stays in the namespace after helm uninstall. Chart default:
Helm creates argocd-secret. (tdp-argo.configs.secret.createSecret: false) - LDAP server. The company directory. The technical account looks up the user by uid and the groups they are a member of. Chart default:
none.
Admin account only. The chart starts with no connector in Dex, and only the local admin account signs in. Admin account only: Best suited when Argo CD runs in the lab or in a cluster operated by a single person.
1tdp-argo:2configs:3 cm:4 dex.config: ""5 secret:6 createSecret: true7dex:8 enabled: false
With no connector, the login screen does not show the SSO button.
- No connector (linha 4). With no connector, the login screen does not show the SSO button.
- Secret managed by Helm (linha 6). Helm creates and manages argocd-secret.
- Dex off (linha 8). Only the local admin account signs in. For the company directory, switch above to LDAP users.
LDAP users. Each person signs in through the SSO button with the directory account: Dex validates the username and password against LDAP and hands Argo CD who signed in and their groups. LDAP users: Best suited when Argo CD leaves the lab and each person should sign in with the company directory account. For an Active Directory, see scenario 2.
1tdp-argo:2configs:3 cm:4 url: https://<ARGOCD_HOSTNAME>5 dex.config: |6 connectors:7 - type: ldap8 id: ldap9 name: LDAP10 config:11 host: "<LDAP_HOST>:389"12 insecureNoSSL: true13 insecureSkipVerify: true14 bindDN: "$dex.ldap.bindDN"15 bindPW: "$dex.ldap.bindPW"16 userSearch:17 baseDN: "cn=users,cn=accounts,dc=<LDAP_DOMAIN>,dc=com"18 filter: "(objectClass=person)"19 username: uid20 idAttr: uid21 emailAttr: mail22 nameAttr: givenName23 groupSearch:24 baseDN: "cn=groups,cn=accounts,dc=<LDAP_DOMAIN>,dc=com"25 filter: "(objectClass=groupOfNames)"26 userMatchers:27 - userAttr: DN28 groupAttr: member29 nameAttr: cn3031 secret:32 createSecret: false3334dex:35 enabled: true
Exactly the address opened in the browser: same protocol, host and port. The login is a round-trip OIDC flow through Dex, and the return is built with this URL.
- Public URL (linha 4). Exactly the address opened in the browser: same protocol, host and port. The login is a round-trip OIDC flow through Dex, and the return is built with this URL.
- Connector name (linha 9). Names the login screen button: LOG IN VIA LDAP.
- Server (linha 11). Directory address as seen from inside the cluster.
- No TLS (linha 12). With true, the connection to the directory does not use TLS, and the certificate is not verified (line 13). For LDAPS, in production, use false with the directory certificates.
- Bind credentials (linha 14). References to the dex.ldap.bindDN and dex.ldap.bindPW keys of the argocd-secret Secret. The values stay only in the Secret.
- Where to look up users (linha 17). Base of the user search in the directory. Adjust it to your directory.
- Login name (linha 19). The attribute the person types as the username.
- Email and name (linha 21). The attributes Dex hands to Argo CD as the email and name of whoever signed in.
- Group search (linha 23). Makes Dex return the user's groups. Without this block, the group rules of the RBAC policy (scenario 3) never apply.
- Who is a member (linha 27). The user DN must be in the group member attribute.
- Group name (linha 29). The attribute handed to Argo CD as the group name. This name goes in the g rules of the RBAC policy.
- Secret outside Helm (linha 32). Helm does not manage argocd-secret: it is the Secret you created with the bind credentials.
- Dex on (linha 35). Starts Dex, which does the login against the directory.
Create the Secret with the bind credentials
The connector reads the bind account and password from this Secret. It exists before the installation, so Helm does not try to manage it.
If the namespace does not exist yet, create it before the Secret with kubectl create namespace <NAMESPACE>.
kubectl create secret generic argocd-secret \
--from-literal=dex.ldap.bindDN="uid=<LDAP_BIND_USER>,cn=users,cn=accounts,dc=<LDAP_DOMAIN>,dc=com" \
--from-literal=dex.ldap.bindPW="<LDAP_BIND_PASSWORD>" \
-n <NAMESPACE>
Replace <LDAP_BIND_PASSWORD> with the technical account password. It stays only in the command and in the Secret.
Add the connector to the values file
Replace the URL, the server and the domain with yours.
<ARGOCD_HOSTNAME> is the UI address in the browser; <LDAP_HOST>, the directory address as seen from inside the cluster; <LDAP_DOMAIN>, the domain component of the DN. Adjust baseDN and filter for users and groups to your directory.
Apply to the release
Dex starts and the login screen gets the SSO button.
helm upgrade --install <RELEASE_NAME> \
oci://registry.tecnisys.com.br/tdp/charts/tdp-argo \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>
Without --version, Helm installs the latest published version.
It worked when
kubectl get pods -n <NAMESPACE> | grep dex
kubectl get svc -n <NAMESPACE> | grep dex
The Dex pod and Service appear.
Sign in with the directory account
The login goes through the SSO button, not the username and password form.
In the UI, at https://<ARGOCD_HOSTNAME>, click LOG IN VIA LDAP, below the form, and sign in with the directory username and password. The username and password form serves only the local Argo CD accounts. Through the CLI:
argocd login <ARGOCD_HOSTNAME> --sso
It worked when
If the login fails
Bind and directory search errors are in the Dex log. Login and RBAC errors, in the server log. The Dex image has no LDAP client: check the bind and search result of a login attempt in the log.
kubectl logs -n <NAMESPACE> deployment/tdp-argocd-dex-server --since=10m | grep -i ldap
kubectl logs -n <NAMESPACE> deployment/tdp-argocd-server -f
The most common messages are in When something goes wrong.
Query the directory from inside the clusterOpcional
Only if the Dex log is not enough: ldapsearch, in a temporary pod, shows whether the bind account finds the user.
Use an image that has ldapsearch, for example an OpenLDAP client image available in your registry. The -W asks for the bind password in the terminal.
kubectl run ldap-test -n <NAMESPACE> --rm -it --restart=Never \
--image=<LDAPSEARCH_IMAGE> -- \
ldapsearch -x -H ldap://<LDAP_HOST>:389 \
-D "uid=<LDAP_BIND_USER>,cn=users,cn=accounts,dc=<LDAP_DOMAIN>,dc=com" -W \
-b "cn=users,cn=accounts,dc=<LDAP_DOMAIN>,dc=com" \
"(uid=<LDAP_USER>)"
It worked when
After helm uninstall. The argocd-secret created by you does not carry the release label and stays in the namespace. Delete it by name if you will no longer use it.
The same connector, with the sAMAccountName, the CN-based tree and the AD groups.
The company directory is an Active Directory (AD). Argo CD uses the same Dex LDAP connector, and the configuration starts from the one in scenario 1 with five adjustments. In AD, the person signs in with the sAMAccountName, but the account DN is built from the cn. That is why the technical account first looks up the user and only then checks their password.
- Login name. In
userSearch, setusername: sAMAccountNameandidAttr: sAMAccountName. - Where the accounts are. In AD, users and groups are in the domain
CN=Users. SetbaseDN: "CN=Users,DC=<DOMAIN>,DC=<TLD>"inuserSearchand ingroupSearch. - Technical account by full DN. In the Secret, set
dex.ldap.bindDN="CN=<BIND_USER>,CN=Users,DC=<DOMAIN>,DC=<TLD>". An AD account withoutuserPrincipalNamedoes not bind in theaccount@domainformat. Always use the DN. - Email and name. AD accounts often have no
mail. SetemailAttr: userPrincipalNameandnameAttr: cn. - Groups. Set
filter: "(objectClass=group)"ingroupSearch, so Dex returns the AD groups to the RBAC policy (scenario 3).
The login screen button carries the connector name: LOG IN VIA Active Directory. The Secret, the URL and the procedure are those of scenario 1. The complete file is right below, with each line explained.
Login through Active Directory
- Who signs in. Each person clicks the SSO button on the login screen and signs in with the directory account. The username and password form keeps serving only the local Argo CD accounts. Chart default:
local admin account. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url) - Dex. Built-in identity provider. With the technical account from the Secret, it looks up the user in the directory, checks the password and returns to Argo CD who signed in and, with groupSearch, their groups. Chart default:
off. (tdp-argo.dex.enabled: true · tdp-argo.configs.cm.dex.config) - Bind credentials Secret. Created by you before the installation, with the dex.ldap.bindDN and dex.ldap.bindPW keys, which the connector reads by reference. With createSecret: false, Helm does not manage it, and it stays in the namespace after helm uninstall. Chart default:
Helm creates argocd-secret. (tdp-argo.configs.secret.createSecret: false) - Active Directory. The domain controller. The person signs in with the sAMAccountName. The technical account looks up the user in CN=Users and only then checks their password. Chart default:
none.
1tdp-argo:2configs:3 cm:4 url: https://<ARGOCD_HOSTNAME>5 dex.config: |6 connectors:7 - type: ldap8 id: ldap9 name: Active Directory10 config:11 host: "<AD_HOST>:389"12 insecureNoSSL: true13 insecureSkipVerify: true14 bindDN: "$dex.ldap.bindDN"15 bindPW: "$dex.ldap.bindPW"16 usernamePrompt: "Username"17 userSearch:18 baseDN: "CN=Users,DC=<DOMAIN>,DC=<TLD>"19 filter: "(objectClass=person)"20 username: sAMAccountName21 idAttr: sAMAccountName22 emailAttr: userPrincipalName23 nameAttr: cn24 groupSearch:25 baseDN: "CN=Users,DC=<DOMAIN>,DC=<TLD>"26 filter: "(objectClass=group)"27 userMatchers:28 - userAttr: DN29 groupAttr: member30 nameAttr: cn3132 secret:33 createSecret: false3435dex:36 enabled: true
Exactly the address opened in the browser, with the same port. When exposing through Gateway API, use the port the browser uses, which may differ from the listener's.
- Public URL (linha 4). Exactly the address opened in the browser, with the same port. When exposing through Gateway API, use the port the browser uses, which may differ from the listener's.
- Connector name (linha 9). Names the login screen button: LOG IN VIA Active Directory.
- Domain controller (linha 11). AD address as seen from inside the cluster.
- No TLS (linha 12). For LDAPS, in production, use false with the AD certificates and the LDAPS port of the domain controller.
- Bind credentials (linha 14). Read from the argocd-secret Secret. In AD, the bindDN is the full DN of the technical account (adjustment 3).
- Field label (linha 16). The label of the username field on the Dex login screen.
- Search base (linha 18). The domain CN=Users container (adjustment 2).
- sAMAccountName (linha 20). The login name of the AD accounts (adjustment 1).
- userPrincipalName (linha 22). Used as the email, because AD accounts often have no mail (adjustment 4).
- AD groups (linha 24). Makes Dex return the groups the user is a member of. Without this block, only the general rule and the per-user rules of the RBAC policy apply.
- Group class (linha 26). In AD, groups are of the group class (adjustment 5).
- Group name (linha 30). The group cn, for example app-users, is the name that goes in the g rules of the RBAC policy.
Create the Secret with the bind credentials
The same Secret as in scenario 1, with the full DN of the AD technical account.
kubectl create secret generic argocd-secret \
--from-literal=dex.ldap.bindDN="CN=<BIND_USER>,CN=Users,DC=<DOMAIN>,DC=<TLD>" \
--from-literal=dex.ldap.bindPW="<LDAP_BIND_PASSWORD>" \
-n <NAMESPACE>
Apply to the release
Dex starts with the AD connector.
helm upgrade --install <RELEASE_NAME> \
oci://registry.tecnisys.com.br/tdp/charts/tdp-argo \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>
Publish the UI at the URL host
The login return only works when the browser address and configs.cm.url are the same.
Expose the UI through Ingress or Gateway API, on the same host set in configs.cm.url, as in Publish at a URL.
Sign in with the AD account
Through the SSO button, with the sAMAccountName and the AD password.
It worked when
sAMAccountName and the AD password.If the login fails with Invalid redirect URL
configs.cm.url differs from the address opened in the browser in protocol, host or port. Set it exactly as the browser URL.
The RBAC policy that says what each group can do in Argo CD.
With directory login working, you want to decide what each person can do in Argo CD according to their group. This lives in the RBAC policy, in configs.rbac, which the chart writes to the argocd-rbac-cm ConfigMap and which comes empty. The policy joins three types of rule: the group mapping from the directory to Argo CD roles; the permissions of a role created by you; and the default assignment, which gives a role to every authenticated user. Anyone who matches no rule gets the policy.default role. The policy is the same for LDAP and for Active Directory.
configs.rbac not defined: no default role.
Directory login (scenario 1 or 2), with the groupSearch block in the connector.
Group rules (g, <group>, …) only apply when the connector has the groupSearch block, and the group name is the groupSearch.nameAttr value. Without that block, Dex does not send groups and the group rules never apply: only the general rule (g, *, …) and the per-user rules (g, <USERNAME>, role:admin).
The role of each group in Argo CD
- Who signs in. Each person clicks the SSO button on the login screen and signs in with the directory account. The username and password form keeps serving only the local Argo CD accounts. Chart default:
local admin account. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url) - Dex. Built-in identity provider. With the technical account from the Secret, it looks up the user in the directory, checks the password and returns to Argo CD who signed in and, with groupSearch, their groups. Chart default:
off. (tdp-argo.dex.enabled: true · tdp-argo.configs.cm.dex.config) - Bind credentials Secret. Created by you before the installation, with the dex.ldap.bindDN and dex.ldap.bindPW keys, which the connector reads by reference. With createSecret: false, Helm does not manage it, and it stays in the namespace after helm uninstall. Chart default:
Helm creates argocd-secret. (tdp-argo.configs.secret.createSecret: false) - LDAP server. The company directory. The technical account looks up the user by uid and the groups they are a member of. Chart default:
none. - RBAC policy. Written from configs.rbac. g lines associate groups and users with roles. P lines give permissions to a role. Anyone who matches no rule gets the policy.default role. Chart default:
not defined. (tdp-argo.configs.rbac)
1tdp-argo:2configs:3 rbac:4 policy.default: role:readonly5 policy.csv: |6 # LDAP Group mappings7 g, devops-admins, role:admin8 g, data-platform, role:admin9 g, data-read, role:readonly1011 # Default role for authenticated LDAP users12 p, role:ldap-user, applications, get, default/*, allow13 p, role:ldap-user, applications, sync, default/*, allow14 p, role:ldap-user, applications, override, default/*, allow15 p, role:ldap-user, clusters, get, *, allow16 g, *, role:ldap-user
The role of anyone who matches no rule. role:readonly and role:admin are built-in Argo CD roles.
- Default role (linha 4). The role of anyone who matches no rule. role:readonly and role:admin are built-in Argo CD roles.
- Group mapping (linha 7). Each g line associates a directory group with an Argo CD role. The group name is the groupSearch.nameAttr value. In AD, the group cn.
- Example groups (linha 9). devops-admins, data-platform and data-read are examples. With names that do not exist in your directory, the rules apply to no one.
- Permissions of a role (linha 12). The fields are p, role, resource, action, object and effect. For applications, the object is project/application: default/* is all the Applications of the default project. The effect is allow or deny.
- Clusters (linha 15). The ldap-user role can also query the registered clusters.
- Default assignment (linha 16). Every authenticated user gets the ldap-user role. It applies even without groupSearch.
Write the policy in the values file
The groups of your directory, each with the role it should have.
Replace the example groups with the names Dex hands over, the groupSearch.nameAttr ones. To give a role to a specific person, use a per-user rule, such as g, <USERNAME>, role:admin.
Apply to the release
The chart writes the policy to the argocd-rbac-cm ConfigMap.
helm upgrade --install <RELEASE_NAME> \
oci://registry.tecnisys.com.br/tdp/charts/tdp-argo \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>
It worked when
If the user signs in with no permission
Check configs.rbac.policy.csv and the group names in the directory. The RBAC evaluation messages are in the server log:
kubectl logs -n <NAMESPACE> deployment/tdp-argocd-server -f
The upstream policies and a custom NetworkPolicy for trusted namespaces.
Here you decide where traffic can reach the Argo CD pods from. By default, the chart creates no NetworkPolicy, and traffic to those pods is open. For production, the recommendation is to accept ingress only from trusted namespaces. The chart turns on the NetworkPolicies of the upstream chart, but they allow all ingress and have no values to change the rules. For a real restriction, you apply a custom NetworkPolicy, outside the chart.
global.networkPolicy.create: false: no NetworkPolicy, traffic allowed.
The traffic that reaches the pods
What controls traffic to the pods
- Who signs in. Only the local admin account, with the password generated on first start, which you change after the first login. Chart default:
local admin account. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url)
What controls traffic to the pods: Nothing (default)
- Traffic source. Without a NetworkPolicy, or with the upstream policies, which allow all ingress, any pod in the cluster reaches the Argo CD pods. Chart default:
ingress allowed. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url)
What controls traffic to the pods: Upstream policies
- Traffic source. Without a NetworkPolicy, or with the upstream policies, which allow all ingress, any pod in the cluster reaches the Argo CD pods. Chart default:
ingress allowed. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url) - Upstream policies. Created by the upstream chart with global.networkPolicy.create. They allow all ingress and have no values to change the rules. Chart default:
no NetworkPolicy. (tdp-argo.global.networkPolicy.create: true)
What controls traffic to the pods: Custom NetworkPolicy
- Sources outside the list. With the custom NetworkPolicy, only the pods of the namespaces listed in it reach the Argo CD pods. Chart default:
ingress allowed. - Argo CD server. UI and API. The configs.cm.url URL must be exactly the address opened in the browser: protocol, host and port. It is what the SSO login uses to return to Argo CD. Chart default:
configs.cm.url: https://argo.tdp.local. (tdp-argo.configs.cm.url) - Custom NetworkPolicy. Applied by you, outside the chart. It selects all pods in the namespace and only accepts ingress from the listed namespaces. Chart default:
no NetworkPolicy. - Trusted namespace. The namespace listed in the custom NetworkPolicy. Its pods keep reaching the Argo CD pods. Chart default:
none.
Nothing. The chart creates no NetworkPolicy, and traffic to the pods is open. Nothing: Best suited when Argo CD does not run in production. In production, the recommendation is to accept ingress only from trusted namespaces.
1tdp-argo:2global:3 networkPolicy:4 create: false
The chart creates no NetworkPolicy and traffic is open. To restrict it, switch above to Custom NetworkPolicy.
- No NetworkPolicy (linha 4). The chart creates no NetworkPolicy and traffic is open. To restrict it, switch above to Custom NetworkPolicy.
Upstream policies. The chart creates the NetworkPolicies of the upstream chart. They allow all ingress and have no values to change the rules. Upstream policies: Best suited when you want the upstream NetworkPolicies in the namespace, without restricting ingress.
1tdp-argo:2global:3 networkPolicy:4 create: true5 defaultDenyIngress: false
The upstream chart creates its NetworkPolicies. They allow all ingress and have no values to change the rules.
- Upstream policies (linha 4). The upstream chart creates its NetworkPolicies. They allow all ingress and have no values to change the rules.
- No default block (linha 5). Keeps off the policy that would deny all ingress.
Apply to the release
The upstream NetworkPolicies now exist in the namespace.
helm upgrade --install <RELEASE_NAME> \
oci://registry.tecnisys.com.br/tdp/charts/tdp-argo \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>
It worked when
kubectl -n <NAMESPACE> get networkpolicy
The upstream NetworkPolicies appear in the list.
Custom NetworkPolicy. A manifest applied separately, outside the chart, accepts ingress to the Argo CD pods only from the namespaces listed. Custom NetworkPolicy: Best suited when Argo CD runs in production, where the recommendation is to accept ingress only from trusted namespaces.
1apiVersion: networking.k8s.io/v12kind: NetworkPolicy3metadata:4name: argocd-restrict-ingress5namespace: <NAMESPACE>6spec:7podSelector: {}8policyTypes:9 - Ingress10ingress:11 - from:12 - namespaceSelector:13 matchExpressions:14 - key: kubernetes.io/metadata.name15 operator: In16 values:17 - <TRUSTED_NAMESPACE>
The policy applies to the namespace where Argo CD runs.
- Argo CD namespace (linha 5). The policy applies to the namespace where Argo CD runs.
- All pods (linha 7). Empty selector: the policy applies to all pods in the namespace.
- Ingress only (linha 9). The policy controls the traffic that reaches the pods.
- Source namespaces (linha 14). Only pods from the listed namespaces reach the Argo CD pods.
- Trusted namespace (linha 17). Replace it with the authorized namespace. The list accepts more than one.
Apply the manifest
Save the manifest above to a file and apply it to the cluster.
kubectl apply -f <FILE_NAME>
It worked when
kubectl -n <NAMESPACE> get networkpolicy argocd-restrict-ingress
The NetworkPolicy appears in the Argo CD namespace.
When something goes wrong
Troubleshooting
Paste the error message or pick the symptom. The answer comes with the cause, what to do and the command.
- no such host for tdp-argocd-dex-server. Cause: Dex is off, so its Service does not exist. What to do: Turn on tdp-argo.dex.enabled: true and apply it to the release.
- config referenced key does not exist in secret. Cause: The dex.config references keys that do not exist in the Secret, or the Secret is not named argocd-secret. What to do: The Secret must be named argocd-secret and have the dex.ldap.bindDN and dex.ldap.bindPW keys.
- Invalid username or password. Cause: Dex cannot reach the directory, the bind account or password are wrong, or the search base and filter do not find the user. What to do: Check the bind and search result in the Dex log. Then check the connectivity to the directory, the bindDN and the password, userSearch.baseDN and filter, and the LDAP server logs.
- User signs in but has no permission. Cause: Their group is not mapped in policy.csv, or the connector has no groupSearch and Dex does not send groups. What to do: Check configs.rbac.policy.csv and the group names, which are the groupSearch.nameAttr value. The RBAC evaluation messages are in the server log.
- Invalid redirect URL. Cause: configs.cm.url is different from the address opened in the browser: protocol, host or port. What to do: Set configs.cm.url exactly as the URL used in the browser. When exposing through Gateway API, use the port the browser uses, not the listener's.
- Directory user cannot sign in through the username and password form. Cause: The username and password form serves only the local Argo CD accounts. What to do: Sign in with the LOG IN VIA button, with the connector name, below the form. In the CLI, use argocd login with --sso.
Best practices
- Change the
adminpassword after the first login and delete theargocd-initial-admin-secret, as in the first contact of the Configuration. - Keep the bind credentials in the
argocd-secretSecret, withcreateSecret: false, and never in the values file, which would end up versioned. - In production, connect Dex to the directory through LDAPS, with
insecureNoSSL: falseand the directory certificates. - In production, accept ingress to the Argo CD pods only from trusted namespaces, with a custom NetworkPolicy (scenario 4).
All parameters
The chart prefix is already filled in.
8 of 8 parameters
| Parameter | Description | Chart default |
|---|---|---|
tdp-argo.dex.enabledLogin | Turns on Dex, which does the login through LDAP or Active Directory | false |
tdp-argo.configs.cm.dex.configLogin | Dex connectors (LDAP, Active Directory) | "" |
tdp-argo.configs.cm.urlLogin | Public URL of Argo CD. Same as the browser one, including the port | https://argo.tdp.local |
tdp-argo.configs.secret.createSecretLogin | Helm creates the argocd-secret. false when you create it with the bind credentials | true |
tdp-argo.configs.rbac.policy.defaultAuthorization | Role of anyone who matches no rule | not defined |
tdp-argo.configs.rbac.policy.csvAuthorization | g rules (groups and users to roles) and p rules (permissions of a role) | not defined |
tdp-argo.global.networkPolicy.createNetwork | Creates the upstream NetworkPolicies, which allow all ingress | false |
tdp-argo.global.networkPolicy.defaultDenyIngressNetwork | Policy that denies all ingress | not defined |
Next steps
Publishing
Publish at a URL
Ingress or Gateway API on the configs.cm.url host, required for SSO login.