Skip to content

UCL-ARC/terraform-harvester-vm-demo

Repository files navigation

terraform-harvester-vm-demo

Important

This repository is still under construction!

A Terraform template for new ARC Terraform projects or modules. It has a suggested skeleton structure and GitHub Actions workflows.

It will deploy a virtual machine using the Harvester Terraform provider.

This template is suitable for deploying VMs on Condenser.

Usage

  1. Use this template when creating a new repo. If creating a self-contained module, name your repo according to the module naming convention of terraform--.
  2. Change CODEOWNERS to you or your Team.

Deployment

This module can be deployed as-is.

Create a new file env.tfvars with the following contents to configure the variables for the module:

img_display_name = "almalinux-9.3" # Display name of an image in the harvester-public namespace
prefix           = "terraform-harvester-vm-demo"
namespace        = "my-ns" # A namespace in the cluster
public_key       = "my-key" # Your key in the namespace
network_name     = "my-net" # A network in the namespace; this can also be left empty

Obtain a suitable kubeconfig file to access the Harvester cluster. Then you can deploy this module as follows:

KUBECONFIG=/path/to/kubeconfig.yaml terraform apply -var-file=env.tfvars

And you can destroy the VM like so:

KUBECONFIG=/path/to/kubeconfig.yaml terraform apply -destroy -var-file=env.tfvars

Requirements

Name Version
terraform >= 1.8.5
harvester 0.6.4
random 3.6.2

Providers

Name Version
harvester 0.6.4
random 3.6.2

Modules

No modules.

Resources

Name Type
harvester_cloudinit_secret.cloud-config resource
harvester_virtualmachine.vm resource
random_id.secret resource
harvester_image.img data source
harvester_ssh_key.mysshkey data source

Inputs

Name Description Type Default Required
img_display_name Display name of an image in the harvester-public namespace string n/a yes
namespace Namespace that the SSH public key and network are already deployed in, and that the VM will be deployed in string n/a yes
network_name Name of a network in the specified namespace string n/a yes
prefix Prefix for the VM name string n/a yes
public_key Name of an SSH key in the specified namespace string n/a yes
vm_count n/a number 1 no

Outputs

Name Description
vm_ids n/a

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages