Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit b3b65d8

Browse files
authored
Added CSI Driver (#91)
1 parent 8435fa1 commit b3b65d8

File tree

5 files changed

+59
-20
lines changed

5 files changed

+59
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright © Microsoft Corporation
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+
locals {
16+
helm_kv_csi_name = "kvsecrets"
17+
helm_kv_csi_ns = "kvsecrets"
18+
helm_kv_csi_repo = "https://raw.githubusercontent.com/Azure/secrets-store-csi-driver-provider-azure/master/charts"
19+
helm_kv_csi_version = "0.0.9"
20+
}
21+
22+
resource "kubernetes_namespace" "kvsecrets" {
23+
metadata {
24+
name = local.helm_kv_csi_ns
25+
}
26+
27+
depends_on = [module.aks-gitops]
28+
}
29+
30+
resource "helm_release" "kvsecrets" {
31+
name = local.helm_kv_csi_name
32+
repository = local.helm_kv_csi_repo
33+
chart = "csi-secrets-store-provider-azure"
34+
version = local.helm_kv_csi_version
35+
namespace = local.helm_kv_csi_ns
36+
37+
set {
38+
name = "secrets-store-csi-driver.linux.metricsAddr"
39+
value = ":8081"
40+
}
41+
42+
depends_on = [kubernetes_namespace.kvsecrets]
43+
}

infra/templates/osdu-r3-resources/environments/service_resources/main.tf

+4-5
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ module "network" {
291291
name = local.vnet_name
292292
resource_group_name = azurerm_resource_group.main.name
293293
address_space = var.address_space
294-
dns_servers = ["8.8.8.8"]
295294
subnet_prefixes = [var.subnet_fe_prefix, var.subnet_aks_prefix, var.subnet_be_prefix]
296295
subnet_names = [local.fe_subnet_name, local.aks_subnet_name, local.be_subnet_name]
297296
}
@@ -370,10 +369,10 @@ module "aks-gitops" {
370369

371370
gitops_ssh_url = var.gitops_ssh_url
372371
gitops_ssh_key = var.gitops_ssh_key_file
373-
gitops_url_branch = var.gitops_config.branch
374-
gitops_path = var.gitops_config.path
375-
gitops_poll_interval = var.gitops_config.interval
376-
gitops_label = var.gitops_config.label
372+
gitops_url_branch = var.gitops_branch
373+
gitops_path = var.gitops_path
374+
gitops_poll_interval = "10s"
375+
gitops_label = "flux-sync"
377376
}
378377

379378
data "azurerm_resource_group" "aks_node_resource_group" {

infra/templates/osdu-r3-resources/environments/service_resources/terraform.tfvars

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ prefix = "osdu-r3"
1717
# Storage Settings
1818
storage_containers = [
1919
"airflow"
20-
]
20+
]

infra/templates/osdu-r3-resources/environments/service_resources/tests/unit/unit_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestTemplate(t *testing.T) {
4949
TfOptions: tfOptions,
5050
Workspace: workspace,
5151
PlanAssertions: nil,
52-
ExpectedResourceCount: 57,
52+
ExpectedResourceCount: 59,
5353
ExpectedResourceAttributeValues: resourceDescription,
5454
}
5555

infra/templates/osdu-r3-resources/environments/service_resources/var.tf

+10-13
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,14 @@ variable "gitops_ssh_key_file" {
128128
description = "(Required) SSH key used to establish a connection to a private git repo containing the HLD manifest."
129129
}
130130

131-
variable "gitops_config" {
132-
type = object({
133-
branch = string
134-
path = string
135-
label = string
136-
interval = string
137-
})
138-
default = {
139-
branch = "master"
140-
path = "providers/azure/hld-registry"
141-
label = "flux-sync"
142-
interval = "10s"
143-
}
131+
variable "gitops_branch" {
132+
type = string
133+
description = "(Optional) The branch for flux to watch"
134+
default = "master"
135+
}
136+
137+
variable "gitops_path" {
138+
type = string
139+
description = "(Optional) The path for flux to watch"
140+
default = "providers/azure/hld-registry"
144141
}

0 commit comments

Comments
 (0)