File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -696,6 +696,9 @@ function subcmd_create() {
696696 # ### Enable Firewall Access
697697 subcmd_cluster_update_access
698698
699+ # ## Enable Http Load Balancing
700+ subcmd_cluster_enable_http_load_balancing
701+
699702 # ### Delete default firewall rules, if they exist.
700703 if (gcloud compute firewall-rules delete\
701704 default-allow-rdp \
@@ -911,6 +914,19 @@ function subcmd_cluster_enable_workload_identity() {
911914 --cluster " cn-${GCP_CLUSTER_BASENAME} net" \
912915 --workload-metadata=GKE_METADATA
913916}
917+
918+ subcommand_whitelist[cluster_enable_http_load_balancing]=' Enable http load balancing for the cluster.'
919+
920+ function subcmd_cluster_enable_http_load_balancing() {
921+ if ! gcloud container clusters describe " ${GCP_CLUSTER_NAME} " --format=" value(addonsConfig.httpLoadBalancing)" | grep -q " disabled=True" ; then
922+ _info " Http Load Balancing is already enabled for the cluster."
923+ return
924+ fi
925+
926+ _info " Enabling http load balancing for the cluster ${GCP_CLUSTER_NAME} ."
927+ gcloud container clusters update " ${GCP_CLUSTER_NAME} " --update-addons=HttpLoadBalancing=ENABLED
928+ }
929+
914930# ##
915931
916932subcommand_whitelist[ci_warn_lock_expiry]=' Run only by CircleCI'
Original file line number Diff line number Diff line change 16831683 }
16841684 }
16851685 },
1686+ "annotations": {
1687+ "cloud.google.com/l4-rbs": "enabled"
1688+ },
16861689 "autoscaling": {
16871690 "maxReplicas": 15
16881691 },
18611864 }
18621865 }
18631866 },
1867+ "annotations": {
1868+ "cloud.google.com/l4-rbs": "enabled"
1869+ },
18641870 "autoscaling": {
18651871 "maxReplicas": 15
18661872 },
Original file line number Diff line number Diff line change @@ -359,10 +359,16 @@ function configureGatewayService(
359359 ] . concat ( ingressPorts ) ,
360360 } ,
361361 ...infraAffinityAndTolerations ,
362+ // The httpLoadBalancing addon needs to be enabled to use backend service-based network load balancers.
363+ annotations : {
364+ 'cloud.google.com/l4-rbs' : 'enabled' ,
365+ } ,
362366 } ,
363367 maxHistory : HELM_MAX_HISTORY_SIZE ,
364368 } ,
365369 {
370+ replaceOnChanges : [ 'values.annotations' ] ,
371+ deleteBeforeReplace : true ,
366372 dependsOn : istioPolicies
367373 ? istioPolicies . apply ( policies => {
368374 const base : pulumi . Resource [ ] = [ ingressNs , istiod ] ;
You can’t perform that action at this time.
0 commit comments