Skip to content

Commit

Permalink
uses spec.ingressClassName instead of annotation kubernetes.io/ingres…
Browse files Browse the repository at this point in the history
…s.class
  • Loading branch information
DougReeder committed Nov 9, 2024
1 parent 7ba3d59 commit 01892d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions community-edition/generate_script/hcce.yam
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ metadata:
name: ret
namespace: $Namespace
annotations:
kubernetes.io/ingress.class: haproxy
haproxy.org/response-set-header: |
access-control-allow-origin "https://$HUB_DOMAIN"
haproxy.org/path-rewrite: /api-internal(.*) /_drop_
spec:
ingressClassName: haproxy
tls:
- hosts:
- $HUB_DOMAIN
Expand Down Expand Up @@ -143,10 +143,10 @@ metadata:
name: dialog
namespace: $Namespace
annotations:
kubernetes.io/ingress.class: haproxy
haproxy.org/server-ssl: "true"
haproxy.org/load-balance: "url_param roomId"
spec:
ingressClassName: haproxy
tls:
- hosts:
- stream.$HUB_DOMAIN
Expand All @@ -169,9 +169,9 @@ metadata:
name: nearspark
namespace: $Namespace
annotations:
kubernetes.io/ingress.class: haproxy
haproxy.org/path-rewrite: /nearspark/(.*) /\1
spec:
ingressClassName: haproxy
tls:
- hosts:
- cors.$HUB_DOMAIN
Expand Down
11 changes: 5 additions & 6 deletions community-edition/services/certbotbot/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ kind: Ingress
metadata:
name: certbotbot-http
namespace: ${NAMESPACE}
annotations:
kubernetes.io/ingress.class: haproxy
spec:
ingressClassName: haproxy
rules:
- host: ${DOMAIN}
http:
Expand All @@ -60,14 +59,14 @@ spec:
backend:
service:
name: certbotbot-http
port:
port:
number: 80
EOF
)
echo "${CERTBOTING}"|kubectl apply -f -

echo "start nginx and wait $INGRESS_WAIT sec for ingress to pick up the pod" && nginx && sleep $INGRESS_WAIT

echo "requesting cert"
retries=10
while (( retries > 0 )) && ! certbot certonly --non-interactive --agree-tos --register-unsafely-without-email --preferred-challenges http --nginx -d $DOMAIN
Expand Down Expand Up @@ -131,7 +130,7 @@ echo "CP_TO_NS=$CP_TO_NS"
echo "LETSENCRYPT_ACCOUNT=$LETSENCRYPT_ACCOUNT"
if [ -z $INGRESS_WAIT ]; then INGRESS_WAIT="30"; fi

if ! [ -z $LETSENCRYPT_ACCOUNT ]; then
if ! [ -z $LETSENCRYPT_ACCOUNT ]; then
acctDir="/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/"
mkdir -p $acctDir
echo $LETSENCRYPT_ACCOUNT | base64 -d > acct.tar.gz && tar -xf acct.tar.gz -C $acctDir
Expand Down Expand Up @@ -160,7 +159,7 @@ for ns in ${CP_TO_NS//,/ }; do save_cert $CERT_NAME $ns; done

# if [ "$NAMESPACE" == "ingress" ]; then kubectl -n $NAMESPACE rollout restart deployment haproxy; fi

if [ -z $LETSENCRYPT_ACCOUNT ]; then
if [ -z $LETSENCRYPT_ACCOUNT ]; then
cd /etc/letsencrypt/accounts/acme*/directory/ && tar -czvf acct.tar.gz .
acct=$(cat acct.tar.gz|base64)
echo "reporting new letsencrypt account to orch: $acct"
Expand Down

0 comments on commit 01892d0

Please sign in to comment.