Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions build-tools/cncluster
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ function subcmd_create() {
#### Enable Firewall Access
subcmd_cluster_update_access

### Enable Http Load Balancing
subcmd_cluster_enable_http_load_balancing

#### Delete default firewall rules, if they exist.
if (gcloud compute firewall-rules delete\
default-allow-rdp \
Expand Down Expand Up @@ -911,6 +914,19 @@ function subcmd_cluster_enable_workload_identity() {
--cluster "cn-${GCP_CLUSTER_BASENAME}net" \
--workload-metadata=GKE_METADATA
}

subcommand_whitelist[cluster_enable_http_load_balancing]='Enable http load balancing for the cluster.'

function subcmd_cluster_enable_http_load_balancing() {
if ! gcloud container clusters describe "${GCP_CLUSTER_NAME}" --format="value(addonsConfig.httpLoadBalancing)" | grep -q "disabled=True"; then
_info "Http Load Balancing is already enabled for the cluster."
return
fi

_info "Enabling http load balancing for the cluster ${GCP_CLUSTER_NAME}."
gcloud container clusters update "${GCP_CLUSTER_NAME}" --update-addons=HttpLoadBalancing=ENABLED
}

###

subcommand_whitelist[ci_warn_lock_expiry]='Run only by CircleCI'
Expand Down
6 changes: 6 additions & 0 deletions cluster/expected/infra/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,9 @@
}
}
},
"annotations": {
"cloud.google.com/l4-rbs": "enabled"
},
"autoscaling": {
"maxReplicas": 15
},
Expand Down Expand Up @@ -1757,6 +1760,9 @@
}
}
},
"annotations": {
"cloud.google.com/l4-rbs": "enabled"
},
"autoscaling": {
"maxReplicas": 15
},
Expand Down
6 changes: 6 additions & 0 deletions cluster/pulumi/infra/src/istio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,16 @@ function configureGatewayService(
].concat(ingressPorts),
},
...infraAffinityAndTolerations,
// The httpLoadBalancing addon needs to be enabled to use backend service-based network load balancers.
annotations: {
'cloud.google.com/l4-rbs': 'enabled',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there is no downside to enabling this without cloud armor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I am aware.

},
},
maxHistory: HELM_MAX_HISTORY_SIZE,
},
{
replaceOnChanges: ['values.annotations'],
deleteBeforeReplace: true,
dependsOn: istioPolicies
? istioPolicies.apply(policies => {
const base: pulumi.Resource[] = [ingressNs, istiod];
Expand Down