prettier
+
junit
+
+
+
bundler
+
+
influxdb
rollup
===
+
unix
+
+
mxnet
fedora
+
+
terraform
+
+
+
+
+
neo4j
django
suse
+
emacs
+
+
vim
packer
+
+
+
+
+
ionic
quarkus
influxdb
+
+
+
nomad
+
+
+
+
+
+
->
~
phoenix
+
+
redis
css
<=
+
+
puppet
stimulus
+
+
!==
==
===
+
+
goland
+
rs
nuxt
+
sails
+
+
s3
mvn
+
bun
pascal
ios
+
+
rest
+
Back to Blog
๐Ÿš€ Argo CD GitOps Deployment on AlmaLinux 9: Complete Guide
almalinux argo-cd gitops

๐Ÿš€ Argo CD GitOps Deployment on AlmaLinux 9: Complete Guide

Published Sep 6, 2025

Master GitOps with Argo CD on AlmaLinux 9! Learn automated Kubernetes deployments, Git-based configuration management, and continuous delivery with practical examples and troubleshooting tips.

5 min read
0 views
Table of Contents

๐Ÿš€ Argo CD GitOps Deployment on AlmaLinux 9: Complete Guide

Welcome to the amazing world of GitOps! ๐ŸŽ‰ Today weโ€™ll set up Argo CD on AlmaLinux 9, transforming how you deploy applications to Kubernetes. Get ready to automate everything with Git! ๐Ÿš€โœจ

๐Ÿค” Why is Argo CD Important?

Imagine deploying applications just by pushing code to Git! ๐ŸŽฏ Thatโ€™s the magic of Argo CD! Hereโ€™s why itโ€™s revolutionary:

  • ๐Ÿ”„ Automatic Deployments - Push code, and watch it deploy automatically!
  • ๐Ÿ“ฆ Git as Truth - Everything lives in Git, version controlled and auditable
  • ๐Ÿ›ก๏ธ Self-Healing - Applications fix themselves when configuration drifts
  • ๐Ÿ‘๏ธ Visual Dashboard - See all your deployments in one beautiful interface
  • ๐Ÿ” Easy Rollbacks - Revert to any previous version instantly
  • ๐ŸŒ Multi-Cluster - Manage applications across multiple Kubernetes clusters
  • ๐ŸŽจ Declarative Config - Define what you want, not how to get there
  • ๐Ÿ” Security Built-in - Role-based access control and audit trails

๐ŸŽฏ What You Need

Before we start this exciting journey, make sure you have:

  • โœ… AlmaLinux 9 server (4GB RAM minimum, 8GB recommended)
  • โœ… Kubernetes cluster running (K3s, K8s, or any flavor)
  • โœ… kubectl installed and configured
  • โœ… Git repository for your manifests
  • โœ… Basic Kubernetes knowledge
  • โœ… Domain name (optional but recommended)
  • โœ… SSL certificates (optional)
  • โœ… Coffee ready! โ˜•

๐Ÿ“ Step 1: Prepare Your Kubernetes Environment

Letโ€™s set up our Kubernetes cluster first! ๐Ÿ—๏ธ

Install K3s (Lightweight Kubernetes)

# Install K3s on AlmaLinux 9
curl -sfL https://get.k3s.io | sh -

# Wait for K3s to be ready
sudo systemctl status k3s  # Check if it's running

# Configure kubectl
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $(id -u):$(id -g) ~/.kube/config

# Verify cluster is working
kubectl get nodes  # Should show your node as Ready
kubectl get pods --all-namespaces  # See all running pods

Install kubectl (if not already installed)

# Download kubectl binary
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

# Make it executable
chmod +x kubectl

# Move to system path
sudo mv kubectl /usr/local/bin/

# Verify installation
kubectl version --client  # Shows kubectl version

๐Ÿ”ง Step 2: Install Argo CD

Time to install Argo CD! ๐ŸŽŠ This is where the magic begins!

Create Argo CD Namespace

# Create dedicated namespace for Argo CD
kubectl create namespace argocd

# Verify namespace was created
kubectl get namespaces | grep argocd  # Should show argocd namespace

Deploy Argo CD

# Install Argo CD using official manifests
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# Watch pods being created (this is exciting!)
kubectl get pods -n argocd -w  # Press Ctrl+C when all are Running

# Check all Argo CD components
kubectl get all -n argocd  # Shows all resources

Install Argo CD CLI

# Download Argo CD CLI
curl -sSL -o /tmp/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64

# Make it executable
chmod +x /tmp/argocd

# Move to system path
sudo mv /tmp/argocd /usr/local/bin/argocd

# Verify CLI installation
argocd version  # Shows CLI version

๐ŸŒŸ Step 3: Access Argo CD UI

Letโ€™s access the beautiful Argo CD dashboard! ๐ŸŽจ

Get Initial Admin Password

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

# Save it! You'll need this password
echo "Your password is above! Save it! ๐Ÿ“"

Expose Argo CD Server

Choose one of these methods:

Method 1: Port Forwarding (Development)

# Forward port to access UI
kubectl port-forward svc/argocd-server -n argocd 8080:443 &

# Access at: https://localhost:8080
# Username: admin
# Password: (from above command)

Method 2: NodePort Service (Better)

# Create NodePort service
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
  name: argocd-server-nodeport
  namespace: argocd
spec:
  type: NodePort
  ports:
  - port: 443
    targetPort: 8080
    nodePort: 30443
  selector:
    app.kubernetes.io/name: argocd-server
EOF

# Access at: https://YOUR_SERVER_IP:30443

Method 3: Ingress (Production)

# Install nginx ingress controller first
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.1/deploy/static/provider/cloud/deploy.yaml

# Create Ingress for Argo CD
cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-ingress
  namespace: argocd
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  tls:
  - hosts:
    - argocd.yourdomain.com
    secretName: argocd-server-tls
  rules:
  - host: argocd.yourdomain.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              number: 443
EOF

# Access at: https://argocd.yourdomain.com

โœ… Step 4: Configure Argo CD

Letโ€™s configure Argo CD for production use! ๐Ÿ”ง

Login with CLI

# Login to Argo CD server
argocd login localhost:8080 --insecure --username admin

# Enter password when prompted
# You'll see: 'admin:login' logged in successfully

Change Admin Password

# Update admin password (important for security!)
argocd account update-password

# Enter current password
# Enter new password
# Confirm new password

Add Git Repository

# Add your Git repository
argocd repo add https://github.com/yourusername/k8s-manifests \
  --username your-github-username \
  --password your-github-token

# For SSH (recommended):
argocd repo add [email protected]:yourusername/k8s-manifests.git \
  --ssh-private-key-path ~/.ssh/id_rsa

๐ŸŽฎ Quick Examples

Letโ€™s deploy some applications! ๐Ÿš€

Example 1: Deploy Sample Guestbook App

# Create your first application!
argocd app create guestbook \
  --repo https://github.com/argoproj/argocd-example-apps.git \
  --path guestbook \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace default

# Sync (deploy) the application
argocd app sync guestbook

# Check application status
argocd app get guestbook

# Watch it deploy!
kubectl get pods -n default -w

Example 2: Deploy from Your Repository

Create a simple deployment in your Git repo:

# Save as deployment.yaml in your repo
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: nginx
  ports:
  - port: 80
    targetPort: 80
  type: LoadBalancer

Deploy it with Argo CD:

# Create application from your repo
argocd app create my-nginx \
  --repo https://github.com/yourusername/k8s-manifests \
  --path nginx \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace default \
  --sync-policy automated

# Application will auto-sync!
argocd app list  # See your apps

Example 3: Multi-Environment Setup

# Create app-of-apps pattern
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: environments
  namespace: argocd
spec:
  destination:
    namespace: argocd
    server: https://kubernetes.default.svc
  source:
    path: environments
    repoURL: https://github.com/yourusername/gitops
    targetRevision: main
  project: default
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

๐Ÿšจ Fix Common Problems

Donโ€™t worry if you hit issues! Here are solutions! ๐Ÿ’ช

Problem 1: Cannot Access UI

# Check if pods are running
kubectl get pods -n argocd

# If pods are pending/crashing
kubectl describe pod <pod-name> -n argocd

# Check service
kubectl get svc -n argocd

# Restart Argo CD
kubectl rollout restart deployment -n argocd

Problem 2: Sync Failed

# Check application details
argocd app get <app-name>

