...
| Code Block |
|---|
| language | shell |
|---|
| title | Shell Command |
|---|
|
kubectl -n kubernetes-dashboard describe secret dashboard-sa-token |
Install Argo CD
Install Argo CD in the argocd namespace:
| Code Block |
|---|
| language | shell |
|---|
| title | Shell Command |
|---|
|
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml |
Expose Argo CD with an Ingress
🔹 Ingress with NGINX
Create a file argocd-ingress.yaml:
prepare argocd_ingress.yaml
| Code Block |
|---|
| language | yaml |
|---|
| title | argocd_ingress.yaml |
|---|
|
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-server-ingress
namespace: argocd
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
cert-manager.io/cluster-issuer: "letsencrypt-prod" # Optional: if using TLS
spec:
rules:
- host: argocd.da # 🔁 Replace with your DNS name
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: argocd-server
port:
number: 443
tls:
- hosts:
- argocd.da
secretName: argocd-tls # Auto-created by cert-manager if using TLS |
Apply it:
| Code Block |
|---|
|
kubectl apply -f argocd-ingress.yaml
|
Create a Permanent Token for Login
🔹 1. Create a ServiceAccount
| Code Block |
|---|
|
kubectl -n argocd create serviceaccount argocd-admin-sa
|
Bind It to Argo CD Admin Role
| Code Block |
|---|
|
kubectl -n argocd create rolebinding argocd-admin-rb --role=admin --serviceaccount=argocd:argocd-admin-sa
|
Create a Secret-based Token
Create this file: argocd-token.yaml
| Code Block |
|---|
| language | yaml |
|---|
| title | manifest |
|---|
|
apiVersion: v1
kind: Secret
metadata:
name: argocd-admin-token
namespace: argocd
annotations:
kubernetes.io/service-account.name: argocd-admin-sa
type: kubernetes.io/service-account-token |
...
| Code Block |
|---|
| language | shell |
|---|
| title | Shell Command |
|---|
|
kubectl -n argocd describe secret argocd-admin-token |
Check the address exposed and add in the /etc/hosts as argocd.da
Shell Command
| Code Block |
|---|
| language | shell |
|---|
| title | Shell Command |
|---|
|
kubectl get ingress -n argocd |
🧠 You must configure a DNS entry or /etc/hosts pointing argocd.da to your ingress controller IP.
...