Skip to content

Commit

Permalink
Setting minio storage to by default be same as filesystem size for Co…
Browse files Browse the repository at this point in the history
…nda-Store environments (#1188)

* Setting minio storage to by default be same as filesystem size

* Typo in storage variable for conda-store
  • Loading branch information
costrouc authored Mar 24, 2022
1 parent 131d3fb commit 28856c4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion qhub/stages/input_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def stage_07_kubernetes_services(stage_outputs, config):
"node_groups": _calculate_note_groups(config),
# conda-store
"conda-store-environments": config["environments"],
"conda-store-storage": config["storage"]["conda_store"],
"conda-store-filesystem-storage": config["storage"]["conda_store"],
# jupyterhub
"cdsdashboards": config["cdsdashboards"],
"jupyterhub-theme": config["theme"]["jupyterhub"],
Expand Down
15 changes: 11 additions & 4 deletions qhub/template/stages/07-kubernetes-services/conda-store.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ variable "conda-store-environments" {
default = {}
}

variable "conda-store-storage" {
description = "Conda-Store storage in GB"
variable "conda-store-filesystem-storage" {
description = "Conda-Store storage in GB for filesystem environments that are built"
type = string
}

variable "conda-store-object-storage" {
description = "Conda-Store storage in GB for object storage. Conda-Store uses minio for object storage to be cloud agnostic. If empty default is var.conda-store-filesystem-storage value"
type = string
default = null
}

variable "conda-store-image" {
description = "Conda-store image"
type = object({
Expand All @@ -31,7 +37,8 @@ module "kubernetes-conda-store-server" {
external-url = var.endpoint
realm_id = var.realm_id

nfs_capacity = var.conda-store-storage
nfs_capacity = var.conda-store-filesystem-storage
minio_capacity = coalesce(var.conda-store-object-storage, var.conda-store-filesystem-storage)
node-group = var.node_groups.general
conda-store-image = var.conda-store-image
environments = {
Expand All @@ -45,7 +52,7 @@ module "conda-store-nfs-mount" {

name = "conda-store"
namespace = var.environment
nfs_capacity = var.conda-store-storage
nfs_capacity = var.conda-store-filesystem-storage
nfs_endpoint = module.kubernetes-conda-store-server.endpoint_ip

depends_on = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module "minio" {

node-group = var.node-group

storage = var.minio_capacity

buckets = [
"conda-store"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ variable "namespace" {
}

variable "nfs_capacity" {
description = "Capacity of conda-store deployment"
description = "Capacity of conda-store filesystem"
type = string
default = "10Gi"
}

variable "minio_capacity" {
description = "Capacity of conda-store object storage"
type = string
default = "10Gi"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ resource "helm_release" "minio" {
value = join(" ", var.buckets)
}

set {
name ="persistence.size"
value = var.storage
}

values = concat([
file("${path.module}/values.yaml"),
jsonencode({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ variable "namespace" {
}


variable "storage" {
description = "Storage size for minio objects"
type = string
default = "10Gi"
}

variable "buckets" {
description = "Default available buckets"
type = list(string)
Expand Down

0 comments on commit 28856c4

Please sign in to comment.