File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -4,28 +4,34 @@ resource "kubernetes_namespace" "headlamp" {
44    }
55}
66
7+ locals  {
8+     configure_ingress  =  . host  !=  null 
9+ }
10+ 
711resource  "helm_release"  "headlamp"  {
812    namespace   =  . headlamp . metadata [0 ]. name 
913    name        =  " headlamp" 
1014    repository  =  " https://headlamp-k8s.github.io/headlamp" 
1115    chart       =  " headlamp" 
1216    version     =  . headlamp_version 
1317    values      =  
14-         <<- EOT 
18+         ! local . configure_ingress   ?   " "   :   <<- EOT1 
1519        ingress: 
1620          enabled: true 
1721          hosts: 
1822            - host: ${ var . host }  
1923              paths: 
2024                - path: / 
2125                  type: Prefix 
22-         EOT 
23-     , var . ingress_class  ==  null  ?  " " :  <<- EOT 
26+         EOT1 
27+     ,
28+         ! local . configure_ingress  ||  var . ingress_class  ==  null  ?  " " :  <<- EOT2 
2429        ingress: 
2530          annotations: 
2631            kubernetes.io/ingress.class: ${ var . ingress_class }  
27-         EOT 
28-     , var . issuer_name  ==  null  ?  " " :  <<- EOT 
32+         EOT2 
33+     ,
34+         ! local . configure_ingress  ||  var . issuer_name  ==  null  ?  " " :  <<- EOT3 
2935        config: 
3036          oidc: 
3137            issuerURL: "${ var . oidc_issuer_url } " 
@@ -39,6 +45,6 @@ resource "helm_release" "headlamp" {
3945            - secretName: headlamp-tls 
4046              hosts: 
4147                - ${ var . host }  
42-         EOT  
48+         EOT3  
4349    ]
4450}
Original file line number Diff line number Diff line change 44
55output  "url"  {
66    depends_on   =  helm_release . headlamp ]
7-     value        =  " ${ local . protocol } ://${ var . host } /" 
7+     value        =  ! local . configure_ingress   ?   null   :   " ${ local . protocol } ://${ var . host } /" 
88    description  =  " installed application URL" 
99}
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ variable "headlamp_version" {
1212
1313variable  "host"  {
1414    type         =  string 
15-     description  =  " FQDN for the ingress" 
15+     default      =  null 
16+     description  =  " FQDN for the ingress, must be set to enable ingress" 
1617}
1718
1819variable  "ingress_class"  {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments