0% found this document useful (0 votes)
45 views

Argocd

The document provides a comprehensive guide on installing and configuring Argo CD, including creating a namespace, applying installation manifests, retrieving initial admin credentials, and logging in. It details the steps for creating and managing applications using YAML files and CLI commands, as well as setting up projects with specific permissions. Additionally, it covers the creation of roles and tokens for managing access within Argo CD projects.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Argocd

The document provides a comprehensive guide on installing and configuring Argo CD, including creating a namespace, applying installation manifests, retrieving initial admin credentials, and logging in. It details the steps for creating and managing applications using YAML files and CLI commands, as well as setting up projects with specific permissions. Additionally, it covers the creation of roles and tokens for managing access within Argo CD projects.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 14

create new Name space

1)kubectl create ns argocd

Install Argo CD:

2)
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-
cd/stable/manifests/install.yaml
kubectl create -f
https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

3)kubectl get pods

Get Base64 password

4)kubectl get secret -n argocd


NAME TYPE DATA AGE
argocd-initial-admin-secret Opaque 1 6s
argocd-notifications-secret Opaque 0 10s
argocd-secret Opaque 5 10s

5)kubectl get secret -n argocd argocd-initial-admin-secret -o yaml


apiVersion: v1
data:
password: TTVlZFR4UThGeG80TVctbQ==
kind: Secret
metadata:
creationTimestamp: "2023-04-28T08:38:15Z"
name: argocd-initial-admin-secret
namespace: argocd
resourceVersion: "6815"
uid: 937c2ea6-e261-4daf-a278-78eefda3faf2
type: Opaque
conevert from base 63 to string
6)
[Text.Encoding]::Utf8.GetString([Convert]::FromBase64String("TTVlZFR4UThGeG80TVctbQ
=="))
7)port fowardng

Use this command in order to access Argo CD on your local machine on port 8080

kubectl port-forward svc/argocd-server -n argocd 8080:443

open browser https://localhost:8080/

8)to get argo cd vesion


argocd version
9)argo cd login with commandline
argocd login localhost:8080

10)get argo clusgter list


)argo clusgter list

11)Install Argo CD CLI, use the below commands to start with the installation

curl -sSL -o /usr/local/bin/argocd


https://github.com/argoproj/argo-cd/releases/download/v2.4.8/argocd-linux-amd64
chmod +x /usr/local/bin/argocd

verify by running
argocd
argocd
argocd controls a Argo CD server

Usage:
argocd [flags]
argocd [command]

Available Commands:
account Manage account settings
admin Contains a set of commands useful for Argo CD administrators and
requires direct Kubernetes access
app Manage applications
cert Manage repository certificates and SSH known hosts entries
cluster Manage cluster credentials
completion output shell completion code for the specified shell (bash or zsh)
context Switch between contexts
gpg Manage GPG keys used for signature verification
help Help about any command
login Log in to Argo CD
logout Log out from Argo CD
proj Manage projects
relogin Refresh an expired authenticate token
repo Manage repository connection parameters
repocreds Manage repository connection parameters
version Print version information

Flags:
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
--config string Path to Argo CD config (default
"/root/.config/argocd/config")
--core If set to true then CLI talks directly to
Kubernetes instead of talking to Argo CD API server
--grpc-web Enables gRPC-web protocol. Useful if Argo
CD server is behind proxy which does not support HTTP2.
--grpc-web-root-path string Enables gRPC-web protocol. Useful if Argo
CD server is behind proxy which does not support HTTP2. Set web root.
-H, --header strings Sets additional header to all requests made
by Argo CD CLI. (Can be repeated multiple times to add multiple headers, also
supports comma separated headers)
-h, --help help for argocd
--http-retry-max int Maximum number of retries to establish http
connection to Argo CD server
--insecure Skip server certificate and domain
verification
--kube-context string Directs the command to the given kube-
context
--logformat string Set the logging format. One of: text|json
(default "text")
--loglevel string Set the logging level. One of: debug|info|
warn|error (default "info")
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port
using port forwarding
--port-forward-namespace string Namespace name which should be used for
port forwarding
--server string Argo CD server address
--server-crt string Server certificate file

12)fetch argo cd password

