This repository contains Ansible playbooks and roles for setting up a complete infrastructure demo environment using K3s, Apache Guacamole, KubeVirt, and VM management capabilities.
The infrastructure consists of four main components:
-
K3s (Lightweight Kubernetes)
- A lightweight Kubernetes distribution
- Provides the base container orchestration platform
- Includes kubectl configuration and bash completion
-
Apache Guacamole
- Clientless remote desktop gateway
- Supports various protocols (RDP, VNC, SSH)
- Web-based interface for remote access
-
KubeVirt
- Virtualization extension for Kubernetes
- Enables running VMs alongside containers
- Integrates VM management with Kubernetes
-
VM Management
- Tools and configurations for VM lifecycle management
- Integration with KubeVirt for VM operations
- Ubuntu/Debian-based system
- Root or sudo access
- Internet connectivity
- Ansible (will be installed automatically if not present)
-
Clone this repository:
git clone https://github.com/thisiskazem/guac-demo cd guac-demo chmod +x install.sh -
Run the installation script:
sudo ./install.sh
The installation script will:
- Install Ansible if not present
- Execute the Ansible playbook with all required roles
- Set up the complete infrastructure
.
├── install.sh # Installation script
├── inventory.ini # Ansible inventory file
├── playbook.yml # Main Ansible playbook
└── roles/ # Ansible roles
├── group1_k3s/ # K3s installation and configuration
├── group2_guacamole/ # Apache Guacamole setup
├── group3_kubevirt/ # KubeVirt installation
└── group4_vm/ # VM management configuration
After installation, you can access:
- Kubernetes cluster using
kubectlorkalias - Guacamole web interface at
http://localhost:<port> - VM management through KubeVirt using
virtctl
To connect to a VM using Guacamole, follow these steps:
-
Find the port for Guacamole loadbalancer:
k get svc -n guacamole
-
Open your browser and navigate to:
http://localhost:<port>(Replace
<port>with the port number you found in step 1) -
Login with the following credentials:
- Username:
guacadmin - Password:
guacadmin
- Username:
-
Click on the user profile icon in the top right corner and select "Settings"
-
From the top tabs, select "Connections"
-
Click on "New Connection"
-
In the "EDIT CONNECTION" section:
- Enter a name for your connection
- Set Protocol to "RDP"
- In the "PARAMETERS" section:
- Under "Network":
- Hostname: Enter the VM's IP address (get it using
k get vmi) - Port:
3389
- Hostname: Enter the VM's IP address (get it using
- Under "Authentication":
- Username:
ubuntu - Password:
ubuntu
- Username:
- Under "Network":
-
Click "Save" at the bottom of the page
-
Click on the user profile icon again and select "Home"
-
In the "ALL CONNECTIONS" section, click on your newly created connection to access the VM's GUI