Skip to content

Instantly share code, notes, and snippets.

@warroyo
Last active September 8, 2021 20:58
Show Gist options
  • Select an option

  • Save warroyo/0b866d58e6cfd756baa86fb91d6aa15c to your computer and use it in GitHub Desktop.

Select an option

Save warroyo/0b866d58e6cfd756baa86fb91d6aa15c to your computer and use it in GitHub Desktop.
custom lb setup
#! add these values to your cluster config
#!custom subnets to use for LB placement
LB_SUBNETS: "subnet-xxxxxx,subnet-xxxxx"
#! set api LB to internal
LB_INTERNAL: true
#! place this file in ~/.tanzu/tkg/providers/ytt/04_user_customizations/custom_lb.yml
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@overlay/match by=overlay.subset({"kind":"AWSCluster"})
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: AWSCluster
spec:
#@overlay/match missing_ok=True
controlPlaneLoadBalancer:
#@ if data.values.LB_SUBNETS != None:
#@ subnets = data.values.LB_SUBNETS.split(",")
#@overlay/match missing_ok=True
subnets:
#@ for i in range(len(subnets)) :
- #@ subnets[i]
#@ end
#@ end
#@ if data.values.LB_INTERNAL == True:
#@overlay/match missing_ok=True
scheme: "internal"
#@ end
#! place this file in ~/.tanzu/tkg/providers/ytt/04_user_customizations/custom_lb_values.yml
#@data/values
#@overlay/match-child-defaults missing_ok=True
---
LB_INTERNAL:
LB_SUBNETS:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment