From 727601cf8f42edbcd96e9246543327c5549bd623 Mon Sep 17 00:00:00 2001 From: Samuel Walker Date: Tue, 24 Oct 2023 09:17:24 -0400 Subject: [PATCH 1/2] Configurable ingress class Allow for the ingress class to be changed based on an env var Signed-off-by: Samuel Walker --- cluster/kube/client_ingress.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cluster/kube/client_ingress.go b/cluster/kube/client_ingress.go index e4adecac..70587ab9 100644 --- a/cluster/kube/client_ingress.go +++ b/cluster/kube/client_ingress.go @@ -22,10 +22,18 @@ import ( ctypes "github.com/akash-network/provider/cluster/types/v1beta3" ) -const ( - akashIngressClassName = "akash-ingress-class" +var ( + akashIngressClassName = getIngressClassName() ) +func getIngressClassName() string { + val := os.Getenv("AKASH_INGRESS_CLASS_NAME") + if val != "" { + return val + } + return "akash-ingress-class" +} + func kubeNginxIngressAnnotations(directive ctypes.ConnectHostnameToDeploymentDirective) map[string]string { // For kubernetes/ingress-nginx // https://github.com/kubernetes/ingress-nginx From b592bc7aa56ccfe83694c3888995572ab346dc73 Mon Sep 17 00:00:00 2001 From: Samuel Walker Date: Tue, 24 Oct 2023 10:16:03 -0400 Subject: [PATCH 2/2] import os --- cluster/kube/client_ingress.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cluster/kube/client_ingress.go b/cluster/kube/client_ingress.go index 70587ab9..94c12d70 100644 --- a/cluster/kube/client_ingress.go +++ b/cluster/kube/client_ingress.go @@ -6,6 +6,7 @@ import ( "math" "strconv" "strings" + "os" netv1 "k8s.io/api/networking/v1" kubeErrors "k8s.io/apimachinery/pkg/api/errors"