add syno-tls

This commit is contained in:
James Andariese 2023-04-27 21:07:31 -05:00
parent 7699c49a46
commit 21e189736c
3 changed files with 46 additions and 0 deletions

4
syno-tls/ns.yaml Normal file
View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: syno-tls

25
syno-tls/regen.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# this is not necessary, usually. there is a proxy in docker/haproxy which is
# the new reverse proxy on the synology. it has an update-tls.sh script which
# does the below but also loads it properly into the container.
# this is for debugging!
set -e
set -x
kubectl -n syno-tls replace --force -f synology-tls.yaml
kubectl -n syno-tls wait cert/syno-tls --for=condition=Ready
SECRET="$(kubectl -n syno-tls get secret syno-tls -o json)"
CRT="$(echo "$SECRET" | jq -r '.data["tls.crt"] | @base64d "\(.)"')"
KEY="$(echo "$SECRET" | jq -r '.data["tls.key"] | @base64d "\(.)"')"
CA="$( echo "$SECRET" | jq -r '.data["ca.crt"] | @base64d "\(.)"')"
echo "$KEY" > tls.key
echo "$CRT" | awk '/-----BEGIN/ {seg+=1;blk=1} seg==1&&blk {print} /------END/ {blk=0}' > tls.crt
echo "$CRT" | awk '/-----BEGIN/ {seg+=1;blk=1} seg>1&&blk {print} /------END/ {blk=0}' > int.crt
echo "$CA" > ca.crt
wait

View File

@ -0,0 +1,17 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: syno-tls
namespace: syno-tls
spec:
secretName: syno-tls
issuerRef:
name: zerossl
kind: ClusterIssuer
dnsNames:
- strudelline.net
- werts.us
- '*.strudelline.net'
- '*.minio.strudelline.net'
- '*.cascade.strudelline.net'
- '*.werts.us'