many things
Some checks failed
/ non-lab (push) Failing after 5m42s

This commit is contained in:
Chris Cowley 2024-09-13 10:12:28 +02:00
parent a10e42d448
commit ae76ef9c0b
20 changed files with 365 additions and 100 deletions

46
20-post-k8s/backup.tf Normal file
View file

@ -0,0 +1,46 @@
resource "b2_bucket" "cowley-tech-home-backup" {
bucket_name = "cowley-tech-home-backup"
bucket_type = "allPrivate"
}
resource "b2_application_key" "user" {
for_each = toset(["timothy", "nicolas", "nadege"])
key_name = "cowley-tech-${each.key}-backup"
bucket_id = b2_bucket.cowley-tech-home-backup.id
capabilities = [
"deleteFiles",
"listBuckets",
"listFiles",
"readBuckets",
"readFiles",
"writeFiles",
]
}
resource "b2_application_key" "admin" {
key_name = "cowley-tech-admin-backup"
bucket_id = b2_bucket.cowley-tech-home-backup.id
capabilities = [
"deleteFiles",
"listBuckets",
"listFiles",
"readBuckets",
"readFiles",
"writeFiles",
]
}
#
resource "kubernetes_secret" "b2-backup" {
for_each = toset(["timothy", "nicolas", "nadege"])
metadata {
name = "b2-backup-credentials-${each.key}"
namespace = "default"
}
data = {
B2_APPLICATION_KEY_ID = b2_application_key.user[each.key].application_key_id
B2_APPLICATION_KEY = b2_application_key.user[each.key].application_key
}
}