Skip to content

Commit

Permalink
fix(alb): force arn to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
moabu committed Feb 15, 2022
1 parent dab67fa commit 95b6e26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
20 changes: 8 additions & 12 deletions pygluu/kubernetes/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,10 @@ def __init__(self):
cluster_role_name="cluster-admin")

def redeploy_gluu_to_load_alb(self):
while True:
try:
if lb_hostname:
break
lb_hostname = self.kubernetes.read_namespaced_ingress(
name="gluu", namespace="gluu").status.load_balancer.ingress[0].hostname
except TypeError:
logger.info("Waiting for loadbalancer address..")
time.sleep(10)
prompt = input("Please input the DNS of the Application load balancer found on AWS UI Loadbalancer page: ")
lb_hostname = prompt
self.settings.set("LB_ADD", lb_hostname)
self.analyze_global_values()
exec_cmd("helm upgrade {} -f {} ./helm/gluu --timeout 10m0s --namespace={}".format(
self.settings.get('GLUU_HELM_RELEASE_NAME'), self.values_file, self.settings.get("GLUU_NAMESPACE")))

Expand Down Expand Up @@ -175,9 +169,6 @@ def analyze_global_values(self):
self.settings.get("ARN_AWS_IAM")
if not self.settings.get("ARN_AWS_IAM"):
del values_file_parser["global"]["alb"]["ingress"]["additionalAnnotations"]["alb.ingress.kubernetes.io/certificate-arn"]

if self.settings.get("IS_GLUU_FQDN_REGISTERED") != "Y":
self.redeploy_gluu_to_load_alb()
values_file_parser["global"]["storageClass"]["provisioner"] = provisioner
values_file_parser["global"]["lbIp"] = self.settings.get("HOST_EXT_IP")
values_file_parser["global"]["domain"] = self.settings.get("GLUU_FQDN")
Expand Down Expand Up @@ -443,6 +434,8 @@ def install_gluu(self, install_ingress=True):
self.settings = SettingsHandler()
if self.settings.get("AWS_LB_TYPE") != "alb" and self.settings.get("USE_ISTIO_INGRESS") != "Y":
self.check_install_nginx_ingress(install_ingress)
if self.settings.get("IS_GLUU_FQDN_REGISTERED") != "Y":
self.settings.set("LB_ADD", "im.going.tochange")
self.analyze_global_values()
try:
exec_cmd("helm install {} -f {} ./helm/gluu --timeout 10m0s --namespace={}".format(
Expand All @@ -452,6 +445,9 @@ def install_gluu(self, install_ingress=True):
logger.error("Helm v3 is not installed. Please install it to continue "
"https://helm.sh/docs/intro/install/")
raise SystemExit(1)
if self.settings.get("IS_GLUU_FQDN_REGISTERED") != "Y":
time.sleep(10)
self.redeploy_gluu_to_load_alb()

def uninstall_gluu(self):
exec_cmd("helm delete {} --namespace={}".format(self.settings.get('GLUU_HELM_RELEASE_NAME'),
Expand Down
1 change: 1 addition & 0 deletions pygluu/kubernetes/terminal/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def prompt_aws_lb(self):
self.settings.set("AWS_LB_TYPE", lb_map.get(choice, "clb"))
if self.settings.get("AWS_LB_TYPE") == "alb":
logger.info("A prompt later during installation will appear to input the ALB DNS address")
self.settings.set("USE_ARN", "Y")

if not self.settings.get("USE_ARN"):
self.settings.set("USE_ARN", confirm_yesno(
Expand Down

0 comments on commit 95b6e26

Please sign in to comment.