# See sync errors
argocd app sync <app-name> --dry-run

# Force sync
argocd app sync <app-name> --force

# Check logs
kubectl logs -n argocd deployment/argocd-server

Problem 3: Repository Connection Failed

# Test repository connection
argocd repo list

# Remove and re-add repository
argocd repo rm <repo-url>

# Add with debugging
argocd repo add <repo-url> --insecure-skip-server-verification

# For private repos, check credentials
argocd repo add <repo-url> --username <user> --password <token>

๐Ÿ“‹ Simple Commands Summary

Hereโ€™s your GitOps command cheatsheet! ๐Ÿ“š

CommandWhat It DoesWhen to Use
kubectl apply -n argocd -f install.yamlInstall Argo CDInitial setup
argocd login <server>Login to Argo CDBefore using CLI
argocd app create <name>Create new applicationDeploy new app
argocd app sync <name>Deploy/update applicationManual deployment
argocd app listList all applicationsCheck deployments
argocd app delete <name>Remove applicationCleanup
argocd app get <name>Show app detailsDebugging
argocd repo add <url>Add Git repositoryConnect repos
kubectl port-forward svc/argocd-serverAccess UI locallyDevelopment
argocd app rollback <name>Rollback applicationFix issues

๐Ÿ’ก Tips for Success

Master GitOps with these pro tips! ๐Ÿ†

Repository Structure

  • ๐Ÿ“ Organize by environment (dev/, staging/, prod/)
  • ๐Ÿ“ Use Kustomize for environment differences
  • ๐Ÿ”’ Keep secrets in sealed-secrets or external secret operator
  • ๐Ÿ“ฆ Version everything with Git tags

Best Practices

  • ๐Ÿ”„ Enable auto-sync for non-production
  • ๐Ÿ›ก๏ธ Use RBAC for team access control
  • ๐Ÿ“Š Monitor with Prometheus metrics
  • ๐ŸŽฏ Create app-of-apps for complex deployments
  • ๐Ÿ’พ Backup Argo CD configuration regularly
  • ๐Ÿ” Use ApplicationSets for multi-cluster
  • โšก Enable webhook for instant syncs
  • ๐Ÿ“ˆ Set resource limits on applications

Security Tips

  • ๐Ÿ” Rotate admin password immediately
  • ๐Ÿ›ก๏ธ Use SSO integration (OIDC/SAML)
  • ๐Ÿ”’ Enable TLS for all connections
  • ๐Ÿ“ Audit all changes through Git
  • ๐Ÿšซ Never commit secrets to Git

๐Ÿ† What You Learned

Congratulations! Youโ€™re now a GitOps master! ๐ŸŽ‰ You can now:

  • โœ… Install and configure Argo CD on AlmaLinux 9
  • โœ… Deploy applications using GitOps principles
  • โœ… Manage Kubernetes deployments through Git
  • โœ… Use Argo CD UI and CLI effectively
  • โœ… Implement automated deployments
  • โœ… Troubleshoot common issues
  • โœ… Follow GitOps best practices
  • โœ… Secure your deployment pipeline

๐ŸŽฏ Why This Matters

Youโ€™ve just revolutionized your deployment process! ๐Ÿš€ With Argo CD and GitOps:

  • No More Manual Deployments - Everything is automated through Git
  • Perfect Audit Trail - Every change is tracked in Git history
  • Disaster Recovery - Recreate entire infrastructure from Git
  • Team Collaboration - Everyone uses the same Git workflow
  • Reduced Errors - No more kubectl apply mistakes
  • Faster Deployments - Push code and watch it deploy
  • Better Security - Controlled access through Git permissions

Your infrastructure is now truly โ€œInfrastructure as Codeโ€! Every deployment is repeatable, auditable, and automated. Welcome to the future of Kubernetes deployments!

Keep exploring GitOps patterns like progressive delivery, canary deployments, and multi-cluster management. The possibilities are endless! ๐ŸŒŸ

Remember: Git push is your new deploy button! Happy GitOps-ing! ๐ŸŽŠ๐Ÿš€


P.S. - Join the Argo CD community, explore advanced features like ApplicationSets and Rollouts, and share your GitOps journey! The future is declarative! โญ๐Ÿ™Œ