From 7bd471c5001d4755f23341e837d444b0bfef2861 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Wed, 14 Aug 2024 20:04:43 +0530 Subject: [PATCH 1/2] mount certs to each workers --- functions/onprem/orborus/orborus.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 411571bb..e4166008 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -104,6 +104,8 @@ var memcached = os.Getenv("SHUFFLE_MEMCACHED") var tenzirUrl = os.Getenv("SHUFFLE_TENZIR_URL") var apiKey = os.Getenv("AUTH_FOR_ORBORUS") +var certPath = os.Getenv("SHUFFLE_CERT_DIR") + var executionIds = []string{} var namespacemade = false // For K8s @@ -1150,6 +1152,18 @@ func deployWorker(image string, identifier string, env []string, executionReques }, Resources: container.Resources{}, } + + _, err := os.ReadDir(certPath) + + if certPath != "" && err == nil { + certVol := mount.Mount{ + Type: mount.TypeBind, + Source: certPath, + Target: "/certs", + } + + hostConfig.Mounts = append(hostConfig.Mounts, certVol) + } if len(os.Getenv("DOCKER_HOST")) == 0 { if runtime.GOOS == "windows" { From e67c23a5c0e3b1db14a646d5403debc540e7d731 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Tue, 20 Aug 2024 17:54:13 +0530 Subject: [PATCH 2/2] fix logic for cert mounting --- functions/onprem/orborus/orborus.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index e4166008..271b3bb1 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -104,8 +104,6 @@ var memcached = os.Getenv("SHUFFLE_MEMCACHED") var tenzirUrl = os.Getenv("SHUFFLE_TENZIR_URL") var apiKey = os.Getenv("AUTH_FOR_ORBORUS") -var certPath = os.Getenv("SHUFFLE_CERT_DIR") - var executionIds = []string{} var namespacemade = false // For K8s @@ -1152,7 +1150,17 @@ func deployWorker(image string, identifier string, env []string, executionReques }, Resources: container.Resources{}, } - + + certPath := "/certs" + + // This is just to test the mounting locally so + // I can control from what source I'm mounting + // the certs to. Default behaviour is: + // /certs:/certs. + if os.Getenv("SHUFFLE_CERT_PATH") != "" { + certPath = os.Getenv("SHUFFLE_CERT_PATH") + } + _, err := os.ReadDir(certPath) if certPath != "" && err == nil {