kubectl -n argocd get secret argocd-initial-admin-secret -o


jsonpath="{.data.password}" | base64 -d; echo
As2VM7N3e2GyIex7

13)login
argocd login 172.30.1.2:32073 --grpc-web --plaintext

usename:admin
password:As2VM7N3e2GyIex7

14)once logged in check the clusterlist.


argocd cluster list --grpc-web
SERVER NAME VERSION STATUS MESSAGE
PROJECT
https://kubernetes.default.svc in-cluster Unknown Cluster has no
applications and is not being monitored.
15)
Argo CD can be installed with cluster-admin privileges or namespace level
privileges.
16)Exercise
Declare Argo CD application using Yaml.
Create the application using kubectl.
i)
Sample YAML File:
$ cat /practice/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook
namespace: argocd
spec:
destination:
namespace: guestbook
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision: master
syncPolicy:
syncOptions:
- CreateNamespace=true

ii)Apply this yam file

controlplane $ kubectl apply -f /practice/application.yaml


application.argoproj.io/guestbook created

iii)Verify application is created


kubectl get application -n argocd
NAME SYNC STATUS HEALTH STATUS
guestbook OutOfSync Missing

14)

kubectl -n argocd get secret argocd-initial-admin-secret -o


jsonpath="{.data.password}" | base64 -d; echo
ZIeWBk6colcX1wB7
you need admin user and password. remember that you can get the initial admin
password from k8s secret "argocd-initial-admin-secret"

example : argocd login localhost:8080 --insecure

15)Create an Argo CD application using CLI, use below specs:


Name: app-2
project: default
Sync options: set create namespace to true.
Source repo: https://github.com/mabusaa/argocd-example-apps.git , or you can fork
the repo and set your repo url.
Source path: guestbook
Source branch: master
Destination cluster url (local cluster): https://kubernetes.default.svc
Destination namespace: app-2
You have to use argocd app create command
argocd app create appname --repo repoUrl --revision BranchOrTag --path
manifestsPathInGit --dest-server clusterUrl --dest-namespace namespace --sync-
option CreateNamespace=true --grpc-web
eg:
argocd app create app-2 --repo https://github.com/mabusaa/argocd-example-apps.git
--revision master --path guestbook --dest-server https://kubernetes.default.svc --
dest-namespace app-2 --sync-option CreateNamespace=true --grpc-web
application 'app-2' created
argocd app list --grpc-web
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH
SYNCPOLICY CONDITIONS REPO PATH
TARGET
app-2 https://kubernetes.default.svc app-2 default Synced Healthy
<none> <none> https://github.com/mabusaa/argocd-example-apps.git
guestbook master
app-3 https://kubernetes.default.svc app-3 default OutOfSync Missing
<none> <none> https://github.com/mabusaa/argocd-example-apps.git
guestbook master

Sync the app


argocd app sync app-2 --grpc-web

verfiy if sync is done


argocd app list --grpc-web
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH
SYNCPOLICY CONDITIONS REPO PATH
TARGET
app-2 https://kubernetes.default.svc app-2 default Synced Healthy
<none> <none> https://github.com/mabusaa/argocd-example-apps.git
guestbook master
app-3 https://kubernetes.default.svc app-3 default OutOfSync Missing
<none> <none> https://github.com/mabusaa/argocd-example-apps.git
guestbook master

/practice/application.yaml

18)kustomize options

19)
Practice creating an Argo CD project and allowing specific destinations , in this
practice we will cover:

Define and create Argo CD Project declaratively with below info:


Allow all sources (repos).
Allow local cluster and namespace ns-1 only as destination.
Allow all cluster and namespace scoped resources.
Define and create and Argo CD Application that is using unpermitted namespace as
destination, and verify that Argo CD deny this application.
Update the application with permitted namespace, and sync the application.

a)
Create an Argo CD project declaratively with below specs and apply it using
kubectl:

You can use the definition file /practice/project.yaml

Name: dev-project
Description: Dev project
Destination server: https://kubernetes.default.svc
Destination namespace: ns-1 , this will only allow deploying into ns-1 namespace.

cat /practice/project.yaml
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: dev-project
namespace: argocd
spec:
description: Dev project
sourceRepos:
- '*'

