Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding support for nfs as object storage #120

Merged
merged 7 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions armonik/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace of ArmoniK resources | `string` | n/a | yes |
| <a name="input_partition_metrics_exporter_secret_name"></a> [partition\_metrics\_exporter\_secret\_name](#input\_partition\_metrics\_exporter\_secret\_name) | the name of the partition metrics exporter secret | `string` | `"partition-metrics-exporter"` | no |
| <a name="input_prometheus_secret_name"></a> [prometheus\_secret\_name](#input\_prometheus\_secret\_name) | the name of the prometheus secret | `string` | `"prometheus"` | no |
| <a name="input_pvc_name"></a> [pvc\_name](#input\_pvc\_name) | Name for the pvc to be used | `string` | `"nfsvolume"` | no |
| <a name="input_s3_secret_name"></a> [s3\_secret\_name](#input\_s3\_secret\_name) | the name of the S3 secret | `string` | `"s3"` | no |
| <a name="input_seq_secret_name"></a> [seq\_secret\_name](#input\_seq\_secret\_name) | the name of the seq secret | `string` | `"seq"` | no |
| <a name="input_shared_storage_secret_name"></a> [shared\_storage\_secret\_name](#input\_shared\_storage\_secret\_name) | the name of the shared-storage secret | `string` | `"shared-storage"` | no |
Expand Down
16 changes: 16 additions & 0 deletions armonik/compute-plane.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ resource "kubernetes_deployment" "compute_plane" {
name = "cache-volume"
mount_path = "/cache"
}
dynamic "volume_mount" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
mount_path = local.local_storage_mount_path
}
}
dynamic "volume_mount" {
for_each = local.certificates
content {
Expand All @@ -138,6 +145,15 @@ resource "kubernetes_deployment" "compute_plane" {
}
}
}
dynamic "volume" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
persistent_volume_claim {
claim_name = var.pvc_name
}
}
}
# Containers of worker
dynamic "container" {
iterator = worker
Expand Down
21 changes: 21 additions & 0 deletions armonik/control-plane.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ resource "kubernetes_deployment" "control_plane" {
read_only = true
}
}

dynamic "volume_mount" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
name = "nfs"
mount_path = local.local_storage_mount_path
}
}
}
dynamic "volume" {
for_each = local.certificates
Expand All @@ -126,6 +134,19 @@ resource "kubernetes_deployment" "control_plane" {
}
}
}

dynamic "volume" {
for_each = local.object_storage_adapter == "ArmoniK.Adapters.LocalStorage.ObjectStorage" ? [1] : []
content {
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
1 change: 1 addition & 0 deletions armonik/core-configmap.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ resource "kubernetes_config_map" "core_config" {
Amqp__Scheme = "AMQPS"
Authenticator__RequireAuthentication = local.authentication_require_authentication
Authenticator__RequireAuthorization = local.authentication_require_authorization
LocalStorage__Path = local.local_storage_mount_path
}, var.extra_conf.core)
}
3 changes: 3 additions & 0 deletions armonik/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ locals {
}
}

#nfs
local_storage_mount_path = "/local_storage"

# Configmaps for polling agent
polling_agent_configmaps = {
log = kubernetes_config_map.log_config.metadata[0].name
Expand Down
7 changes: 7 additions & 0 deletions armonik/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,10 @@ variable "environment_description" {
type = any
default = null
}

# nfs_parameters
variable "pvc_name" {
description = "Name for the pvc to be used"
type = string
default = "nfsvolume"
}
103 changes: 103 additions & 0 deletions storage/onpremise/nfs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
## 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_image"></a> [image](#input\_image) | image for the external client provisioner | `string` | `"k8s.gcr.io/sig-storage/nfs-subdir-external-provisioner"` | no |
| <a name="input_image_policy"></a> [image\_policy](#input\_image\_policy) | policy for getting the image | `string` | `"IfNotPresent"` | no |
| <a name="input_image_pull_secrets"></a> [image\_pull\_secrets](#input\_image\_pull\_secrets) | pull secrets if needed | `string` | `""` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace of ArmoniK storage resources | `string` | n/a | yes |
| <a name="input_node_selector"></a> [node\_selector](#input\_node\_selector) | selectors | `any` | `{}` | no |
| <a name="input_path"></a> [path](#input\_path) | path on 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 |
| <a name="input_server"></a> [server](#input\_server) | ip nfs server | `string` | n/a | yes |
| <a name="input_tag"></a> [tag](#input\_tag) | tag for the image | `string` | `"v4.0.2"` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_provisioner_name"></a> [provisioner\_name](#output\_provisioner\_name) | name of the created provisionner |
| <a name="output_pvc_name"></a> [pvc\_name](#output\_pvc\_name) | name of the created persistant volume claim |
<!-- BEGIN_TF_DOCS -->
## 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_image"></a> [image](#input\_image) | image for the external client provisioner | `string` | `"k8s.gcr.io/sig-storage/nfs-subdir-external-provisioner"` | no |
| <a name="input_image_policy"></a> [image\_policy](#input\_image\_policy) | policy for getting the image | `string` | `"IfNotPresent"` | no |
| <a name="input_image_pull_secrets"></a> [image\_pull\_secrets](#input\_image\_pull\_secrets) | pull secrets if needed | `string` | `""` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace of ArmoniK storage resources | `string` | n/a | yes |
| <a name="input_node_selector"></a> [node\_selector](#input\_node\_selector) | selectors | `any` | `{}` | no |
| <a name="input_path"></a> [path](#input\_path) | path on 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 |
| <a name="input_server"></a> [server](#input\_server) | ip nfs server | `string` | n/a | yes |
| <a name="input_size"></a> [size](#input\_size) | storage request size | `string` | `"5Gi"` | no |
| <a name="input_tag"></a> [tag](#input\_tag) | tag for the image | `string` | `"v4.0.2"` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_provisioner_name"></a> [provisioner\_name](#output\_provisioner\_name) | name of the created provisionner |
| <a name="output_pvc_name"></a> [pvc\_name](#output\_pvc\_name) | name of the created persistant volume claim |
<!-- END_TF_DOCS -->
Loading
Loading