Skip to content

Commit d31a8b6

Browse files
committed
feat(kubernetes): install vault to the cluster
1 parent ff0b789 commit d31a8b6

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

modules/kubernetes/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ No modules.
3030
| [helm_release.external_dns](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
3131
| [helm_release.hcloud_ccm](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
3232
| [helm_release.ingress_nginx](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
33+
| [helm_release.vault_operator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
34+
| [helm_release.vault_webhook](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
3335
| [kubernetes_annotations.hcloud_ccm](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/annotations) | resource |
3436
| [kubernetes_manifest.csi_driver](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest) | resource |
3537
| [kubernetes_namespace_v1.external_dns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace_v1) | resource |
@@ -42,6 +44,8 @@ No modules.
4244

4345
| Name | Description | Type | Default | Required |
4446
|------|-------------|------|---------|:--------:|
47+
| <a name="input_bank_vaults_operator_version"></a> [bank\_vaults\_operator\_version](#input\_bank\_vaults\_operator\_version) | Version of Bank Vaults operator to install - defaults to latest | `string` | `null` | no |
48+
| <a name="input_bank_vaults_webhook_version"></a> [bank\_vaults\_webhook\_version](#input\_bank\_vaults\_webhook\_version) | Version of Bank Vaults webhook to install - defaults to latest | `string` | `null` | no |
4549
| <a name="input_cilium_version"></a> [cilium\_version](#input\_cilium\_version) | Version of Cilium to use - defaults to latest | `string` | `null` | no |
4650
| <a name="input_cloudflare_api_token"></a> [cloudflare\_api\_token](#input\_cloudflare\_api\_token) | Cloudflare API token | `string` | n/a | yes |
4751
| <a name="input_external_dns_version"></a> [external\_dns\_version](#input\_external\_dns\_version) | Version of External DNS to install - defaults to latest | `string` | `null` | no |

modules/kubernetes/variables.tf

+12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
variable "bank_vaults_webhook_version" {
16+
type = string
17+
description = "Version of Bank Vaults webhook to install - defaults to latest"
18+
default = null
19+
}
20+
21+
variable "bank_vaults_operator_version" {
22+
type = string
23+
description = "Version of Bank Vaults operator to install - defaults to latest"
24+
default = null
25+
}
26+
1527
variable "cilium_version" {
1628
type = string
1729
description = "Version of Cilium to use - defaults to latest"

modules/kubernetes/vault.tf

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2024 Simon Emms <[email protected]>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
resource "helm_release" "vault_operator" {
16+
chart = "oci://ghcr.io/bank-vaults/helm-charts/vault-operator"
17+
name = "vault-operator"
18+
atomic = true
19+
cleanup_on_fail = true
20+
create_namespace = true
21+
namespace = "vault"
22+
reset_values = true
23+
version = var.bank_vaults_operator_version
24+
wait = true
25+
26+
depends_on = [kubernetes_manifest.csi_driver]
27+
}
28+
29+
resource "helm_release" "vault_webhook" {
30+
chart = "oci://ghcr.io/bank-vaults/helm-charts/vault-secrets-webhook"
31+
name = "vault-secrets-webhook"
32+
atomic = true
33+
cleanup_on_fail = true
34+
create_namespace = true
35+
namespace = "vault"
36+
reset_values = true
37+
version = var.bank_vaults_webhook_version
38+
wait = true
39+
40+
depends_on = [helm_release.vault_operator]
41+
}

toodaloo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
55
| File | Line Number | Author | Message |
66
| --- | --- | --- | --- |
7-
| [modules/kubernetes/variables.tf](modules/kubernetes/variables.tf#L92) | 92 | Simon Emms <[email protected]> | create the load balancer in the hetzner stage |
7+
| [modules/kubernetes/variables.tf](modules/kubernetes/variables.tf#L104) | 104 | Simon Emms <[email protected]> | create the load balancer in the hetzner stage |

0 commit comments

Comments
 (0)