Skip to content

Commit

Permalink
nfs-client-provisioner module
Browse files Browse the repository at this point in the history
  • Loading branch information
jdongo-aneo committed Feb 12, 2024
1 parent 5a12a7c commit 15e8a5e
Show file tree
Hide file tree
Showing 9 changed files with 431 additions and 30 deletions.
12 changes: 6 additions & 6 deletions armonik/compute-plane.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ resource "kubernetes_deployment" "compute_plane" {
}
dynamic "volume_mount" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
mount_path = var.nfs_mount_pod
}
content {
name = "nfs"
mount_path = var.nfs_mount_pod
}
}
dynamic "volume_mount" {
for_each = local.certificates
Expand All @@ -149,11 +149,11 @@ resource "kubernetes_deployment" "compute_plane" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
persistent_volume_claim{
persistent_volume_claim {
claim_name = var.pvc_name
}
}
}
}
# Containers of worker
dynamic "container" {
iterator = worker
Expand Down
36 changes: 18 additions & 18 deletions armonik/control-plane.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ resource "kubernetes_deployment" "control_plane" {
}
}

dynamic "volume_mount" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
mount_path = var.nfs_mount_pod
dynamic "volume_mount" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
mount_path = var.nfs_mount_pod
}
}
}
}
dynamic "volume" {
}
dynamic "volume" {
for_each = local.certificates
content {
name = volume.value.name
Expand All @@ -135,18 +135,18 @@ resource "kubernetes_deployment" "control_plane" {
}
}

dynamic "volume" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
dynamic "volume" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
persistent_volume_claim{
claim_name = var.pvc_name
}
}
}

name = "nfs"
persistent_volume_claim {
claim_name = var.pvc_name
}
}
}




# Fluent-bit container
dynamic "container" {
for_each = (!data.kubernetes_secret.fluent_bit.data.is_daemonset ? [1] : [])
Expand Down
12 changes: 6 additions & 6 deletions armonik/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@ variable "environment_description" {
# nfs_parameters

variable "nfs_mount_pod" {
description = "Path to which the NFS will be mounted in the pods"
type = string
default ="/local_storage"
description = "Path to which the NFS will be mounted in the pods"
type = string
default = "/local_storage"
}

variable "pvc_name" {
description = "Name for the pvc to be created and used"
type = string
default ="nfsvolume"
description = "Name for the pvc to be created and used"
type = string
default = "nfsvolume"
}
45 changes: 45 additions & 0 deletions storage/onpremise/nfs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.7.1 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.7.1 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [kubernetes_cluster_role.nfs-client-provisioner-runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/cluster_role) | resource |
| [kubernetes_cluster_role_binding.run-nfs-client-provisioner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/cluster_role_binding) | resource |
| [kubernetes_deployment.nfs-provisioner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/deployment) | resource |
| [kubernetes_persistent_volume_claim.nfs_claim](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/persistent_volume_claim) | resource |
| [kubernetes_role.leader-locking-nfs-client-provisioner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/role) | resource |
| [kubernetes_role_binding.leader-locking-nfs-client-provisioner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/role_binding) | resource |
| [kubernetes_service_account.nfs-client-provisioner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource |
| [kubernetes_storage_class.nfs_client](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/storage_class) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace of ArmoniK storage resources | `string` | n/a | yes |
| <a name="input_nfs_client"></a> [nfs\_client](#input\_nfs\_client) | Parameters of nfs\_client | <pre>object({<br> image = string<br> tag = string<br> node_selector = any<br> image_pull_secrets = string<br> max_memory = string<br> })</pre> | <pre>{<br> "image": "k8s.gcr.io/sig-storage/nfs-subdir-external-provisioner",<br> "image_pull_secrets": "",<br> "max_memory": "",<br> "node_selector": {},<br> "tag": "v4.0.2"<br>}</pre> | no |
| <a name="input_nfs_path"></a> [nfs\_path](#input\_nfs\_path) | path on server | `string` | n/a | yes |
| <a name="input_nfs_server"></a> [nfs\_server](#input\_nfs\_server) | ip nfs server | `string` | n/a | yes |
| <a name="input_pvc_name"></a> [pvc\_name](#input\_pvc\_name) | Name for the pvc to be created and used | `string` | `"nfsvolume"` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_provisioner_name"></a> [provisioner\_name](#output\_provisioner\_name) | n/a |
7 changes: 7 additions & 0 deletions storage/onpremise/nfs/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
locals {
# NFS node selector
node_selector_keys = keys(var.nfs_client.node_selector)
node_selector_values = values(var.nfs_client.node_selector)
}


Loading

0 comments on commit 15e8a5e

Please sign in to comment.