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: Add additional port to handle Minio object storage #988

Merged
merged 5 commits into from
Jan 18, 2022
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 .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
}