Skip to content

ArgoCD UI access via port forwarding

To access the ArgoCD user interface when the service is not exposed via a LoadBalancer or Ingress, you can use kubectl port-forward. This method tunnels a local port on your machine to the ArgoCD server service inside the Kubernetes cluster.^[400-devops-04-ci-cd-pipelines-k8s-argocd-argocd-app-config-readme.md]

Prerequisites

Before setting up the port forward, ensure ArgoCD is installed in the argocd namespace.^[400-devops-04-ci-cd-pipelines-k8s-argocd-argocd-app-config-readme.md]

Commands

1. Retrieve Service Details

First, verify that the ArgoCD server service is running by listing the services in the ArgoCD namespace:^[400-devops-04-ci-cd-pipelines-k8s-argocd-argocd-app-config-readme.md]

[kubectl](<./kubectl.md>) get svc -n [ArgoCD](<./argocd.md>)

2. Establish Port Forward

Forward local port 8080 to port 443 of the argocd-server service.^[400-devops-04-ci-cd-pipelines-k8s-argocd-argocd-app-config-readme.md]

[kubectl](<./kubectl.md>) port-forward svc/argocd-server 8080:443 -n [ArgoCD](<./argocd.md>)

Once the command is running, the UI will be accessible at https://localhost:8080 in your browser.

Authentication

To log in to the UI, you need the initial admin password. The password is stored in a Kubernetes Secret named argocd-initial-admin-secret.^[400-devops-04-ci-cd-pipelines-k8s-argocd-argocd-app-config-readme.md]

You can decode and retrieve it using the following command:^[400-devops-04-ci-cd-pipelines-k8s-argocd-argocd-app-config-readme.md]

[kubectl](<./kubectl.md>) -n [ArgoCD](<./argocd.md>) get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 --decode && echo

Use the username admin and the retrieved password to log in.

Sources

^[400-devops-04-ci-cd-pipelines-k8s-argocd-argocd-app-config-readme.md]