32 lines
732 B
Bash
32 lines
732 B
Bash
|
#!/bin/sh
|
||
|
# Script to update the
|
||
|
secret="localhost-mixinet-net-ingress-cert"
|
||
|
cert="${1:-localhost.mixinet.net.crt}"
|
||
|
key="${2:-localhost.mixinet.net.key}"
|
||
|
if [ -f "$cert" ] && [ -f "$key" ]; then
|
||
|
kubectl -n kube-system create secret tls $secret \
|
||
|
--key=$key \
|
||
|
--cert=$cert \
|
||
|
--dry-run=client --save-config -o yaml | kubectl apply -f -
|
||
|
kubectl apply -f - << EOF
|
||
|
apiVersion: traefik.containo.us/v1alpha1
|
||
|
kind: TLSStore
|
||
|
metadata:
|
||
|
name: default
|
||
|
namespace: kube-system
|
||
|
|
||
|
spec:
|
||
|
defaultCertificate:
|
||
|
secretName: $secret
|
||
|
EOF
|
||
|
else
|
||
|
cat <<EOF
|
||
|
To add or update the traefik TLS certificate the following files are needed:
|
||
|
|
||
|
- cert: '$cert'
|
||
|
- key: '$key'
|
||
|
|
||
|
Note: you can pass the paths as arguments to this script.
|
||
|
EOF
|
||
|
fi
|