Install and Manage Argo CD with Ansible
Categories:
3 minute read , 7 minute provision
Projects:
c2platform/ansible
,
c2platform.core
,
c2platform.mw
This guide illustrates the installation of Argo CD within the C2 Platform development environment using C2 Platform’s Ansible collections. This automated process uses Vagrant , the Vagrant Ansible provisioner and, of course, Ansible.
Here’s an overview of the process orchestrated by Vagrant using Ansible as a provisioner:
- Kubernetes Cluster Setup: Ansible configures a Kubernetes instance
with the C2’s MicroK8s Ansible role
c2platform.mw.microk8s
. - Kubernetes Configuration: Ansible further configures the Kubernetes
cluster using the C2’s Kubernetes role
c2platform.mw.kubernetes
. - Argo CD Installation: Argo CD is installed using the same Kubernetes role.
- Argo Rollout Installation and Demo App Deployment: Argo Rollouts and the demo application are deployed using the same Kubernetes role.
After completing these steps, you can access the Argo CD UI at: https://argocd.c2platform.org .
Prerequisites
Ensure the C2 Platform’s development environment is set up and the reverse and
forward proxy c2d-rproxy1
is running.
c2
unset PLAY # ensure all plays run
vagrant up c2d-rproxy1
For more information, refer to Setup a Development Environment on Ubuntu 22 .
Setup
Run the following command to create a Kubernetes instance and deploy Argo CD. The entire process takes about 7 minutes.
vagrant up c2d-argocd
The console output should be similar to
provision.log
.
Login using Argo CD CLI
SSH into the Vagrant
LXD
container c2d-argocd
using the command:
vagrant ssh c2d-argocd
Inside c2d-argocd
, the KUBECONFIG
1 environment variable is already
configured, allowing the Argo CD CLI and Kubernetes tools like kubectl
to
connect to the cluster.
Log in to Argo CD with these commands:
export ARGOCD_ADMIN_INITIAL_PW="$(argocd admin initial-password -n argocd | head -1)"
argocd login argocd.c2platform.org --username admin --password $ARGOCD_ADMIN_INITIAL_PW
Show Command Output
root@c2d-argocd:~# argocd login argocd.c2platform.org --username admin --password $ARGOCD_ADMIN_INITIAL_PW
'admin:login' logged in successfully
Context 'argocd.c2platform.org' updated
root@c2d-argocd:~#
Update admin password
For convenience, update to a simpler password, such as supersecret
, ensuring it meets password requirements. Run the command:
argocd account update-password --account admin --current-password $ARGOCD_ADMIN_INITIAL_PW --new-password supersecret
Login to Argo CD UI
Launch Firefox using the configured Firefox profile (see
Configure a FireFox Profile
).
Navigate to
https://argocd.c2platform.org
,
login as admin
with the password supersecret
. You should see the following:

Vagrant snapshot
After setup, create a snapshot (v0
) for future reference:
vagrant snapshot save c2d-argocd v0
To restore, use:
vagrant snapshot restore c2d-argocd v0
Run vagrant --help
for more information on Vagrant CLI commands.
Next Steps
With Argo CD installed, proceed to deploy the guestbook demo application, that will help you get a better understanding on how Argo CD works.
Additional Information
- Argo CD - Declarative GitOps CD for Kubernetes
- Argo Rollouts - Kubernetes Progressive Delivery Controller
The file
/etc/profile.d/mk8s.sh
contains a line withKUBECONFIG
as shown below, giving access to the Kubernetes cluster insidec2d-argocd
:↩︎export KUBECONFIG=/var/snap/microk8s/current/credentials/client.config
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.