From c2b558296f743ea65ddc6cceb871e2f5257f21a1 Mon Sep 17 00:00:00 2001 From: Alex Iankoulski Date: Tue, 19 Feb 2019 15:39:11 -0800 Subject: [PATCH] Add optional parameter ambassadorNodePort. Used to set the ambassador service nodePort only when ambassadorServiceType is NodePort and ambassadorNodePort is within the valid range [30000-32767]. By default this parameter is set to 0. If ambassadorServiceType is NodePort and ambassadorNodePort is outside the valid range, then Kubernetes will automatically assign an available nodePort. (#2511) --- kubeflow/common/ambassador.libsonnet | 4 ++++ kubeflow/common/prototypes/ambassador.jsonnet | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kubeflow/common/ambassador.libsonnet b/kubeflow/common/ambassador.libsonnet index 0d8cc1abe9b..f110647de32 100644 --- a/kubeflow/common/ambassador.libsonnet +++ b/kubeflow/common/ambassador.libsonnet @@ -20,6 +20,10 @@ name: "ambassador", port: 80, targetPort: 80, + [if (params.ambassadorServiceType == 'NodePort') && + (params.ambassadorNodePort >= 30000) && + (params.ambassadorNodePort <= 32767) + then 'nodePort']: params.ambassadorNodePort, }, ], selector: { diff --git a/kubeflow/common/prototypes/ambassador.jsonnet b/kubeflow/common/prototypes/ambassador.jsonnet index 0440bf81521..10b3ccc5182 100644 --- a/kubeflow/common/prototypes/ambassador.jsonnet +++ b/kubeflow/common/prototypes/ambassador.jsonnet @@ -4,7 +4,8 @@ // @shortDescription Ambassador // @param name string Name // @optionalParam platform string none supported platforms {none|gke|minikube} -// @optionalParam ambassadorServiceType string ClusterIP The service type for the API Gateway. +// @optionalParam ambassadorServiceType string ClusterIP The service type for the API Gateway {ClusterIP|NodePort|LoadBalancer}. +// @optionalParam ambassadorNodePort number 0 Optional nodePort to use when ambassadorServiceType is NodePort {30000-32767}. // @optionalParam ambassadorImage string quay.io/datawire/ambassador:0.37.0 The image for the API Gateway. // @optionalParam replicas number 3 The number of replicas.