Skip to content

Commit

Permalink
feat: add unifi module
Browse files Browse the repository at this point in the history
  • Loading branch information
sarumont committed Sep 26, 2023
1 parent 7cb0f51 commit a95aea3
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tf/unifi/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
resource "kubernetes_namespace" "ns" {
metadata {
name = var.namespace
}
}

resource "helm_release" "unifi" {
name = "unifi"
namespace = kubernetes_namespace.ns.metadata.0.name
chart = "unifi-controller"
repository = "https://sarumont.github.io/homelab"
version = var.chart_version

values = [
<<EOT
image:
registry: ${var.image_registry}
repository: ${var.image_repository}
tag: ${var.image_version}
env:
TZ: ${var.timezone}
service:
loadBalancerIP: ${var.ip}
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1
memory: 3Gi
EOT
]
}
39 changes: 39 additions & 0 deletions tf/unifi/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
variable "replica_count" {
description = "Number of pods to run"
default = 1
type = number
}

variable "timezone" {
description = "Timezone to use for various services"
default = "America/Denver"
}

variable image_registry {
description = "Unifi Controller image registry"
default = "docker.io"
}

variable image_repository {
description = "Unifi Controller image repository"
default = "jacobalberty/unifi"
}

variable image_version {
description = "Unifi Controller version"
default = "7.3.83"
}

variable chart_version {
description = "Unifi Controller chart version"
default = "1.1.0"
}

variable namespace {
description = "Unifi Controller Namespace"
default = "unifi"
}

variable ip {
description = "IP to use for the Unifi Controller service"
}

0 comments on commit a95aea3

Please sign in to comment.