Prerequisites
Ensure that you have the following installed on your local machine:
- Ansible
- SSH access to the target host
- Required dependencies for Kubernetes
Two passwords are required via the prompt:
- The username used to connect to the host via SSH.
- The root password for privilege escalation.
-
You can use a user on the name with
NOPASSWDpermissions and not use--ask-become-pass -
You can use
ssh-copy-idon the remote host on the user that you will provide and not use--ask-pass
Deployment Instructions
Deploying K3s
Replace HOST_NAME with the IP address or hostname of the target machine in my_hosts.yaml, then run:
ansible-playbook -i <YOUR_HOST_IP>, deploy_k3s.yml --extra-vars "user_prompt=YOUR_USER" --ask-pass --ask-become-pass
This playbook:
- Updates package repositories.
- Installs necessary dependencies.
- Ensures the user has
sudoprivileges. - Downloads and installs K3s.
- Configures permissions for Kubernetes operations.
- Enables auto-completion for
kubectl. - Reboots the machine to apply changes.
Deploying Argo Workflows
Replace HOST_NAME with the IP address or hostname of the target machine in my_hosts.yaml, then run:
ansible-playbook -i <YOUR_HOST_IP>, deploy_argo.yml --extra-vars "user_prompt=<YOUR_USER>" --ask-pass --ask-become-pass
This playbook:
- Ensures the
argonamespace exists in Kubernetes. - Deploys Argo Workflows using the official manifest.
- Waits for the
argo-serverpod to be running. - Patches the deployment for first-time connection issues.
- Applies a service configuration to expose Argo Workflows via NodePort.
- Installs the Argo CLI.
- Enables CLI autocompletion.
- Configures
kubectlfor Argo access.
Additional Notes
- The service account used by default is
argo:default, which may not have sufficient permissions. Useargo:argoinstead:argo submit -f workflow.yaml --serviceaccount=argo - The Argo CLI is installed in
/usr/local/bin/argo. - The Kubernetes configuration file is copied to
~/.kube/config.
Troubleshooting
- If the deployment fails due to permissions, ensure the user has
sudoprivileges. - Check the status of Argo pods using:
kubectl get pods -n argo - If Argo Workflows is not accessible, verify that the NodePort service is correctly configured.