Skip to content

Instantly share code, notes, and snippets.

@mtcoffee
Created February 11, 2024 00:28
Show Gist options
  • Save mtcoffee/69a2a27e285fcb2bd0b61ab77debde97 to your computer and use it in GitHub Desktop.
Save mtcoffee/69a2a27e285fcb2bd0b61ab77debde97 to your computer and use it in GitHub Desktop.
Install ArgoCD on K3s
#This will install the ArgoCD manifest, and add and ingress for traefik so you can access it on http://hostname/argocd
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl apply -f - << "EOF"
---
#Need to configure argocd to server.insecure: "true"
#https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#traefik-v22
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cmd-params-cm
namespace: argocd
labels:
app.kubernetes.io/name: argocd-cmd-params-cm
app.kubernetes.io/part-of: argocd
data:
server.insecure: "true"
server.basehref: "/argocd"
server.rootpath: "/argocd"
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-ingress
namespace: argocd
spec:
rules:
- host:
http:
paths:
- pathType: Prefix
path: /argocd
backend:
service:
name: argocd-server
port:
name: http
EOF
#now redeploy and wait
kubectl -n argocd rollout restart deploy argocd-server
#wait for pod to come up
kubectl wait pods --timeout=120s --for=condition=Ready -n argocd -l app.kubernetes.io/name=argocd-server
defaultPass=`kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d`
echo "##### DEFAULT PASSWORD FOR ADMIN IS $defaultPass #####"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment