Installing ArgoCD

Installing ArgoCD in Thalassa Cloud Kubernetes

ArgoCD is a GitOps tool that keeps your Kubernetes cluster in sync with what’s in your Git repository. It provides an easy-to-use web UI, CLI, and API for managing deployments, monitoring application state, and viewing changes.

By installing ArgoCD in your Thalassa Cloud cluster, you can automatically or manually keep your cluster up to date with Git, visualize differences between what’s defined in Git and what’s running, and manage multi-cluster deployments—all from a single interface. ArgoCD watches your Git repositories, detects changes, and applies them to your cluster. Its core components handle syncing, authentication, Git access, and performance caching.

This guide will show you how to install ArgoCD, connect it to your Git repositories, and deploy your first application using its UI or automation features.

Prerequisites

Before installing ArgoCD, ensure you have a few things in place. First, you need a running Kubernetes cluster in Thalassa Cloud. If you don’t have one yet, see the Getting Started guide for instructions on creating your first cluster.

You’ll also need cluster access configured using kubectl. Use tcloud kubernetes connect to configure access, or set up kubeconfig manually. You’ll need cluster administrator permissions to install ArgoCD, as it requires creating cluster-level resources.

Finally, you’ll need a Git repository to store your Kubernetes manifests. ArgoCD supports GitHub, GitLab, Bitbucket, and any Git server that supports HTTPS or SSH. The repository should contain your Kubernetes YAML files, organized in a way that makes sense for your applications.

Installing ArgoCD

The recommended way to install ArgoCD is using the official installation manifests. ArgoCD provides a set of Kubernetes resources that handle all the necessary components.

First, create the ArgoCD namespace:

kubectl create namespace argocd

Install ArgoCD using the official installation manifest:

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

This installs all ArgoCD components, including the server, application controller, repo server, and redis. The installation process typically takes a few minutes as all components start up.

Verify that ArgoCD is running:

kubectl get pods -n argocd

You should see several pods, including argocd-server, argocd-application-controller, argocd-repo-server, and argocd-redis. All pods should show a status of “Running” after a minute or two. If any pods aren’t running, check their logs:

kubectl logs -n argocd -l app.kubernetes.io/name=argocd-server

Accessing the ArgoCD UI

ArgoCD provides a web-based user interface that makes it easy to visualize and manage applications. To access the UI, you need to expose the ArgoCD server service. For initial setup and testing, you can use port forwarding.

Port forward the ArgoCD server service:

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

This forwards the ArgoCD server to localhost:8080. Open your browser and navigate to https://localhost:8080. You’ll see a warning about the self-signed certificate—this is normal for the default installation. Accept the certificate to proceed.

Production Access

For production use, you’ll want to expose ArgoCD through a proper ingress or load balancer. You can configure ArgoCD to use Thalassa Cloud’s load balancers by creating a service of type LoadBalancer or by setting up an ingress controller. See the Service Load Balancers documentation for details.

Getting the Admin Password

ArgoCD creates an initial admin user with a randomly generated password stored in a Kubernetes secret. Retrieve this password to log into the UI:

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

This displays the admin password. Copy it, as you’ll need it to log into the ArgoCD UI. The default username is admin.

Log into the ArgoCD UI using these credentials. After logging in, you can change the password through the UI or using the ArgoCD CLI.

Installing the ArgoCD CLI

While the web UI is convenient, the ArgoCD CLI provides additional functionality and is useful for automation. Install the CLI on your local machine.

On macOS, you can use Homebrew:

brew install argocd

On Linux, download the binary:

curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x /usr/local/bin/argocd

For Windows or other platforms, see the ArgoCD installation documentation for platform-specific instructions.

Verify the installation:

argocd version --client

Log into ArgoCD using the CLI:

argocd login localhost:8080

You’ll be prompted for the username and password. Use admin and the password you retrieved earlier. If you’re using port forwarding, use localhost:8080. If you’ve exposed ArgoCD through a load balancer, use the load balancer’s address.

Setting Up Your First Application

With ArgoCD installed and accessible, you can set up your first application. ArgoCD uses Application resources to define what should be deployed from your Git repository.

Create an Application resource that tells ArgoCD to deploy an application from your Git repository:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/your-org/your-repo.git
    targetRevision: main
    path: apps/my-app
  destination:
    server: https://kubernetes.default.svc
    namespace: default
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true

Apply this Application:

kubectl apply -f application.yaml

ArgoCD will now monitor the specified path in your Git repository and automatically synchronize it with your cluster. The automated sync policy tells ArgoCD to automatically apply changes when it detects differences between Git and the cluster.

You can view the application in the ArgoCD UI. Navigate to the Applications section to see your application’s status, including whether it’s in sync with Git, what resources have been created, and any synchronization issues.

Configuring Git Repository Access

ArgoCD needs access to your Git repositories to monitor them for changes. For public repositories, no additional configuration is needed. For private repositories, you need to configure credentials.

Create a secret that contains your Git credentials. For HTTPS repositories, create a secret with username and password:

kubectl create secret generic git-creds \
  --from-literal=url=https://github.com/your-org/your-repo.git \
  --from-literal=username=your-username \
  --from-literal=password=your-token \
  -n argocd

Then reference this secret in your Application or configure it as a repository credential in ArgoCD. In the UI, go to Settings → Repositories and add your repository with the credentials.

For SSH repositories, create a secret with your SSH private key:

kubectl create secret generic git-ssh-creds \
  --from-file=sshPrivateKey=/path/to/your/private-key \
  --from-literal=url=[email protected]:your-org/your-repo.git \
  -n argocd

ArgoCD will use these credentials to access your repositories. Ensure that the credentials have the necessary permissions to read the repositories you want to deploy.

Sync Policies and Strategies

ArgoCD supports various sync policies that control when and how applications are synchronized. Understanding these policies helps you configure applications appropriately for different use cases.

  • The automated sync policy tells ArgoCD to automatically sync when it detects differences. The prune option removes resources that are no longer in Git, and selfHeal automatically syncs if someone makes manual changes to the cluster.
  • You can also configure manual sync with approval requirements. Remove the automated section to require manual synchronization through the UI or CLI. This is useful for production applications where you want to review changes before they’re applied.
  • ArgoCD supports several sync strategies. The default strategy performs a standard Kubernetes apply. You can also use hooks for pre-sync, sync, and post-sync operations, or use a replace strategy that replaces resources entirely.
  • Configure sync windows to restrict when synchronizations can occur. This is useful for production environments where you want to prevent changes during business hours or maintenance windows.

Multi-Cluster Management

One of ArgoCD’s powerful features is its ability to manage applications across multiple clusters. You can configure ArgoCD to deploy applications to different clusters from a single ArgoCD instance.

To add a cluster, you need the cluster’s kubeconfig. In the ArgoCD UI, go to Settings → Clusters and click “New Cluster”. Paste the cluster’s kubeconfig, and ArgoCD will register it.

You can also add clusters using the CLI:

argocd cluster add <context-name>

Replace <context-name> with the name of the kubeconfig context for the cluster you want to add.

Once a cluster is registered, you can deploy applications to it by specifying the cluster’s server address in your Application’s destination:

destination:
  server: https://other-cluster.example.com
  namespace: default

This allows you to manage applications across development, staging, and production clusters from a single ArgoCD instance.

Additional Information

For more information, see the following resources: