mirror of
https://github.com/vhaudiquet/homeprod.git
synced 2026-05-30 12:38:21 +00:00
Compare commits
5 Commits
543fc8a47e
...
b5e015f527
| Author | SHA1 | Date | |
|---|---|---|---|
|
b5e015f527
|
|||
|
d623cbb60c
|
|||
| a2ba97109b | |||
|
4f1e69cd05
|
|||
|
2df007dec1
|
@@ -1,137 +0,0 @@
|
|||||||
/*
|
|
||||||
* Docker machine terraform file
|
|
||||||
*/
|
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_download_file" "debian-latest-cloudimg" {
|
|
||||||
content_type = "iso"
|
|
||||||
datastore_id = "local"
|
|
||||||
file_name = "debian-12-generic-amd64.qcow2.img"
|
|
||||||
node_name = "pve"
|
|
||||||
url = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_file" "docker-machine-cloud-config" {
|
|
||||||
content_type = "snippets"
|
|
||||||
datastore_id = "local"
|
|
||||||
node_name = "pve"
|
|
||||||
|
|
||||||
source_raw {
|
|
||||||
data = <<-EOF
|
|
||||||
#cloud-config
|
|
||||||
package_update: true
|
|
||||||
packages:
|
|
||||||
- git
|
|
||||||
- ca-certificates
|
|
||||||
- wget
|
|
||||||
- curl
|
|
||||||
- gnupg2
|
|
||||||
- qemu-guest-agent
|
|
||||||
- nfs-common
|
|
||||||
runcmd:
|
|
||||||
- systemctl enable --now qemu-guest-agent
|
|
||||||
- install -m 0755 -d /etc/apt/keyrings
|
|
||||||
- curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
|
||||||
- chmod a+r /etc/apt/keyrings/docker.asc
|
|
||||||
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
||||||
- apt-get update
|
|
||||||
- apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
||||||
- docker swarm init
|
|
||||||
- git clone https://github.com/vhaudiquet/homeprod /root/homeprod
|
|
||||||
- mkdir /app
|
|
||||||
- echo "truenas.lan:/mnt/fast_app_data/docker-homeprod /app nfs defaults,_netdev 0 0" >>/etc/fstab
|
|
||||||
- mount -t nfs truenas.lan:/mnt/fast_app_data/docker-homeprod /app
|
|
||||||
- echo "${var.sops_private_key}" | gpg --import
|
|
||||||
EOF
|
|
||||||
file_name = "docker-machine-cloud-config.yaml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_vm" "docker-machine" {
|
|
||||||
name = "docker-machine"
|
|
||||||
node_name = "pve"
|
|
||||||
on_boot = true
|
|
||||||
|
|
||||||
agent {
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
tags = ["debian", "debian-latest", "docker", "terraform"]
|
|
||||||
|
|
||||||
cpu {
|
|
||||||
type = "host"
|
|
||||||
cores = 4
|
|
||||||
sockets = 1
|
|
||||||
flags = []
|
|
||||||
}
|
|
||||||
|
|
||||||
memory {
|
|
||||||
dedicated = 16192
|
|
||||||
}
|
|
||||||
|
|
||||||
network_device {
|
|
||||||
bridge = "vmbr0"
|
|
||||||
model = "virtio"
|
|
||||||
vlan_id = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
lifecycle {
|
|
||||||
ignore_changes = [
|
|
||||||
network_interface_names,
|
|
||||||
mac_addresses,
|
|
||||||
ipv4_addresses,
|
|
||||||
ipv6_addresses,
|
|
||||||
id,
|
|
||||||
disk,
|
|
||||||
initialization,
|
|
||||||
vga
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
boot_order = ["scsi0"]
|
|
||||||
scsi_hardware = "virtio-scsi-single"
|
|
||||||
|
|
||||||
vga {
|
|
||||||
type = "serial0"
|
|
||||||
}
|
|
||||||
|
|
||||||
disk {
|
|
||||||
interface = "scsi0"
|
|
||||||
iothread = true
|
|
||||||
datastore_id = "local-lvm"
|
|
||||||
size = 128
|
|
||||||
discard = "ignore"
|
|
||||||
file_id = proxmox_virtual_environment_download_file.debian-latest-cloudimg.id
|
|
||||||
}
|
|
||||||
|
|
||||||
vm_id = 701
|
|
||||||
|
|
||||||
initialization {
|
|
||||||
datastore_id = "local-lvm"
|
|
||||||
interface = "ide2"
|
|
||||||
|
|
||||||
ip_config {
|
|
||||||
ipv4 {
|
|
||||||
address = "10.1.2.175/24"
|
|
||||||
gateway = "10.1.2.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
user_account {
|
|
||||||
keys = [trimspace(var.ssh_public_key)]
|
|
||||||
password = var.machine_root_password
|
|
||||||
username = "root"
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor_data_file_id = proxmox_virtual_environment_file.docker-machine-cloud-config.id
|
|
||||||
}
|
|
||||||
|
|
||||||
operating_system {
|
|
||||||
type = "l26"
|
|
||||||
}
|
|
||||||
|
|
||||||
tpm_state {
|
|
||||||
version = "v2.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
serial_device {}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
terraform {
|
|
||||||
required_providers {
|
|
||||||
docker = {
|
|
||||||
source = "kreuzwerker/docker"
|
|
||||||
version = "3.6.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Docker configuration
|
|
||||||
provider "docker" {
|
|
||||||
host = "ssh://root@docker-machine.lan"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "docker_image" "swarm-cd" {
|
|
||||||
name = "ghcr.io/m-adawi/swarm-cd:latest"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "docker_container" "swarm-cd" {
|
|
||||||
name = "swarm-cd"
|
|
||||||
image = docker_image.swarm-cd.image_id
|
|
||||||
volumes {
|
|
||||||
host_path = "/var/run/docker.sock"
|
|
||||||
container_path = "/var/run/docker.sock"
|
|
||||||
read_only = true
|
|
||||||
}
|
|
||||||
volumes {
|
|
||||||
host_path = "/root/homeprod/.swarmcd/repos.yaml"
|
|
||||||
container_path = "/app/repos.yaml"
|
|
||||||
read_only = true
|
|
||||||
}
|
|
||||||
volumes {
|
|
||||||
host_path = "/root/homeprod/.swarmcd/stacks.yaml"
|
|
||||||
container_path = "/app/stacks.yaml"
|
|
||||||
read_only = true
|
|
||||||
}
|
|
||||||
|
|
||||||
depends_on = [ docker_image.swarm-cd ]
|
|
||||||
}
|
|
||||||
@@ -1,381 +0,0 @@
|
|||||||
/*
|
|
||||||
* Kubernetes cluster terraform file
|
|
||||||
*/
|
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_download_file" "talos-cloudimg" {
|
|
||||||
content_type = "iso"
|
|
||||||
datastore_id = "local"
|
|
||||||
file_name = "talos-v1.11.1-nocloud-amd64.iso"
|
|
||||||
node_name = "pve"
|
|
||||||
url = "https://factory.talos.dev/image/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515/v1.11.1/nocloud-amd64.iso"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_vm" "kube" {
|
|
||||||
name = "kube-talos"
|
|
||||||
description = "Kubernetes Talos Linux"
|
|
||||||
tags = ["kubernetes", "talos", "terraform"]
|
|
||||||
|
|
||||||
node_name = "pve"
|
|
||||||
vm_id = 703
|
|
||||||
machine = "q35"
|
|
||||||
keyboard_layout = "fr"
|
|
||||||
|
|
||||||
agent {
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
stop_on_destroy = true
|
|
||||||
|
|
||||||
cpu {
|
|
||||||
cores = 4
|
|
||||||
type = "x86-64-v3"
|
|
||||||
}
|
|
||||||
|
|
||||||
memory {
|
|
||||||
dedicated = 16192
|
|
||||||
floating = 16192
|
|
||||||
}
|
|
||||||
|
|
||||||
boot_order = ["scsi0", "ide0"]
|
|
||||||
scsi_hardware = "virtio-scsi-single"
|
|
||||||
|
|
||||||
cdrom {
|
|
||||||
file_id = proxmox_virtual_environment_download_file.talos-cloudimg.id
|
|
||||||
interface = "ide0"
|
|
||||||
}
|
|
||||||
|
|
||||||
disk {
|
|
||||||
interface = "scsi0"
|
|
||||||
iothread = true
|
|
||||||
datastore_id = "local-lvm"
|
|
||||||
size = 128
|
|
||||||
discard = "ignore"
|
|
||||||
file_format = "raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
vga {
|
|
||||||
type = "serial0"
|
|
||||||
}
|
|
||||||
|
|
||||||
initialization {
|
|
||||||
datastore_id = "local-lvm"
|
|
||||||
interface = "ide2"
|
|
||||||
|
|
||||||
ip_config {
|
|
||||||
ipv4 {
|
|
||||||
address = "10.1.2.187/24"
|
|
||||||
gateway = "10.1.2.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
user_account {
|
|
||||||
keys = [trimspace(var.ssh_public_key)]
|
|
||||||
password = var.machine_root_password
|
|
||||||
username = "root"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lifecycle {
|
|
||||||
ignore_changes = [
|
|
||||||
ipv4_addresses, ipv6_addresses, network_interface_names
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
network_device {
|
|
||||||
bridge = "vmbr0"
|
|
||||||
model = "virtio"
|
|
||||||
vlan_id = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
operating_system {
|
|
||||||
type = "l26"
|
|
||||||
}
|
|
||||||
|
|
||||||
tpm_state {
|
|
||||||
version = "v2.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
serial_device {}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "talos_machine_secrets" "kube" {}
|
|
||||||
|
|
||||||
data "talos_machine_configuration" "kube" {
|
|
||||||
cluster_name = "kube"
|
|
||||||
machine_type = "controlplane"
|
|
||||||
cluster_endpoint = "https://kube-talos.lan:6443"
|
|
||||||
machine_secrets = talos_machine_secrets.kube.machine_secrets
|
|
||||||
config_patches = [
|
|
||||||
yamlencode({
|
|
||||||
machine = {
|
|
||||||
install = {
|
|
||||||
image = "factory.talos.dev/installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.1"
|
|
||||||
}
|
|
||||||
network = {
|
|
||||||
nameservers = [
|
|
||||||
"10.1.2.3"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cluster = {
|
|
||||||
allowSchedulingOnControlPlanes = true
|
|
||||||
apiServer = {
|
|
||||||
certSANs = [
|
|
||||||
"kube-talos.lan"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
network = {
|
|
||||||
dnsDomain = "kube-talos.lan"
|
|
||||||
cni = {
|
|
||||||
name: "none"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
proxy = {
|
|
||||||
disabled = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
data "talos_client_configuration" "kube" {
|
|
||||||
cluster_name = "kube"
|
|
||||||
client_configuration = talos_machine_secrets.kube.client_configuration
|
|
||||||
nodes = ["kube-talos"]
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "talos_machine_configuration_apply" "kube" {
|
|
||||||
client_configuration = talos_machine_secrets.kube.client_configuration
|
|
||||||
machine_configuration_input = data.talos_machine_configuration.kube.machine_configuration
|
|
||||||
node = "10.1.2.187" #proxmox_virtual_environment_vm.kube.ipv4_addresses[7][0] # lo + 6 talos-created interfaces before eth0
|
|
||||||
depends_on = [ proxmox_virtual_environment_vm.kube ]
|
|
||||||
lifecycle {
|
|
||||||
replace_triggered_by = [ proxmox_virtual_environment_vm.kube ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "talos_machine_bootstrap" "kube" {
|
|
||||||
node = "10.1.2.187" #proxmox_virtual_environment_vm.kube.ipv4_addresses[7][0] # lo + 6 talos-created interfaces before eth0
|
|
||||||
client_configuration = talos_machine_secrets.kube.client_configuration
|
|
||||||
depends_on = [ talos_machine_configuration_apply.kube ]
|
|
||||||
lifecycle {
|
|
||||||
replace_triggered_by = [ proxmox_virtual_environment_vm.kube ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "talos_cluster_kubeconfig" "kube" {
|
|
||||||
node = proxmox_virtual_environment_vm.kube.ipv4_addresses[7][0] # lo + 6 talos-created interfaces before eth0
|
|
||||||
depends_on = [ talos_machine_bootstrap.kube ]
|
|
||||||
client_configuration = talos_machine_secrets.kube.client_configuration
|
|
||||||
}
|
|
||||||
|
|
||||||
output "kubeconfig" {
|
|
||||||
sensitive = true
|
|
||||||
value = talos_cluster_kubeconfig.kube.kubeconfig_raw
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "local_file" "kubeconfig" {
|
|
||||||
content = "${talos_cluster_kubeconfig.kube.kubeconfig_raw}"
|
|
||||||
filename = "${path.module}/kubeconfig"
|
|
||||||
depends_on = [ talos_cluster_kubeconfig.kube ]
|
|
||||||
}
|
|
||||||
|
|
||||||
data "talos_client_configuration" "talosconfig" {
|
|
||||||
cluster_name = "homeprod"
|
|
||||||
client_configuration = talos_machine_secrets.kube.client_configuration
|
|
||||||
nodes = [proxmox_virtual_environment_vm.kube.ipv4_addresses[7][0]]
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "local_file" "talosconfig" {
|
|
||||||
content = "${data.talos_client_configuration.talosconfig.talos_config}"
|
|
||||||
filename = "${path.module}/talosconfig"
|
|
||||||
depends_on = [ data.talos_client_configuration.talosconfig ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# TODO : Wait for talos_cluster_kubeconfig...
|
|
||||||
resource "helm_release" "cilium" {
|
|
||||||
name = "cilium"
|
|
||||||
namespace = "kube-system"
|
|
||||||
repository = "https://helm.cilium.io/"
|
|
||||||
chart = "cilium"
|
|
||||||
wait = false
|
|
||||||
depends_on = [ local_file.kubeconfig ]
|
|
||||||
|
|
||||||
set {
|
|
||||||
name = "ipam.mode"
|
|
||||||
value = "kubernetes"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "kubeProxyReplacement"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "securityContext.capabilities.ciliumAgent"
|
|
||||||
value = "{CHOWN,KILL,NET_ADMIN,NET_RAW,IPC_LOCK,SYS_ADMIN,SYS_RESOURCE,DAC_OVERRIDE,FOWNER,SETGID,SETUID}"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "securityContext.capabilities.cleanCiliumState"
|
|
||||||
value = "{NET_ADMIN,SYS_ADMIN,SYS_RESOURCE}"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "cgroup.autoMount.enabled"
|
|
||||||
value = false
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "cgroup.hostRoot"
|
|
||||||
value = "/sys/fs/cgroup"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "k8sServiceHost"
|
|
||||||
value = "localhost"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "k8sServicePort"
|
|
||||||
value = 7445
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "etcd.clusterDomain"
|
|
||||||
value = "kube-talos.lan"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "hubble.relay.enabled"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
# Enable hubble ui
|
|
||||||
set {
|
|
||||||
name = "hubble.ui.enabled"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
# Gateway API support
|
|
||||||
set {
|
|
||||||
name = "gatewayAPI.enabled"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "gatewayAPI.enableAlpn"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "gatewayAPI.enableAppProtocol"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
# Gateway API trusted hops : for reverse proxy
|
|
||||||
set {
|
|
||||||
name = "gatewayAPI.xffNumTrustedHops"
|
|
||||||
value = 1
|
|
||||||
}
|
|
||||||
# Single-node cluster, so 1 operator only
|
|
||||||
set {
|
|
||||||
name = "operator.replicas"
|
|
||||||
value = 1
|
|
||||||
}
|
|
||||||
# L2 announcements
|
|
||||||
set {
|
|
||||||
name = "l2announcements.enabled"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "externalIPs.enabled"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
# Disable ingress controller (traefik will be used for now)
|
|
||||||
set {
|
|
||||||
name = "ingressController.enabled"
|
|
||||||
value = false
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "ingressController.loadbalancerMode"
|
|
||||||
value = "shared"
|
|
||||||
}
|
|
||||||
# Ingress controller for external : behind reverse proxy, trust 1 hop
|
|
||||||
set {
|
|
||||||
name = "envoy.xffNumTrustedHopsL7PolicyIngress"
|
|
||||||
value = 1
|
|
||||||
}
|
|
||||||
# Set cilium as default ingress controller
|
|
||||||
set {
|
|
||||||
name = "ingressController.default"
|
|
||||||
value = true
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "ingressController.service.externalTrafficPolicy"
|
|
||||||
value = "Local"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "kubernetes_namespace" "flux-system" {
|
|
||||||
metadata {
|
|
||||||
name = "flux-system"
|
|
||||||
}
|
|
||||||
|
|
||||||
lifecycle {
|
|
||||||
ignore_changes = [ metadata[0].annotations, metadata[0].labels ]
|
|
||||||
}
|
|
||||||
|
|
||||||
depends_on = [ talos_cluster_kubeconfig.kube, local_file.kubeconfig, helm_release.cilium ]
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "kubernetes_secret" "flux-sops" {
|
|
||||||
metadata {
|
|
||||||
name = "flux-sops"
|
|
||||||
namespace = "flux-system"
|
|
||||||
}
|
|
||||||
|
|
||||||
type = "generic"
|
|
||||||
|
|
||||||
data = {
|
|
||||||
"sops.asc"=var.sops_private_key
|
|
||||||
}
|
|
||||||
|
|
||||||
depends_on = [ kubernetes_namespace.flux-system ]
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "helm_release" "flux-operator" {
|
|
||||||
name = "flux-operator"
|
|
||||||
namespace = "flux-system"
|
|
||||||
repository = "oci://ghcr.io/controlplaneio-fluxcd/charts"
|
|
||||||
chart = "flux-operator"
|
|
||||||
wait = true
|
|
||||||
depends_on = [ kubernetes_secret.flux-sops ]
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "helm_release" "flux-instance" {
|
|
||||||
name = "flux"
|
|
||||||
namespace = "flux-system"
|
|
||||||
repository = "oci://ghcr.io/controlplaneio-fluxcd/charts"
|
|
||||||
chart = "flux-instance"
|
|
||||||
|
|
||||||
values = [
|
|
||||||
file("values/components.yaml")
|
|
||||||
]
|
|
||||||
set {
|
|
||||||
name = "instance.distribution.version"
|
|
||||||
value = "2.x"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "instance.distribution.registry"
|
|
||||||
value = "ghcr.io/fluxcd"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "instance.sync.name"
|
|
||||||
value = "homeprod"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "instance.sync.kind"
|
|
||||||
value = "GitRepository"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "instance.sync.url"
|
|
||||||
value = "https://github.com/vhaudiquet/homeprod"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "instance.sync.path"
|
|
||||||
value = "kubernetes/"
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
name = "instance.sync.ref"
|
|
||||||
value = "refs/heads/main"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
depends_on = [ helm_release.flux-operator ]
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
# Terraform providers configuration
|
|
||||||
terraform {
|
|
||||||
required_providers {
|
|
||||||
proxmox = {
|
|
||||||
source = "bpg/proxmox"
|
|
||||||
version = "0.83.2"
|
|
||||||
}
|
|
||||||
talos = {
|
|
||||||
source = "siderolabs/talos"
|
|
||||||
version = "0.9.0"
|
|
||||||
}
|
|
||||||
kubernetes = {
|
|
||||||
source = "hashicorp/kubernetes"
|
|
||||||
version = "2.38.0"
|
|
||||||
}
|
|
||||||
helm = {
|
|
||||||
source = "hashicorp/helm"
|
|
||||||
version = "2.17.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Proxmox configuration
|
|
||||||
provider "proxmox" {
|
|
||||||
endpoint = "https://pve.lan:8006/"
|
|
||||||
api_token = var.api_token
|
|
||||||
insecure = true
|
|
||||||
ssh {
|
|
||||||
agent = true
|
|
||||||
username = "root"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Talos configuration
|
|
||||||
provider "talos" {}
|
|
||||||
|
|
||||||
# Kubernetes configuration
|
|
||||||
provider "kubernetes" {
|
|
||||||
config_path = "${path.module}/kubeconfig"
|
|
||||||
}
|
|
||||||
# Helm configuration
|
|
||||||
provider "helm" {
|
|
||||||
kubernetes {
|
|
||||||
config_path = "${path.module}/kubeconfig"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
variable "api_token" {
|
|
||||||
description = "Token to connect Proxmox API"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "machine_root_password" {
|
|
||||||
description = "Root password for VMs and containers"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "ssh_public_key" {
|
|
||||||
description = "Public SSH key authorized access for VMs and containers"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "sops_private_key" {
|
|
||||||
description = "Private SOPS GPG key for flux/kubernetes to decrypt secrets"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
@@ -44,7 +44,10 @@ data "talos_machine_configuration" "kube" {
|
|||||||
}
|
}
|
||||||
network = {
|
network = {
|
||||||
nameservers = [
|
nameservers = [
|
||||||
"10.1.2.3"
|
# We need a set of nameservers that can work independently of kube
|
||||||
|
# to bootstrap.
|
||||||
|
"10.1.2.148",
|
||||||
|
"1.1.1.1"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
certSANs = [
|
certSANs = [
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ instance:
|
|||||||
type: kubernetes
|
type: kubernetes
|
||||||
multitenant: false
|
multitenant: false
|
||||||
networkPolicy: true
|
networkPolicy: true
|
||||||
domain: "kube-talos.lan"
|
domain: "cluster.local"
|
||||||
kustomize:
|
kustomize:
|
||||||
patches:
|
patches:
|
||||||
- target:
|
- target:
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
image:
|
image:
|
||||||
tag: 1.25.5
|
tag: 1.26.2
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
hosts:
|
hosts:
|
||||||
@@ -17,10 +17,10 @@ postgresql:
|
|||||||
global:
|
global:
|
||||||
postgresql:
|
postgresql:
|
||||||
auth:
|
auth:
|
||||||
postgressPassword: ENC[AES256_GCM,data:MGHcVoXxZmaAaA==,iv:jzp5H+mT1mwbJvuDnlgfQBMsilAZcR9Wpdv1Bem8zvc=,tag:9vPppIbycDJfgRV45jkwFg==,type:str]
|
postgressPassword: neptune343
|
||||||
password: ENC[AES256_GCM,data:jm4ffAcu06Rqog==,iv:pBWzn+/Udl99Vv7bLRv37uNZjPY/xMqrvDgUw6o+Am8=,tag:Y8PEv+NoEr9YU86WVebZqQ==,type:str]
|
password: neptune343
|
||||||
database: gitea
|
database: gitea
|
||||||
username: ENC[AES256_GCM,data:OmrAE7E=,iv:ABU5b4rhwtxz0n8kwI7Nxqn0Cn//B4ScWJdYU3cE5ds=,tag:q/g0741vR06c5nDWGnTvYA==,type:str]
|
username: gitea
|
||||||
volumePermissions:
|
volumePermissions:
|
||||||
enabled: true
|
enabled: true
|
||||||
postgresql-ha:
|
postgresql-ha:
|
||||||
@@ -41,8 +41,8 @@ gitea:
|
|||||||
oauth:
|
oauth:
|
||||||
- name: Authentik
|
- name: Authentik
|
||||||
provider: openidConnect
|
provider: openidConnect
|
||||||
key: ENC[AES256_GCM,data:BvrQCp1uuKsU+ghFqGDtDSXkx71byFQnOKSCU2iMLQebhsZdocZbJQ==,iv:WY3p4ygfc7CuEjK18Ktr2c/a5bDnCoyNSfKqjXwjZuY=,tag:INMKosSqPzJOCcZ9m3UKKQ==,type:str]
|
key: szVZ3lPAjI0WJMisxTBnBXSRtglgCJGKXWSDAvbF
|
||||||
secret: ENC[AES256_GCM,data:7kWuHYZ+2UlLrlRC6bX54xu0EJ264pP3EkfycleNnE647+VNInviZ9OFdz+2E+Ujw5ktuU8Edl49ex/TZ3BLyBv5bgHgCySLIHrB9keEZIxuhnfV53csq7KmIvO+NALDbU2OlZZaiAyNMbJjRCSAxXRT2WtPVzadt6HkW3niiRE=,iv:4uWctDxVpRzqdErKp05WKuz7WYH5frktMe3gly4+VW0=,tag:isaFJX5Q+XaZnY1F2HFdfw==,type:str]
|
secret: pjRjUb1kSvmljl1foJCUWTpxGpwEViowUaTBbeebpS7QoehxS6y9sUoA5pgxgEYQta9HpnSshwGkNRVeYEjCkNv0uEV3K0r70Cp21ClOFeN7g5g8gmbgNRR5MAApg8Ma
|
||||||
autoDiscoverUrl: https://authentik.vhaudiquet.fr/application/o/gitea/.well-known/openid-configuration
|
autoDiscoverUrl: https://authentik.vhaudiquet.fr/application/o/gitea/.well-known/openid-configuration
|
||||||
config:
|
config:
|
||||||
APP_NAME: Gitea
|
APP_NAME: Gitea
|
||||||
@@ -68,29 +68,3 @@ gitea:
|
|||||||
indexer:
|
indexer:
|
||||||
ISSUE_INDEXER_TYPE: bleve
|
ISSUE_INDEXER_TYPE: bleve
|
||||||
REPO_INDEXER_ENABLED: true
|
REPO_INDEXER_ENABLED: true
|
||||||
sops:
|
|
||||||
lastmodified: "2026-04-05T11:32:32Z"
|
|
||||||
mac: ENC[AES256_GCM,data:etLsvUBjDtzqpwdP9jontcVmFRvvsy7z70Rcztvm6kNybRsWKss2hRarl+IhxBqI5rQYaWjON9BNpjIBjnmKVPiwV7lYF7cSTEiHrCCBrFyhwYKxgsgwZCWCfSgOLMlhTjI55wISPFyhHaC/O6CsuzcGRAQ52B2PZBaeY0vNgF4=,iv:aag0M1SJn7uVLu99wmGMp3Ms5jlJCTzkyGUsdzcrGAE=,tag:H2+gdObpNEnoDKaW3IT+wQ==,type:str]
|
|
||||||
pgp:
|
|
||||||
- created_at: "2026-04-05T11:32:28Z"
|
|
||||||
enc: |-
|
|
||||||
-----BEGIN PGP MESSAGE-----
|
|
||||||
|
|
||||||
hQIMA7uy4qQr71wiAQ/+KsQV7ZuIF9YaJQjnLJk88FP661mApTJeQRo7MI/SIGTK
|
|
||||||
Xrj2j9EU2QRny/56YD6x/vqENQ8Appnew4ejtLEJY/wWmfSaSuO0JWk40tOa95od
|
|
||||||
YxQhYBi0/DuCTtLdLs1lrOH+GEKSQNbE8Srv6gmaWweu1yLHUye44M8DxOd+/dbf
|
|
||||||
5q4sRtldgpAm8EFjdZQcollzoFyUDiE/G1bpml4hbkHVJhlSfJHTGN6bq96yuG2l
|
|
||||||
et0MnNAMW2EJh3w6vGk1CJfEB6LUfR6KNUM4oPI3qVy9GeGDgTi4xv1cYAiVIcEv
|
|
||||||
hXfDrwDGm1pUakLklzKcJ9TpNokPCimax5O2dNDKBdFaGuGVfYzIzcSIY1W3qZV9
|
|
||||||
KfpaCtkfIDOtwUdjvxcdhpGbYYckcEz0TFtwTIIPeznQvyhtqNcNV9TDxmDoQiYG
|
|
||||||
l1iY2dSoi7Fae7HT0QDrxw8rV9L2d+1qPkiEz9yOq+oJGYzuIy7ygPO7X1x2vkYm
|
|
||||||
lXoxVyFrbH3K4Wb4ibukdAkrqQKZYnhqpxtvB/SFTlS90r2wewQSfivBTHT3yh3d
|
|
||||||
j0Zjr2Ga8fiFdmy5ELyj7oKO4AWY67eFe1TdfV9dPb0qO7tVph2NbcNyhgp59ejk
|
|
||||||
lUjJCJKlDyysu7VAvF8RzzQhfwBrZqar55Mou+HvrypOJpoCCKH9GNiemoudSx3S
|
|
||||||
XAH+uZb87/xPqJP5XyXqOvW4WvLNRxCUcHwur9USiluKZYhdtaYicTOy3iif+sD+
|
|
||||||
m80ahUph//L/9qTbNQU51AF1Lq0X6Mh0GkBa1b61iJu/PWizjlEEJS+/xpN5
|
|
||||||
=FJi9
|
|
||||||
-----END PGP MESSAGE-----
|
|
||||||
fp: DC6910268E657FF70BA7EC289974494E76938DDC
|
|
||||||
encrypted_regex: ^(password|value|ssh-key|api-key|user|username|privateKey|clientSecret|clientId|apiKey|extraArgs.*|.*Secret.*|extraEnvVars|.*SECRET.*|.*secret.*|key|.*Password|.*\.ya?ml)$
|
|
||||||
version: 3.10.2
|
|
||||||
|
|||||||
@@ -58,35 +58,35 @@ probes:
|
|||||||
failureThreshold: 30
|
failureThreshold: 30
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
|
cpu: 600m
|
||||||
|
memory: 768Mi
|
||||||
|
requests:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
memory: 256Mi
|
memory: 256Mi
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 64Mi
|
|
||||||
# Full list of options https://github.com/0xERR0R/blocky/blob/main/docs/config.yml
|
# Full list of options https://github.com/0xERR0R/blocky/blob/main/docs/config.yml
|
||||||
config: "upstreams:\n groups:\n default:\n - 1.1.1.1\n - 1.0.0.1\n lan:\n - 10.101.207.1\n\nconditional:\n mapping:\n lan: 10.101.207.1\n cluster.local: 10.96.0.10\n in-addr.arpa: 10.96.0.10\n\nblocking:\n allowlists:\n ads:\n - |\n dealabs.digidip.net\n s.click.aliexpress.com\n fonts.googleapis.com\n fonts.gstatic.com\n wl.spotify.com\n www.googleadservices.com\n \n denylists:\n ads:\n - https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts\n - https://adaway.org/hosts.txt\n \n clientGroupsBlock:\n default:\n - ads\n \n blockType: zeroIp\n blockTTL: 1m\n loading:\n refreshPeriod: 4h\n downloads:\n timeout: 60s\n\ncaching:\n minTime: 5m\n maxTime: 30m\n # Disable negative caching (NXDOMAIN responses) for dynamic DNS\n cacheTimeNegative: 0\n prefetching: true\n prefetchExpires: 2h\n prefetchThreshold: 5\n\nprometheus:\n enable: true\n path: /metrics\n\nports:\n dns: 53\n http: 4000\n\nbootstrapDns: tcp+udp:1.1.1.1\n\nlog:\n level: info\n format: text\n timestamp: true\n"
|
config: "upstreams:\n groups:\n default:\n - 1.1.1.1\n - 1.0.0.1\n lan:\n - 10.101.207.1\n\nconditional:\n mapping:\n lan: 10.101.207.1\n cluster.local: 10.96.0.10\n in-addr.arpa: 10.96.0.10\n\nblocking:\n allowlists:\n ads:\n - |\n dealabs.digidip.net\n s.click.aliexpress.com\n fonts.googleapis.com\n fonts.gstatic.com\n wl.spotify.com\n www.googleadservices.com\n \n denylists:\n ads:\n - https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts\n - https://adaway.org/hosts.txt\n \n clientGroupsBlock:\n default:\n - ads\n \n blockType: zeroIp\n blockTTL: 1m\n loading:\n refreshPeriod: 4h\n downloads:\n timeout: 60s\n\ncaching:\n minTime: 5m\n maxTime: 30m\n # Disable negative caching (NXDOMAIN responses) for dynamic DNS\n cacheTimeNegative: 0\n prefetching: true\n prefetchExpires: 2h\n prefetchThreshold: 5\n\nprometheus:\n enable: true\n path: /metrics\n\nports:\n dns: 53\n http: 4000\n\nbootstrapDns: tcp+udp:1.1.1.1\n\nlog:\n level: info\n format: text\n timestamp: true\n"
|
||||||
sops:
|
sops:
|
||||||
lastmodified: "2026-05-02T17:51:26Z"
|
lastmodified: "2026-05-26T22:01:30Z"
|
||||||
mac: ENC[AES256_GCM,data:J7EovwsXi2L9XocZoi5ann71DQ+wWZk2aCUbjvaGpv0yZC5g2HNccPVRvAj3y9SyMttLT8QlESXzHpEV2A6bOfmJf5v0ACYuWn5wKNlkaBdmTs1xwXp/RcpeOb+FCL9D+9hzjBO9XF6iXZLSj4pO/n1C0IhfeqYKdDC4tHkxOHA=,iv:Qm3Uh+UUSDWCxh7gWJ9x597aWXdMHxtpixE2BVlb6c8=,tag:aHbK26P4f9YV2uGLhpT6OA==,type:str]
|
mac: ENC[AES256_GCM,data:PkXQH3Y+r4JUSRXJbNO+nQUhEvlQecvz5Jxwlb0bL3PPTi8Y8dCx9kxQAvMM9cijpcavGI04Fy0jRS07draTxlddzZ6FYqvVeu1FzQNtnVsobW/KNZ9mYIYPr9YEvybgHpdbbuO6lVjbERRrOLIFuECIpLoPX5D8+p8+43zBpAE=,iv:XJi6BsIC7wk7bqwSUFZMOwR3shYKjydvqBKNC55mmck=,tag:4C+QU5EAvUU+maw9txgGPQ==,type:str]
|
||||||
pgp:
|
pgp:
|
||||||
- created_at: "2026-05-02T17:51:25Z"
|
- created_at: "2026-05-26T22:01:29Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
-----BEGIN PGP MESSAGE-----
|
-----BEGIN PGP MESSAGE-----
|
||||||
|
|
||||||
hQIMA7uy4qQr71wiAQ/+Po8UdkiFGt0LmcvCeSE23aoWwY4qi2FsGKdik+7sL3RN
|
hQIMA7uy4qQr71wiAQ//USgWAGbn6zOOTw0agC/U0bVyWv9Ez0QTqi/TD9Yv+p1U
|
||||||
gOt/VQ6geefhd4YDhH0jfd7TDXs7UTtYvKQ+IaKcRUyOrZzhrfTpNeT/lXuaTkHf
|
ksQhSFLs12LiBcH2j/fWs8KdEYJAwDqr7nZJsddz2gEVua223Z94cRiby10SvXfU
|
||||||
LAUiqyprq1RDzxxIPvgMh4DynfehgN8B81iMJox2/fD0oV7B6dIIABvAl87gzANw
|
bH4jpRsdWXj3dH9AET6N+uqiXocfDASE7G2WZalmVOQtsFi1SSVsrcAm/ODts4As
|
||||||
7snQLJwdhNXFylKfrdC9A4AfYz7ycXBzEyYlY5BMZENw9yBGgZ1dZITU2KxeYCo/
|
7H224kR4/rxWaCEZ0i6S6r9n9wIZiUZGrBk80W8bK/JWBbl4zfgJ9tkzk4NMpJXh
|
||||||
gdVTCevybSBQ/Cq0+hI25ZF+nEIGjrVCN2AxPEUO98ljp4OZEu0p6KsMB4xgCD2j
|
TDpaYJxV0T8/kqk/gPaECfN5Il+WgvVL95hS5FI+AxWyeHwWPd5sUgeil0dPoDOj
|
||||||
l5LN6YPAu95TRx/bZinoHMMzth6WhFdUG0Anj2cIIYXOcreyzPxYGj+vwRlZFrkZ
|
DlNuCyVepSqOo325JH7VoU19YRwYZwh0By//0WHOI8WIjQYUxXTAvHJyg61RLNK9
|
||||||
gTU2vfpt/1Wx8ORRqocCkxZ3dMtm4KsGqe3xpd1y84ezL/bMLxSApn5e7Zzn1cEg
|
eqwIO6t2QZRol03MjXE7DCeoWraCG0nS+DDF0qHu8bNnhYHcBpiG8d8Lj9xpME51
|
||||||
DoLwJGnZzSY4nRzfoGXOv6mjyTUVkqNexRlL2wIsgDP9VP/ohS9K2fFZzzJ/fXa1
|
UL1iXSyh461jEcX+8yTImAFMn9Pvt9r+Iv2vT0ZJH8k2Fzxxli+RPL6CQY2qKY7E
|
||||||
G9DUg64SwfYIFzAgsyWwdE3kCJ/GSIAgrgNwBfZlLGdfB/PB2BkHNpzX4LROUEcD
|
ibPM0S7nVc8Kb7214xkniped4muzZF2vQJ8qmbcLu9sr9LV5d5Y13OF1NUdc3DTX
|
||||||
HqqHtVlUIikiFdDQWwB5tS+APBCO6VuzKl1z3ROgV6xhvr4ZYkd9CHYu1S1r1XAs
|
aRAiVErL2QJujoM5xxDC9CTu11e6TfLN9XysM31sCgDIXMb4fKjxYbJxKY99Y1+S
|
||||||
JRCyow0zTLRYGQnDD8+RPQ4MsbzJsugA8Ac4bE4sVJpP8hloZBqHb38AkoUruDTS
|
nQO2CiCUCb+hDLaWdmdSv/FY+1tKX67vrU9YeJ6XVJQhVhR+Rt30bvGkNwy34C/S
|
||||||
XgE+Nxcy0/aznBgEscE/VuY/GTH1vwYl5/dAcV8GDYcNmd1tE9E1QwWsSurHt39u
|
XAHh0aE8KlrY1eCIf5RAygKgLEa1cehKvaGQMOoHWrPfOQUrA6lCvFVSxnwwduIm
|
||||||
+QdGZYoUbHPtsk/zODgEVqn0iTsqO7Y4Qmu93bYlYFQwCygAPKKpCaqmmu2U+rI=
|
pJRbIgcsoLUPFffYcDdDmnvmSOfdCNm84k/CUiCtZxqgUkIX98KrZhAVXzCf
|
||||||
=hq5F
|
=mAAM
|
||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
fp: DC6910268E657FF70BA7EC289974494E76938DDC
|
fp: DC6910268E657FF70BA7EC289974494E76938DDC
|
||||||
encrypted_regex: ^(password|value|ssh-key|api-key|user|username|privateKey|clientSecret|clientId|apiKey|extraArgs.*|.*Secret.*|extraEnvVars|.*SECRET.*|.*secret.*|key|.*Password|.*\.ya?ml)$
|
encrypted_regex: ^(password|value|ssh-key|api-key|user|username|privateKey|clientSecret|clientId|apiKey|extraArgs.*|.*Secret.*|extraEnvVars|.*SECRET.*|.*secret.*|key|.*Password|.*\.ya?ml)$
|
||||||
|
|||||||
Reference in New Issue
Block a user