Bobcares

ArgoCD on Kubernetes cluster | How to Install

by | Feb 21, 2022

ArgoCD on Kubernetes cluster can be easily installed with this handy guide from our experts. 

At Bobcares, we offer solutions for every query, big and small, as a part of our VPN Provider Support.

Let’s take a look at how our Support Team is ready to help customers with ArgoCD on Kubernetes cluster.

All About ArgoCD on Kubernetes cluster

ArgoCD is a tool we use to read the environment configuration from the git repository. Furthermore, it applies it to the Kubernetes namespaces. In other words, it is a declarative GitOps tool that we can use to deploy applications to Kubernetes.

It is ArgoCD’s responsibility to check if the state in the Git repository corresponds to the one running on the cluster. Moreover, it has to synchronize in case any changes are detected.

Additionally, Kubernetes manifests in different ways like:

  • Kustomize applications
  • Plain directory of YAML/json manifests
  • Helm Charts

How to install ArgoCD & access ArgoCD API Server

  1. First, we head to this link for the ArgoCD project.
  2. Then, create a separate namespace for ArgoCD as seen below:
    $ kubectl create namespace argocd
    namespace/argocd created
    $ kubectl get ns
    NAME STATUS AGE
    argocd Active 3s
    default Active 4d19h
    kube-node-lease Active 4d19h
    kube-public Active 4d19h
    kube-system Active 4d19h
  3. Next, install ArgoCD in the argocd namespace as seen here:
    $ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/install.yaml
    
    $ kubectl get all -n argocd
    NAME                                     READY   STATUS    RESTARTS   AGE
    pod/argocd-application-controller-0      1/1     Running   0          34m
    pod/argocd-dex-server-567b48df49-4dd7p   1/1     Running   0          34m
    pod/argocd-redis-6fb68d9df5-xs4rz        1/1     Running   0          34m
    pod/argocd-repo-server-6dcbd9cb-8nhmp    1/1     Running   0          34m
    pod/argocd-server-69678b4f65-xrddw       1/1     Running   0          34m
    
    NAME                            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
    service/argocd-dex-server       ClusterIP   10.110.134.70           5556/TCP,5557/TCP,5558/TCP   34m
    service/argocd-metrics          ClusterIP   10.104.185.89           8082/TCP                     34m
    service/argocd-redis            ClusterIP   10.111.92.240           6379/TCP                     34m
    service/argocd-repo-server      ClusterIP   10.100.192.39           8081/TCP,8084/TCP            34m
    service/argocd-server           ClusterIP   10.99.48.85             80/TCP,443/TCP               34m
    service/argocd-server-metrics   ClusterIP   10.103.236.26           8083/TCP                     34m
    
    NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE
    deployment.apps/argocd-dex-server    1/1     1            1           34m
    deployment.apps/argocd-redis         1/1     1            1           34m
    deployment.apps/argocd-repo-server   1/1     1            1           34m
    deployment.apps/argocd-server        1/1     1            1           34m
    
    NAME                                           DESIRED   CURRENT   READY   AGE
    replicaset.apps/argocd-dex-server-567b48df49   1         1         1       34m
    replicaset.apps/argocd-redis-6fb68d9df5        1         1         1       34m
    replicaset.apps/argocd-repo-server-6dcbd9cb    1         1         1       34m
    replicaset.apps/argocd-server-69678b4f65       1         1         1       34m
    
    NAME                                             READY   AGE
    statefulset.apps/argocd-application-controller   1/1     34m
  4. After the pods are ready, ArgoCD is up and running. However, the ArgoCD API server is not accessible outside the cluster. Our Support Techs resolve this by using post-forward to expose a port to the service and then forward it to the localhost as seen below:
    $ kubectl port-forward svc/argocd-server -n argocd 8080:443  
    Forwarding from 127.0.0.1:8080 -> 8080
    Forwarding from [::1]:8080 -> 8080
  5. After that, we can access the API server with the help of localhost:8080:
  6. In the window that pops up, enter admin as the username. The initial password is generated automatically. It is usually the pod name of the Argo CD server.

    ArgoCD on Kubernetes cluster

How to create an app on ArgoCD

  1. After logging in, select Manage your repositories from the panel on the left side.
  2. Then select Repositories and use HTTPS or SSH link to connect to the repository to ArgoCD.
  3. For a public repository, we add the repo URL. We will find it pointing to githubrepo.
  4. This is where we click Connect.
  5. Then, head to Application and fill out the fields and then click Create.
  6. Now, we can see our application. Clicking OutOfSync leads us to the details.
  7. When we click Sync, it results in an output. Then click Synchronize.
  8. After that, syncing takes place. With the pod and service in place, we can access the nginx app:
    $ minikube service nginx
    |-----------|-------|-------------|-------------------------|
    | NAMESPACE | NAME  | TARGET PORT |           URL           |
    |-----------|-------|-------------|-------------------------|
    | default   | nginx |          80 | http://172.17.0.3:31555 |
    |-----------|-------|-------------|-------------------------|
      Starting tunnel for service nginx.
    |-----------|-------|-------------|------------------------|
    | NAMESPACE | NAME  | TARGET PORT |          URL           |
    |-----------|-------|-------------|------------------------|
    | default   | nginx |             | http://127.0.0.1:64462 |
    |-----------|-------|-------------|------------------------|
      Opening service default/nginx in default browser...
      Because you are using a Docker driver on darwin, the terminal needs to be open to run it.

If you want to know about more features, give our Support Team a call.

[Looking for a solution to another query? We are just a click away.]

Conclusion

In brief, our skilled Support Engineers at Bobcares demonstrated how to deal with ArgoCD on Kubernetes cluster.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.