{"id":408,"date":"2023-11-11T23:58:45","date_gmt":"2023-11-11T23:58:45","guid":{"rendered":"https:\/\/devopsopen.com\/?p=408"},"modified":"2025-04-11T12:42:27","modified_gmt":"2025-04-11T12:42:27","slug":"install-argocd-cli-and-add-users","status":"publish","type":"post","link":"https:\/\/devopsopen.com\/index.php\/2023\/11\/11\/install-argocd-cli-and-add-users\/","title":{"rendered":"Install argocd CLI and add users"},"content":{"rendered":"<h2>Install ArgoCD<\/h2>\n<p>Attention la compatibilit\u00e9 de la version argo cd et Kub. A voir dans la page officiel en bas :<br \/>\n<a href=\"https:\/\/argo-cd.readthedocs.io\/en\/stable\/operator-manual\/installation\/\">https:\/\/argo-cd.readthedocs.io\/en\/stable\/operator-manual\/installation\/<\/a><\/p>\n<p>l'installation est sur le site:<br \/>\n<a href=\"https:\/\/gist.github.com\/dmancloud\/7a024aa0e47fd39bd0db6e80a4aae842\">https:\/\/gist.github.com\/dmancloud\/7a024aa0e47fd39bd0db6e80a4aae842<\/a> :<\/p>\n<p>kubectl create namespace argocd<br \/>\nkubectl apply -n argocd -f <a href=\"https:\/\/raw.githubusercontent.com\/argoproj\/argo-cd\/stable\/manifests\/install.yaml\">https:\/\/raw.githubusercontent.com\/argoproj\/argo-cd\/stable\/manifests\/install.yaml<\/a><br \/>\nkubectl patch svc argocd-server -n argocd -p '{&quot;spec&quot;: {&quot;type&quot;: &quot;NodePort&quot;}}' <\/p>\n<p>get ip and node port to connect to the argo cd for test <\/p>\n<p>kubectl get svc -n argocd<\/p>\n<p>get password to connect<br \/>\nkubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=&quot;{.data.password}&quot; | base64 -d<\/p>\n<p>connect to site with<br \/>\nuser : admin<br \/>\npassword : xxxxxxxx (password get from the request kubectl)<\/p>\n<p>la video est la suivante<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=fBd_tz6BALU\">https:\/\/www.youtube.com\/watch?v=fBd_tz6BALU<\/a><\/p>\n<h2>Install argocd CLI<\/h2>\n<pre><code>VERSION=$(curl --silent &quot;https:\/\/api.github.com\/repos\/argoproj\/argo-cd\/releases\/latest&quot; | grep &#039;&quot;tag_name&quot;&#039; | sed -E &#039;s\/.*&quot;([^&quot;]+)&quot;.*\/\\1\/&#039;)\n\ncurl -sSL -o \/usr\/local\/bin\/argocd https:\/\/github.com\/argoproj\/argo-cd\/releases\/download\/$VERSION\/argocd-linux-amd64\n\nchmod +x \/usr\/local\/bin\/argocd\n\nargocd version<\/code><\/pre>\n<h2>Access to ARGOCD via argocdCLI<\/h2>\n<pre><code> argocd login arg.bakdevops.com --username admin --grpc-web --insecure\n\n #List account\n argocd account list<\/code><\/pre>\n<h2>Generate a token<\/h2>\n<pre><code>\n# Generate token for the currently logged in account\nargocd account generate-token\n\n# Generate token for the account with the specified name\nargocd account generate-token --account &lt;account-name&gt;\n\ndetails : [Link](https:\/\/argo-cd.readthedocs.io\/en\/stable\/user-guide\/commands\/argocd_account_generate-token\/ &quot;Link&quot;)<\/code><\/pre>\n<h2>Add a user to Argocd<\/h2>\n<pre><code># extract file from ConfigMap in K8S\nkubectl get configmap argocd-cm -n argocd -o yaml &gt; argocd-cm.yml\n#Add data to argocd-cm.yml\n\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  annotations:\n    kubectl.kubernetes.io\/last-applied-configuration: |\n      {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;ConfigMap&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;labels&quot;:{&quot;app.kubernetes.io\/name&quot;:&quot;argocd-cm&quot;,&quot;app.kubernetes.io\/part-of&quot;:&quot;argocd&quot;},&quot;name&quot;:&quot;argocd-cm&quot;,&quot;namespace&quot;:&quot;argocd&quot;}}\n  creationTimestamp: &quot;2023-09-10T20:14:48Z&quot;\n  labels:\n    app.kubernetes.io\/name: argocd-cm\n    app.kubernetes.io\/part-of: argocd\n  name: argocd-cm\n  namespace: argocd\n  resourceVersion: &quot;3261549&quot;\n  uid: 4562d63b-7af5-47b1-bf9b-6371fcfe743f\ndata:\n  accounts.bakyass: apiKey, login\n\n#Add password to User\nargocd account update-password --account bakyass --new-password xxxxxxx\n<\/code><\/pre>\n<h2>Add permission to user<\/h2>\n<pre><code>kubectl get configmap argocd-rbac-cm -n argocd -o yaml &gt; argocd-rbac.yml<\/code><\/pre>\n<p>Add data bloc to the file copied<br \/>\np is permission and g is group or user. You create permission and add the role to the group<br \/>\nmore details are into <a href=\"https:\/\/www.linkedin.com\/pulse\/kubernetes-practice-user-management-rbac-argocd-qu%C3%A2n-hu%E1%BB%B3nh\">https:\/\/www.linkedin.com\/pulse\/kubernetes-practice-user-management-rbac-argocd-qu%C3%A2n-hu%E1%BB%B3nh<\/a>  and <a href=\"https:\/\/argo-cd.readthedocs.io\/en\/stable\/operator-manual\/rbac\/\">https:\/\/argo-cd.readthedocs.io\/en\/stable\/operator-manual\/rbac\/<\/a><\/p>\n<pre><code>apiVersion: v1\nkind: ConfigMap\nmetadata:\n  annotations:\n    kubectl.kubernetes.io\/last-applied-configuration: |\n      {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;ConfigMap&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;labels&quot;:{&quot;app.kubernetes.io\/name&quot;:&quot;argocd-rbac-cm&quot;,&quot;app.kubernetes.io\/part-of&quot;:&quot;argocd&quot;},&quot;name&quot;:&quot;argocd-rbac-cm&quot;,&quot;namespace&quot;:&quot;argocd&quot;}}\n  creationTimestamp: &quot;2023-09-10T20:14:49Z&quot;\n  labels:\n    app.kubernetes.io\/name: argocd-rbac-cm\n    app.kubernetes.io\/part-of: argocd\n  name: argocd-rbac-cm\n  namespace: argocd\n  resourceVersion: &quot;3261558&quot;\n  uid: 91594ebd-741b-474c-8ab2-cf18e0546b43\ndata:\n  policy.default: role:readonly\n  policy.csv: |\n    p, role:org-admin, applications, *, *\/*, allow\n    p, role:org-admin, clusters, get, *, allow\n    p, role:org-admin, repositories, get, *, allow\n    p, role:org-admin, repositories, create, *, allow\n    p, role:org-admin, repositories, update, *, allow\n    p, role:org-admin, repositories, delete, *, allow\n    p, role:org-admin, projects, get, *, allow\n    p, role:org-admin, projects, create, *, allow\n    p, role:org-admin, projects, update, *, allow\n    p, role:org-admin, projects, delete, *, allow\n    p, role:org-admin, logs, get, *, allow\n    p, role:org-admin, exec, create, *\/*, allow\n    g, bakyass, role:org-admin\n<\/code><\/pre>\n<p>apply file<\/p>\n<pre><code>kubectl apply -f argocd-rbac.yml<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Install ArgoCD Attention la compatibilit\u00e9 de la version argo cd et Kub. A voir dans la page officiel en bas : https:\/\/argo-cd.readthedocs.io\/en\/stable\/operator-manual\/installation\/ l&#8217;installation est sur le site: https:\/\/gist.github.com\/dmancloud\/7a024aa0e47fd39bd0db6e80a4aae842 : kubectl create namespace argocd kubectl apply -n argocd -f https:\/\/raw.githubusercontent.com\/argoproj\/argo-cd\/stable\/manifests\/install.yaml kubectl patch svc argocd-server -n argocd -p &#8216;{&quot;spec&quot;: {&quot;type&quot;: &quot;NodePort&quot;}}&#8217; get ip and node port to connect to the argo cd for test kubectl get svc -n argocd get password to connect kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=&quot;{.data.password}&quot; | base64 -d connect to site with user : admin password : xxxxxxxx (password get from the request kubectl) la video\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":""},"categories":[10],"tags":[18],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/devopsopen.com\/index.php\/author\/admin_bak\/"},"uagb_comment_info":35,"uagb_excerpt":"Install ArgoCD Attention la compatibilit\u00e9 de la version argo cd et Kub. A voir dans la page officiel en bas : https:\/\/argo-cd.readthedocs.io\/en\/stable\/operator-manual\/installation\/ l'installation est sur le site: https:\/\/gist.github.com\/dmancloud\/7a024aa0e47fd39bd0db6e80a4aae842 : kubectl create namespace argocd kubectl apply -n argocd -f https:\/\/raw.githubusercontent.com\/argoproj\/argo-cd\/stable\/manifests\/install.yaml kubectl patch svc argocd-server -n argocd -p '{&quot;spec&quot;: {&quot;type&quot;: &quot;NodePort&quot;}}' get ip and node port to&hellip;","_links":{"self":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/408"}],"collection":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/comments?post=408"}],"version-history":[{"count":4,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions"}],"predecessor-version":[{"id":464,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions\/464"}],"wp:attachment":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/media?parent=408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/categories?post=408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/tags?post=408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}