Skip to content

Commit

Permalink
FEAT: Add additional port to handle Minio object storage (#988)
Browse files Browse the repository at this point in the history
* FEAT: Add additional port to handle Minio object storage

* Add missing vars

* Update minio entrypoint and disable tls

* Exclude traitlets config from pre-commit

* Update conda-store minio service eternal endpoint

Co-authored-by: viniciusdc <vinivdc2009@hotmail.com>
  • Loading branch information
HarshCasper and viniciusdc authored Jan 18, 2022
1 parent 1aaf695 commit 7f36b6e
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 2 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ repos:
rev: 3.8.4
hooks:
- id: flake8
exclude: 'qhub/template/\{\{ cookiecutter\.repo_directory \}\}/infrastructure/modules/kubernetes/services/conda-store/config/conda_store_config.py'
- repo: https://github.com/hadolint/hadolint.git
rev: v2.3.0
hooks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ resource "kubernetes_service" "main" {
target_port = 8023
}

port {
name = "minio"
protocol = "TCP"
port = 9080
target_port = 9080
}

port {
name = "tcp"
protocol = "TCP"
Expand Down Expand Up @@ -219,6 +226,8 @@ resource "kubernetes_deployment" "main" {
"--entrypoints.sftp.address=:8023",
"--entryPoints.tcp.address=:8786",
"--entryPoints.traefik.address=:9000",
# Define the entrypoint port for Minio
"--entryPoints.minio.address=:9080",
"--entrypoints.web.http.redirections.entryPoint.to=websecure",
"--entrypoints.web.http.redirections.entryPoint.scheme=https",
# Enable Prometheus Monitoring of Traefik
Expand Down Expand Up @@ -263,6 +272,11 @@ resource "kubernetes_deployment" "main" {
container_port = 9000
}

port {
name = "minio"
container_port = 9080
}

liveness_probe {
http_get {
path = "/ping"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
c.CondaStore.default_permissions = "775"

c.S3Storage.internal_endpoint = "${minio-service}:9000"
c.S3Storage.external_endpoint = "${minio-service}:30900"
c.S3Storage.external_endpoint = "${external-url}:9080"
c.S3Storage.access_key = "${minio-username}"
c.S3Storage.secret_key = "${minio-password}"
c.S3Storage.region = "us-east-1" # minio region default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resource "kubernetes_config_map" "conda-store-config" {
data = {
"conda_store_config.py" = templatefile(
"${path.module}/config/conda_store_config.py", {
external-url = var.external-url
minio-username = module.minio.root_username
minio-password = module.minio.root_password
minio-service = module.minio.service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module "minio" {

name = "qhub-conda-store"
namespace = var.namespace

tls = local.tls
external-url = var.external-url
buckets = [
"conda-store"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
resource "kubernetes_manifest" "minio-api" {
provider = kubernetes-alpha

manifest = {
apiVersion = "traefik.containo.us/v1alpha1"
kind = "IngressRoute"
metadata = {
name = "minio-api"
namespace = var.namespace
}
spec = {
entryPoints = ["minio"]
routes = [
{
kind = "Rule"
match = "Host(`${var.external-url}`)"
services = [
{
name = helm_release.minio.name
port = 9000
namespace = var.namespace
}
]
}
]
# tls = var.tls
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ variable "overrides" {
type = list(string)
default = []
}

variable "tls" {
description = "TLS configuration"
}

variable "external-url" {
description = "External url that jupyterhub cluster is accessible"
type = string
}

0 comments on commit 7f36b6e

Please sign in to comment.