Created
November 1, 2022 21:55
-
-
Save jgaskins/a5afc186cadb4085616104a5fc2b3892 to your computer and use it in GitHub Desktop.
Give DigitalOcean load balancers provisioned for Kubernetes clusters a name and hostname so the Cert Manager HTTP solver will work
This file contains 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
#!/usr/bin/env bash | |
# Fill out these two | |
export LB_HOSTNAME=example.com | |
export LB_NAME=my-lb | |
echo '{"metadata":{"annotations":{"service.beta.kubernetes.io/do-loadbalancer-hostname":"$LB_HOSTNAME","service.beta.kubernetes.io/do-loadbalancer-name":"$LB_NAME"}}}' | | |
envsubst | | |
awk "{ print \"'\" \$1 \"'\" }" | | |
xargs kubectl patch svc -n ingress-nginx ingress-nginx-controller -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment