Skip to content

Commit

Permalink
cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
sergelogvinov committed Nov 2, 2024
1 parent 17dac27 commit d9d2a04
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 16 deletions.
1 change: 1 addition & 0 deletions proxmox/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ terraform.tfvars.sops.json
#
age.key.txt
.env.yaml
secrets.proxmox.yaml
6 changes: 3 additions & 3 deletions proxmox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ system:
proxmox-cloud-controller-manager oci://ghcr.io/sergelogvinov/charts/proxmox-cloud-controller-manager

#
# File vars/secrets.proxmox.yaml should be created manually
# File vars/secrets.proxmox.yaml was created by terraform
#
kubectl --kubeconfig=kubeconfig apply -f vars/proxmox-ns.yaml
# helm --kubeconfig=kubeconfig secrets upgrade -i --namespace=csi-proxmox -f vars/proxmox-csi.yaml -f vars/secrets.proxmox.yaml \
# proxmox-csi-plugin oci://ghcr.io/sergelogvinov/charts/proxmox-csi-plugin
helm --kubeconfig=kubeconfig secrets upgrade -i --namespace=csi-proxmox -f vars/proxmox-csi.yaml -f vars/secrets.proxmox.yaml \
proxmox-csi-plugin oci://ghcr.io/sergelogvinov/charts/proxmox-csi-plugin
20 changes: 18 additions & 2 deletions proxmox/instances-controlplane.tf
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ resource "local_sensitive_file" "controlplane" {
"clusters" : [{
"url" : "https://${each.value.hvv4}:8006/api2/json",
"insecure" : true,
"token_id" : split("=", local.proxmox_token)[0],
"token_secret" : split("=", local.proxmox_token)[1],
"token_id" : split("=", local.proxmox_token_ccm)[0],
"token_secret" : split("=", local.proxmox_token_ccm)[1],
"region" : var.region,
}]
})
Expand All @@ -215,6 +215,22 @@ resource "local_sensitive_file" "controlplane" {
file_permission = "0600"
}
resource "local_sensitive_file" "csi" {
content = yamlencode({
"config" : {
"clusters" : [{
"url" : "https://${var.proxmox_host}:8006/api2/json",
"insecure" : true,
"token_id" : split("=", local.proxmox_token_csi)[0],
"token_secret" : split("=", local.proxmox_token_csi)[1],
"region" : var.region,
}]
}
})
filename = "vars/secrets.proxmox.yaml"
file_permission = "0600"
}
locals {
controlplane_config = { for k, v in local.controlplanes : k => "talosctl apply-config --insecure --nodes ${v.ipv6} --config-patch @_cfgs/${v.name}.yaml --file _cfgs/controlplane.yaml" }
}
Expand Down
2 changes: 1 addition & 1 deletion proxmox/instances-db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ resource "proxmox_virtual_environment_vm" "db" {
up_delay = 5
}

machine = "pc"
machine = "q35"
cpu {
architecture = "x86_64"
cores = each.value.cpu
Expand Down
2 changes: 1 addition & 1 deletion proxmox/instances-web.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ resource "proxmox_virtual_environment_vm" "web" {
up_delay = 5
}

machine = "pc"
machine = "q35"
cpu {
architecture = "x86_64"
cores = each.value.cpu
Expand Down
2 changes: 1 addition & 1 deletion proxmox/instances-worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ resource "proxmox_virtual_environment_vm" "worker" {
up_delay = 15
}

machine = "pc"
machine = "q35"
cpu {
architecture = "x86_64"
cores = each.value.cpu
Expand Down
3 changes: 2 additions & 1 deletion proxmox/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ data "terraform_remote_state" "init" {
locals {
kubernetes = jsondecode(data.sops_file.tfvars.raw)["kubernetes"]

proxmox_token = data.terraform_remote_state.init.outputs.ccm
proxmox_token_ccm = data.terraform_remote_state.init.outputs.ccm
proxmox_token_csi = data.terraform_remote_state.init.outputs.csi
}

variable "nodes" {
Expand Down
7 changes: 0 additions & 7 deletions proxmox/vars/secrets.proxmox.yaml

This file was deleted.

0 comments on commit d9d2a04

Please sign in to comment.