Skip to content

How To Start Using Cyber@UC's Incus Server

Objective

Quickly get access to the Incus environment and deploy resources using the GitLab + Terraform workflow.

Overview

Our implementation of Incus leverages GitLab integrated with Terraform to manage all server resources efficiently. This setup automates infrastructure provisioning through a pipeline that deploys Terraform code committed to our GitLab Incus project repository.

Estimated Time

10–20 minutes for initial setup; 5 minutes per subsequent change.

Prerequisite

Getting Started

To begin, ensure your VPN is connected and (optionally) your certificate is installed if you plan to use the web console.

Web Console

The Incus web console allows easy management and monitoring of server resources. Access it at:

incus.cyberatuc.org OR 192.168.2.23:8443

Important: Ensure you are connected to the VPN to access this link.

Steps to Access the Web Console

  1. Connect to VPN

    • Ensure your VPN client is running and connected.
  2. Navigate to Incus Web Console

  3. Authenticate with Certificate

    • Follow the certificate installation guide here.
    • Only required once during your initial verification to the console.

Terraform Management via GitLab

Overview

Infrastructure changes are managed through Terraform code, version-controlled using GitLab. Committing Terraform files (.tf) to the Incus GitLab project triggers an automated pipeline.

Example Workflow

  1. Clone the repository:
git clone https://gitlab.example.com/incus-project.git
cd incus-project
  1. Modify Terraform Configuration:
# Example Terraform configuration
resource "incus_instance" "example" {
  name  = "example-instance"
  image = "ubuntu:22.04"
  type  = "virtual-machine"
}
  1. Commit and Push Changes:
git add .
git commit -m "Add example Incus VM instance"
git push origin main
  1. Pipeline Execution:

    • GitLab pipeline is automatically triggered.
    • Monitor pipeline status in GitLab under CI/CD > Pipelines.

Validate Your Deployment

  • Confirm the pipeline succeeded in GitLab.
  • From the web console, verify your instance appears and is running.
  • From CLI (if applicable), verify connectivity to the instance.

Cleanup

  • To delete resources, remove the corresponding Terraform resources and push a commit. The pipeline will reconcile the state and remove them.

Monitoring and Troubleshooting

  • Pipeline logs are available directly in GitLab under the pipeline view.
  • Common Terraform errors and solutions: see GitLab job logs and Terraform error messages. If needed, contact Infra in #lab.

Resources and Further Reading

Additional Information Needed