veda/platform/components/02-argocd/install.sh

51 lines
1.5 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
echo "Starting ArgoCD installation..."
# Add Argo CD Helm repository
echo "Adding Argo CD Helm repository..."
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
# Install Argo CD
echo "Installing Argo CD..."
helm upgrade --install \
argocd \
argo/argo-cd \
--namespace argocd \
--create-namespace \
--version 9.1.0 \
--values "$(dirname "$0")/values.yaml" \
--wait
# Wait for the Argo CD server to be ready
echo "Waiting for Argo CD server to be ready..."
kubectl wait --for=condition=available --timeout=300s deployment/argocd-server -n argocd
# Apply post-install configurations if they exist
if [ -n "$(find "$(dirname "$0")/post-install" -type f \( -name '*.yaml' -o -name '*.yml' -o -name '*.json' \) 2>/dev/null)" ]; then
echo "Applying post-install configurations..."
kubectl apply --recursive -f "$(dirname "$0")/post-install/"
fi
# Get the initial admin password
echo
echo "Initial admin password:"
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
echo
echo
echo "ArgoCD installation complete!"
echo
echo "Temporary access (until ingress is ready):"
echo "1. Run: kubectl port-forward svc/argocd-server -n argocd 8080:443"
echo "2. Open: https://localhost:8080"
echo
echo "Credentials:"
echo " Username: admin"
echo " Password: (shown above)"
echo
echo "Once Traefik ingress is running, access ArgoCD at:"
echo " https://argocd.noxxos.nl"