destinations:
- namespace: ns-1
server: "https://kubernetes.default.svc"

clusterResourceWhitelist:
- group: '*'
kind: '*'

namespaceResourceWhitelist:
- group: '*'
kind: '*'

b)Create the project using kubectl


kubectl apply -f /practice/project.yaml
c)Verify project is created

controlplane $ kubectl get appproject -n argocd


NAME AGE
default 3m29s

20)Create Argo CD Application

Create an Argo CD application declaratively with below specs and apply it using
kubectl:

You can use the definition file /practice/application.yaml

Name: guestbook-dev-project
project: dev-project
Destination cluster url (local cluster): https://kubernetes.default.svc
Destination namespace: test-1
Source repo: https://github.com/mabusaa/argocd-example-apps.git , or you can fork
the repo and set your repo url.
Source path: guestbook
Source branch: master
Create the application using kubectl
controlplane $ cat /practice/project.yaml
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: dev-project
namespace: argocd
spec:
description: Dev project
sourceRepos:
- '*'

destinations:
- namespace: ns-1
server: "https://kubernetes.default.svc"

clusterResourceWhitelist:
- group: '*'
kind: '*'

namespaceResourceWhitelist:
- group: '*'
kind: '*'
controlplane $
kubectl apply -f /practice/application.yaml

Verify application is created and its in unknown status

kubectl get application -n argocd

Why application is in unknown status? destination namespace (test-1) is not


permitted in project (dev-project), verify that by describing the application:
kubectl describe application guestbook-dev-project
21)Practice creating a project with role and generate a token related to this
role, in this practice we will cover:

Define and create Argo CD Project with role declaratively.


Create a token related to this role.
Use this token to perform actions using CLI

Create an Argo CD project declaratively with below specs and apply it using
kubectl:

You can use the definition file /practice/project.yaml

