Last active
September 8, 2021 20:58
-
-
Save warroyo/0b866d58e6cfd756baa86fb91d6aa15c to your computer and use it in GitHub Desktop.
custom lb setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! 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