Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

Getting Started with Argo CD on Docker Desktop

4 min read

DevOps is a way for development and operations teams to work together collaboratively. It is basically a cultural change. Organizations adopt DevOps culture in order to be able to produce new applications and services at high velocity. To achieve high velocity and fast innovation, GitOps was born. GitOps gives you tools and a framework to take DevOps practices, like collaboration, CI/CD, and version control, and apply them to infrastructure automation and application deployment.

DevOps Culture may use GitOps, that’s not mandatory!

GitOps is a Continuous Deployment model for cloud-native applications. It is used to automate the process of provisioning infrastructure. GitOps is based-off of a Git-based source code management system. It is not a single product, plugin, or platform.

GitOps basically requires 3 core components:

GitOps = IaC + Merge Requests + CI-CD

In GitOps, the Git repositories contains the declarative descriptions of the infrastructure. These are considered as the single source of truth for the desired state of the system. One needs to have an automated way to ensure that the deployed state of the system always matches the state defined in the Git repository. All the changes (such as deployment, upgrade and rollback) on the environment are triggered by changes (commits) made on the Git repository. Said that, just having versioned controlled infrastructure as code doesn’t mean GitOps, we also need to have a mechanism in place to keep (try to keep) our deployed state in sync with the state we define in the Git repository.

GitOps is not limited to Kubernetes. In principle, you can use any infrastructure that can be observed and described declaratively, and has Infrastructure as Code tools available. However, currently most operators for pull-based GitOps are implemented with Kubernetes in mind.

Argo CD is a continuous delivery tool that works on the principles of GitOps. It is built specifically for Kubernetes. The product was developed and open-sourced by Intuit and is currently a part of CNCF.

Components of Argo CD

Argo CD consists of the three main components – API server, Repository Server, and Application Controller.

API Server ( pod: argcocd-server)

  • Controls the whole ArgoCD instance, all its operations, authentification, and secrets access which are stored as Kubernetes Secrets, etc

Repository Server ( pod: argocd-repo-server)

  • Stores and synchronizes data from configured Git-repositories and generates Kubernetes manifests

Application Controller ( pod: argocd-application-controller)

  • Used to monitor applications in a Kubernetes cluster to make them the same as they are described in a repository, and controls PreSync, Sync, PostSync hooks

Argo CD is a tool that will help read your environment configuration from your git repository and apply it to your Kubernetes namespaces.  App definitions, environment, and configurations should be declarative and version controlled. App deployment and lifecycle management should be automated, audible, and easy to understand.Argo CD uses a Git repo to express the desired state of the Kubernetes environment. The basic setup uses one repository to represent one project. Within that repository, each application that makes up the project will be described in its own folder. The repository will also contain a branch for each destination (i.e. cluster and namespace) into which we want to deploy the applications.

image

Prerequisite:

– Install Docker Desktop

Visit https://docs.docker.com/desktop/mac/install/ to setup Docker Desktop for Mac or Windows on your local system.

– Enable Kubernetes

Ensure that the checkbox for Kubernetes is enabled under Desktop Desktop Preference UI.

Getting Started

Step 1. Create a new namespace

Create a namespace argocd where all ArgoCD resources will be installed

kubectl create namespace argocd

Step 2. Install ArgoCD resources

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
 
kubectl get po -n argocd
NAME                                  READY   STATUS              RESTARTS   AGE
argocd-application-controller-0       0/1     ContainerCreating   0          3m9s
argocd-dex-server-65bf5f4fc7-5kjg6    0/1     Init:0/1            0          3m13s
argocd-redis-d486999b7-929q9          0/1     ContainerCreating   0          3m13s
argocd-repo-server-8465d84869-rpr9n   0/1     Init:0/1            0          3m12s
argocd-server-87b47d787-gxwlb         0/1     ContainerCreating   0          3m11s

Step 3. Ensure that all Pods are up and running

kubectl get po -n argocd
NAME                                  READY   STATUS    RESTARTS   AGE
argocd-application-controller-0       1/1     Running   0          5m25s
argocd-dex-server-65bf5f4fc7-5kjg6    1/1     Running   0          5m29s
argocd-redis-d486999b7-929q9          1/1     Running   0          5m29s
argocd-repo-server-8465d84869-rpr9n   1/1     Running   0          5m28s
argocd-server-87b47d787-gxwlb         1/1     Running   0          5m27s

Step 4. Configuring Port Forwarding for Dashboard Access

kubectl port-forward svc/argocd-server -n argocd 8080:443
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080

Open the browser and type https://localhost:8080 to access the ArgoCD dashboard.

To login, you will need admin password. Follow the below steps to get the admin password.

image

Step 5. Logging in

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

Once you run the above command, you will get the admin password that you can use to login into the ArgoCD dashboard.

image

Step 6. Install argoCD CLI on Mac using Homebrew

brew install argocd

Step 7. Access The Argo CD API Server

By default, the Argo CD API server is not exposed with an external IP. To access the API server, choose one of the following techniques to expose the Argo CD API server:

kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
service/argocd-server patched

Step 8. Login to ArgoCD

argocd login localhost      
WARNING: server certificate had error: x509: certificate signed by unknown authority. Proceed insecurely (y/n)? y
Username: admin
Password: 
'admin:login' logged in successfully
Context 'localhost' updated

Step 9. Update the password

% argocd account update-password
*** Enter password of currently logged in user (admin):                       
*** Enter new password for user admin: 
*** Confirm new password for user admin: 
Password updated
Context 'localhost' updated
ajeetraina@Ajeets-MacBook-Pro ~ % 

Step 10. Register A Cluster To Deploy Apps To

As we are running it on Docker Desktop, we will add it accordingly.

argocd cluster add docker-desktop
WARNING: This will create a service account `argocd-manager` on the cluster referenced by context `docker-desktop` with full cluster level admin privileges. Do you want to continue [y/N]? y
INFO[0002] ServiceAccount "argocd-manager" created in namespace "kube-system" 
INFO[0002] ClusterRole "argocd-manager-role" created    
INFO[0002] ClusterRoleBinding "argocd-manager-role-binding" created 
Cluster 'https://kubernetes.docker.internal:6443' added

Step 11. Deploy a Sample Application

The ArgoCD GitHub repository contains example applications for demoing ArgoCD functionality. You can register this repository to your ArgoCD instance, or fork this repo and push your own commits to explore ArgoCD and GitOps!

Let us pick up Sock shop sample app for our demo purpose. Sock Shop simulates the user-facing part of an e-commerce website that sells socks. It is intended to aid the demonstration and testing of microservice and cloud native technologies.

Sock Shop microservices are designed to have minimal expectations, using DNS to find other services. This means that it is possible to insert load-balancers and service routers, as required or desired. There are pre-built configuration scripts for various platforms that aim to make running the whole application simple. Sock Shop can be used to illustrate microservices architectures, demonstrate platforms at talks and meetups, or as a training and education tool.

Step 12. Verify the existing app, if any

argocd app list                  
NAME  CLUSTER  NAMESPACE  PROJECT  STATUS  HEALTH  SYNCPOLICY  CONDITIONS  REPO  PATH  TARGET
ajeetraina@Ajeets-MacBook-Pro ~ % 

Also, you can verify that there are no Sock Shop related microservices are running as shown below:

Step 12. Deploy a Sock Shop app

argocd app create sockshop --repo https://github.com/argoproj/argocd-example-apps.git  --path sock-shop --dest-server https://kubernetes.default.svc --dest-namespace default

application 'sockshop' created

Step 13. Listing out the sample application

argocd app list                  
NAME      CLUSTER                         NAMESPACE  PROJECT  STATUS     HEALTH   SYNCPOLICY  CONDITIONS  REPO                                                 PATH       TARGET
sockshop  https://kubernetes.default.svc  default    default  Running   <none>      <none>      https://github.com/argoproj/argocd-example-apps.git  sock-shop  
ajeetraina@Ajeets-MacBook-Pro ~ % 

Under the Docker Desktop Dashboard UI, you will be able to see the microservice logs. (Please note that Docker Extensions is a new feature that is still in beta phase. You will require the latest Docker Desktop v4.50 release for this to work).

To learn more about the Sock Shop microservice in detail, visit this page.

In my next blog post, I will walkthrough each of these microservices and other sample examples in details.

References:

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

57 Replies to “Getting Started with Argo CD on Docker Desktop”

  1. great publish, very informative. I wonder why the other experts of this sector do not understand this. You must proceed your writing. I am sure, you’ve a great readers’ base already!

  2. Today, I went to the beachfront with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is completely off topic but I had to tell someone!

  3. It is the best time to make some plans for the future and it is time to be happy. I have read this post and if I could I want to suggest you some interesting things or tips. Perhaps you could write next articles referring to this article. I wish to read even more things about it!

  4. I must express my thanks to you just for bailing me out of this type of scenario. After surfing through the online world and finding things that were not beneficial, I believed my life was over. Being alive without the presence of solutions to the difficulties you’ve fixed through your entire report is a critical case, and those which may have negatively damaged my career if I hadn’t noticed the website. Your primary know-how and kindness in playing with all the stuff was very useful. I don’t know what I would have done if I had not come upon such a solution like this. I’m able to at this moment look forward to my future. Thanks a lot very much for this impressive and result oriented help. I won’t hesitate to suggest the blog to any individual who needs and wants assistance on this subject.

  5. Excellent goods from you, man. I have understand your stuff previous to and you are just extremely fantastic. I actually like what you have acquired here, really like what you are stating and the way in which you say it. You make it entertaining and you still take care of to keep it smart. I can not wait to read much more from you. This is actually a tremendous site.

  6. Great post. I was checking constantly this blog and I’m impressed! Extremely useful information specially the last part 🙂 I care for such info a lot. I was seeking this particular information for a long time. Thank you and good luck.

  7. I have been absent for some time, but now I remember why I used to love this web site. Thank you, I will try and check back more frequently. How frequently you update your web site?

  8. Hi, Neat post. There’s a problem with your site in internet explorer, would check this… IE still is the market leader and a large portion of people will miss your excellent writing because of this problem.

  9. Some really fantastic posts on this web site, thanks for contribution. “For today and its blessings, I owe the world an attitude of gratitude.” by Clarence E. Hodges.

  10. I precisely had to thank you very much all over again. I’m not certain what I might have carried out in the absence of the actual opinions shown by you on my situation. Previously it was a depressing issue for me, nevertheless spending time with your specialized approach you solved that forced me to weep over delight. Now i’m thankful for your help and thus hope that you find out what a great job you have been undertaking educating people today by way of your site. I’m certain you have never met all of us.

  11. Thank you, I have just been searching for information about this subject for ages and yours is the greatest I’ve discovered so far. But, what about the conclusion? Are you sure about the source?

  12. I was recommended this web site via my cousin. I am now not certain whether this post is written by way of him as no one else know such certain about my trouble. You are wonderful! Thanks!

  13. Hmm is anyone else having problems with the pictures on this blog loading? I’m trying to find out if its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated.

  14. What i don’t understood is in reality how you are no longer actually a lot more well-liked than you might be now. You’re very intelligent. You recognize thus significantly relating to this matter, made me for my part believe it from so many varied angles. Its like women and men don’t seem to be involved except it¦s one thing to do with Woman gaga! Your own stuffs nice. All the time take care of it up!

  15. It’s really a nice and helpful piece of information. I am satisfied that you simply shared this useful info with us. Please keep us up to date like this. Thank you for sharing.

  16. After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.

  17. Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

  18. I would like to thank you for the efforts you have put in writing this blog. I am hoping the same high-grade site post from you in the upcoming also. In fact your creative writing abilities has encouraged me to get my own site now. Actually the blogging is spreading its wings rapidly. Your write up is a great example of it.

  19. I was curious if you ever thought of changing the page layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or two images. Maybe you could space it out better?

  20. Thank you, I have just been searching for information about this subject for ages and yours is the greatest I have discovered so far. But, what about the bottom line? Are you sure about the source?

  21. I have not checked in here for a while as I thought it was getting boring, but the last few posts are great quality so I guess I will add you back to my everyday bloglist. You deserve it my friend 🙂

  22. I’ve been exploring for a little for any high-quality articles or weblog posts in this kind of area . Exploring in Yahoo I eventually stumbled upon this website. Reading this info So i’m happy to exhibit that I have a very excellent uncanny feeling I discovered exactly what I needed. I so much surely will make sure to do not overlook this web site and give it a glance on a continuing basis.

  23. I have been surfing online greater than 3 hours today, but I never found any attention-grabbing article like yours. It is lovely value enough for me. Personally, if all webmasters and bloggers made excellent content as you probably did, the internet will likely be a lot more useful than ever before.

  24. I have been browsing online more than 3 hours as of late, but I by no means found any attention-grabbing article like yours. It is lovely value enough for me. In my opinion, if all webmasters and bloggers made just right content as you did, the net will be a lot more useful than ever before.

  25. Howdy very nice blog!! Guy .. Beautiful .. Wonderful .. I will bookmark your web site and take the feeds additionally?KI’m happy to find numerous useful info right here within the submit, we need develop extra strategies on this regard, thanks for sharing. . . . . .

  26. I used to be suggested this blog by my cousin. I’m no longer certain whether this post is written through him as no one else know such designated approximately my difficulty. You’re wonderful! Thanks!

  27. hi!,I like your writing very much! percentage we be in contact extra approximately your post on AOL? I need a specialist in this house to solve my problem. May be that is you! Having a look ahead to look you.

  28. Hello my friend! I want to say that this article is amazing, great written and come with approximately all important infos. I’d like to look extra posts like this.

  29. I’ve learned a number of important things through your post. I’d also like to convey that there may be situation that you will obtain a loan and don’t need a cosigner such as a Fed Student Support Loan. However, if you are getting that loan through a regular finance company then you need to be willing to have a co-signer ready to allow you to. The lenders will probably base their decision on a few issues but the biggest will be your credit standing. There are some creditors that will in addition look at your work history and decide based on this but in many instances it will be based on on your score.

  30. Masturbation Porn Videos Showing 1-20 of 5:00 HD CLOSEUP ORGASM
    LOTS SLIME DeLuXeGirL 4.9M views 85% 11:20 HD My fingers are not enough, time to use my new toys Morgpie 3.6M views 84% 3:20 HD Going into public
    toilet makes her horny and gets everything wet Huge squirt
    LyxXxWaterSweet 1.2M views 85% 25:11 HD.

  31. I?¦ll immediately seize your rss feed as I can not in finding your email subscription hyperlink or newsletter service. Do you’ve any? Kindly let me recognise in order that I may subscribe. Thanks.

  32. I¦ll right away take hold of your rss as I can not find your email subscription link or e-newsletter service. Do you’ve any? Kindly allow me understand in order that I may just subscribe. Thanks.

Leave a Reply to Anonymous Cancel reply

Your email address will not be published.

© Copyright Collabnix Inc

Built for Collabnix Community, by Community