Name: project-with-role
Description: project with ci-role
Source repos: allow all
Destination server: allow all
Destination namespace: allow all
Cluster resource whitelist: allow all
Namespace resource whitelist: allow all
Roles: create one role with sync permissions to all applications in same project.
Role name : ci-role
Role Description: Sync privileges for project-with-role
Role Policies : allow sync and get permissions to all applications in this project.
p, proj:project-with-role:ci-role, applications, sync, project-with-role/*, allow
p, proj:project-with-role:ci-role, applications, get, project-with-role/*, allow
Create the project using kubectl

controlplane $ cat /practice/project.yaml


apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: project-with-role
namespace: argocd
spec:
description: project with ci-role
sourceRepos:
- '*'

destinations:
- namespace: '*'
server: '*'

clusterResourceWhitelist:
- group: '*'
kind: '*'

namespaceResourceWhitelist:
- group: '*'
kind: '*'

roles:
- name: ci-role
description: Sync privileges for project-with-role
policies:
- p, proj:project-with-role:ci-role, applications, sync, project-with-role/*,
allow
- p, proj:project-with-role:ci-role, applications, get, project-with-role/*,
allow

Create the project using kubectl

kubectl apply -f /practice/project.yaml

Verify project is created

kubectl get appproject -n argocd


controlplane $ kubectl apply -f /practice/project.yaml
appproject.argoproj.io/project-with-role created
controlplane $
controlplane $ kubectl get appproject -n argocd
NAME AGE
default 3m52s
project-with-role 5s

b)Create a token related to project using CLI, you have to use argocd proj role
create-token command:

argocd proj role create-token PROJECT-NAME ROLE-NAME

argocd proj role create-token project-with-role ci-role --grpc-web Create token


succeeded for proj:project-with-role:ci-role.
ID: 288344ba-7008-43c9-8e3e-eb49e84acadb
Issued At: 2023-05-03T07:35:59Z
Expires At: Never
Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcmdvY2QiLCJzdWIiOiJwcm9qOnByb2plY3
Qtd2l0aC1yb2xlOmNpLXJvbGUiLCJuYmYiOjE2ODMwOTkzNTksImlhdCI6MTY4MzA5OTM1OSwianRpIjoiM
jg4MzQ0YmEtNzAwOC00M2M5LThlM2UtZWI0OWU4NGFjYWRiIn0.vQ8DX_j6XnNpjrEacAa2y1ftQ4tP-
dCWljOylbBLi6k

c)We already created Argo CD application with name demo


Try to delete the application using the generated token, (deleting should be denied
because the roles does not grant delete permission)

argocd app delete demo --grpc-web --auth-token TOKEN_VALUE

Now, try to sync the application using the token, (this should work because role
has the sync permission)

argocd app sync demo --grpc-web --auth-token TOKEN_VALUE

argocd app delete demo --grpc-web --auth-token


eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcmdvY2QiLCJzdWIiOiJwcm9qOnByb2plY3
Qtd2l0aC1yb2xlOmNpLXJvbGUiLCJuYmYiOjE2ODMwOTkzNTksImlhdCI6MTY4MzA5OTM1OSwianRpIjoiM
jg4MzQ0YmEtNzAwOC00M2M5LThlM2UtZWI0OWU4NGFjYWRiIn0.vQ8DX_j6XnNpjrEacAa2y1ftQ4tP-
dCWljOylbBLi6k
Are you sure you want to delete 'demo' and all its resources? [y/n]
y
FATA[0002] rpc error: code = PermissionDenied desc = permission denied:
applications, delete, project-with-role/demo, sub: proj:project-with-role:ci-role,
iat: 2023-05-03T07:35:59Z
controlplane $ argocd app sync demo --grpc-web --auth-token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcmdvY2QiLCJzdWIiOiJwcm9qOnByb2plY3
Qtd2l0aC1yb2xlOmNpLXJvbGUiLCJuYmYiOjE2ODMwOTkzNTksImlhdCI6MTY4MzA5OTM1OSwianRpIjoiM
jg4MzQ0YmEtNzAwOC00M2M5LThlM2UtZWI0OWU4NGFjYWRiIn0.vQ8DX_j6XnNpjrEacAa2y1ftQ4tP-
dCWljOylbBLi6k
TIMESTAMP GROUP KIND NAMESPACE NAME
STATUS HEALTH HOOK MESSAGE
2023-05-03T07:37:29+00:00 Service demo guestbook-ui
OutOfSync Missing
2023-05-03T07:37:29+00:00 apps Deployment demo guestbook-ui
OutOfSync Missing
2023-05-03T07:37:31+00:00 Namespace demo
Running Synced namespace/demo created
2023-05-03T07:37:31+00:00 apps Deployment demo guestbook-ui
OutOfSync Missing deployment.apps/guestbook-ui created
2023-05-03T07:37:31+00:00 Service demo guestbook-ui
OutOfSync Missing service/guestbook-ui created
2023-05-03T07:37:31+00:00 Service demo guestbook-ui
Synced Healthy service/guestbook-ui created
2023-05-03T07:37:31+00:00 apps Deployment demo guestbook-ui
Synced Progressing deployment.apps/guestbook-ui created

Name: demo
Project: project-with-role
Server: https://kubernetes.default.svc
Namespace: demo
URL: http://172.30.1.2:32073/applications/demo
Repo: https://github.com/mabusaa/argocd-example-apps.git
Target: master
Path: guestbook
SyncWindow: Sync Allowed
Sync Policy: <none>
Sync Status: Synced to master (35b956d)
Health Status: Progressing

Operation: Sync
Sync Revision: 35b956d8a312039d0e76e44592ef97b50ee38c53
Phase: Succeeded
Start: 2023-05-03 07:37:29 +0000 UTC
Finished: 2023-05-03 07:37:31 +0000 UTC
Duration: 2s
Message: successfully synced (all tasks run)

GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE


Namespace demo Running Synced
namespace/demo created
Service demo guestbook-ui Synced Healthy
service/guestbook-ui created
apps Deployment demo guestbook-ui Synced Progressing
deployment.apps/guestbook-ui created
controlplane $

22)AUTOMATED SYNC ENBALE


a)reate an Argo CD application declaratively using Yaml with below specs and apply
it using kubectl:

You can use the definition file /practice/application.yaml

Name: auto-sync-app
Destination cluster url (local cluster): https://kubernetes.default.svc
Destination namespace: auto-sync-app
Source repo: https://github.com/mabusaa/argocd-example-apps.git , Fork the repo and
set your repo url.
Source path: guestbook-with-sub-directories , (path of manifests where it include
k8s service and deployment files).
Source branch: master
Enable the automated sync.

cat /practice/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: auto-sync-app
namespace: argocd
spec:
destination:
namespace: auto-sync-app
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision: master
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true

b)Create the application using kubectl

kubectl apply -f /practice/application.yaml

c)Verify application is created and synced

kubectl get application -n argocd

23)Enable automated pruning

cat /practice/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: auto-pruning-demo
namespace: argocd
spec:
destination:
namespace: auto-pruning-demo
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision: master
directory:
recurse: true
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true

23)Self HEAL:
Scale the deployment into 3 replicas using kubectl

kubectl scale deployment/guestbook-ui -n auto-selfheal-demo --replicas=3

After refreshing the application , verify the pods are still 3

kubectl get pods -n auto-selfheal-demo

c)now setup the self heal

controlplane $ cat /practice/application.yaml


apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: auto-selfheal-demo
namespace: argocd
spec:
destination:
namespace: auto-selfheal-demo
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision: master
directory:
recurse: true
syncPolicy:
automated:
selfHeal: true
syncOptions:
- CreateNamespace=true

kubectl apply -f /practice/application.yaml

kubectl get application -n argocd

Verify now the pods are corrected in auto-selfheal-demo namespace

kubectl get pods,service -n auto-selfheal-demo

rolplane $ kubectl get pods -n auto-selfheal-demo


NAME READY STATUS RESTARTS AGE
guestbook-ui-754d46fbf6-ljchb 1/1 Running 0 5m14s
guestbook-ui-754d46fbf6-x8sbl 1/1 Running 0 5m14s

24)Note: Selective sync option will sync only out-of-sync resources. You need it
when you have thousands of resources in which sync take a long time and puts
pressure on API server.

ane $ cat /practice/application.yaml


apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: selective-sync
namespace: argocd
spec:
destination:
namespace: selective-sync
server: "https://kubernetes.default.svc"
project: default
source:
path: sync-options/selective-sync
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision: master
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- ApplyOutOfSyncOnly=true
- CreateNamespace=tr

kubectl apply -f /practice/application.yaml


application.argoproj.io/selective-sync created
controlplane $
controlplane $ kubectl get application -n argocd
NAME SYNC STATUS HEALTH STATUS

25): Fail on shared resources option make the sync operation to fail if any
resource is found in other applications.
/practice/application2.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: demo-shared-resources
namespace: argocd
spec:
destination:
namespace: demo-shared-resources
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision:
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- FailOnSharedResource=true
- CreateNamespace=trueNote: By default ArgoCD use “kubectl apply” to deploy
the resources changes. In some cases you need to “Replace/Recreate” the resources,
ArgoCD can do this by using replace=true.
Manifests level: You can use the replace annotation at manifest level to achieve
this. (argocd.argoproj.io/sync-options: Replace=true)

Tip for enabling the replace option at app level


You have to set (replace to true) in sync policy section:

syncPolicy:
automated: {}
syncOptions:
- Replace=true

on app side
metadata:
annotations:
argocd.argoproj.io/sync-options: Replace=true

26) get with get tag

Verify that resources created in track-git-tag namespace


kubectl get all -n track-git-tag
NAME READY STATUS RESTARTS AGE
pod/guestbook-ui-754d46fbf6-8jsnn 1/1 Running 0 22s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE


service/guestbook-ui ClusterIP 10.111.129.78 <none> 80/TCP 22s

NAME READY UP-TO-DATE AVAILABLE AGE


deployment.apps/guestbook-ui 1/1 1 1 22s

NAME DESIRED CURRENT READY AGE

27)Source target revision: track major version 1 only, and it should always sync
the latest minor or patch version.

cat /practice/application1.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: track-helm-range
namespace: argocd
spec:
destination:
namespace: track-helm-range
server: "https://kubernetes.default.svc"
project: default
source:
chart: sealed-secrets
repoURL: "https://charts.bitnami.com/bitnami"
targetRevision: 1.*
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
28). Diffing Customization, Ignore Differences Demo

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: diffing-customization-demo
namespace: argocd
spec:
destination:
namespace: diffing-customization-demo
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision: master
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas

You might also like