Skip to content

leoarry/proxmox-frigate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frigate Proxmox Deployment

Frigate LXC image creation and deployment on Proxmox using HashiCorp Packer and Terraform.

Prerequisite

Download this repo

Install Packer and Terraform

Install packer and terraform then download this repository

Optional - Coral M.2 drivers

Install the Google coral M.2 drivers on the Proxmox host with the following script

apt-get update
apt-get upgrade -y
apt install -y pve-headers git devscripts dh-dkms libedgetpu1-std
cd /home
git clone https://github.com/google/gasket-driver.git
cd gasket-driver/
debuild -us -uc -tc -b -d
cd ..
dpkg -i gasket-dkms_1.0-18_all.deb

Remember to disable the secure boot on the proxmox host

Packer - Create Frigate golden image

open the /packer folder and edit the variables.pkrvars.hcl then run the script below from the /packer folder

packer init .
packer build -var-file="variables.pkrvars.hcl" .

Configuration Example

frigate_version = "stable"
image_name = "FrigateProxmoxLxc"
image_output_path= "/mnt/storage/template/cache"
ssh_username = "root"
ssh_password = "ChangeMe"
remote_host = "127.0.0.1"

Inputs

Name Description Type Default Required
frigate_config Frigate configuration to load into the LXC image string "mqtt:\n enabled: False\n\ncameras:\n dummy_camera:\n enabled: False\n ffmpeg:\n inputs:\n - path: rtsp://127.0.0.1:554/rtspn roles:\n - detect\n" no
frigate_version Frigate docker image tag used for download string "stable" no
image_name Output image file name string "FrigateProxmoxLxc" no
image_output_path Path where to create the image (path to your Proxmox LXC storage) string "/mnt/storage/template/cache" no
network_config LXC network config file (will override content of /etc/network/interfaces) string "auto lo\niface lo inet loopback\n\n# interfaces(5) file used by ifup(8) and ifdown(8)\n# Include files from /etc/network/interfaces.d:\nsource /etc/network/interfaces.d/*\n\nauto eth0\niface eth0 inet dhcp\n" no
remote_host Remote host IP address (usually Proxmox IP address) string "127.0.0.1" no
ssh_password SSH user password string "ChangeMe" no
ssh_username SSH user with admin access to create and manage LXC containers string "root" no
use_sudo Run provisioning script as sudo bool false no

Terraform - Deploy Frigate to proxmox

open the /terraform folder and edit the variables.tfvars then run the script below from the /terraform folder

terraform init
terraform validate
terraform apply -var-file="variables.tfvars"

Providers

Name Version
null 3.2.2
proxmox 2.9.14

Outputs

No outputs.

Configuration Example

proxmox = {
  ip = "127.0.0.1"
  user = "root@pam"
  password = "ProxmoxUserPassword"
  target_node = "pve-node-name"
}

image = {
  name = "FrigateProxmoxLxc"
  storage = "storage"
}

lxc_password = "ChangeMe"

network = {
  name = "eth0"
  bridge = "vmbr0"
  ip4 = "10.10.10.10"
  ip4mask = "24"
}

storage_fs = {
  name = "local-lvm"
  size = "8G"
}

storage_media = {
  name = "storage"
  size = "20G"
}

frigate_config = <<-EOT
mqtt:
  enabled: False

cameras:
  dummy_camera:
    enabled: False
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:554/rtsp
          roles:
            - detect
EOT

Inputs

Name Description Type Default Required
ct_id Frigate container ID number 0 no
frigate_config Frigate configuration to upload to the container string "" no
image Frigate LXC image name and storage location
object({
name = string
storage = string
})
{
"name": "",
"storage": ""
}
no
lxc_extraconfig Extra configuration to append to the frigate .conf file list(string) [] no
lxc_hostname Hostname for the Frigate container string "frigate" no
lxc_password Root user password for the Frigate container string "" no
network Network details for the Frigate container
object({
name = string
bridge = string
ip4 = string
ip4mask = string
})
{
"bridge": "vmbr0",
"ip4": "",
"ip4mask": "24",
"name": "eth0"
}
no
on_boot Start the Frigate container when the host boot bool true no
proxmox Target proxmox instance
object({
ip = string
user = string
password = string
target_node = string
})
{
"ip": "",
"password": "",
"target_node": "",
"user": "root@pam"
}
no
resources Resources assigned to the Frigate container
object({
cores = number
memory = number
swap = number
})
{
"cores": 2,
"memory": 2048,
"swap": 512
}
no
storage_fs Storage name and size of the virtual disk to create for Frigate container root fs
object({
name = string
size = string
})
{
"name": "",
"size": "8G"
}
no
storage_media Storage name (or path for binding mount) and size of the virtual disk to create for Frigate container root fs
object({
name = string
size = string
})
{
"name": "",
"size": "20G"
}
no

Resources

  • resource.null_resource.frigate_config (terraform/main.tf#116)
  • resource.null_resource.frigate_lxc_config (terraform/main.tf#65)
  • resource.null_resource.frigate_start (terraform/main.tf#95)
  • resource.proxmox_lxc.frigate_lxc (terraform/main.tf#23)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published