homelab/manifests/ddns-secret.sh

21 lines
487 B
Bash

#!/bin/bash
# Usage: bash manifests/ddns-secret.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="$SCRIPT_DIR/../.env"
if [ ! -f "$ENV_FILE" ]; then
echo "Error: .env file not found"
exit 1
fi
source "$ENV_FILE"
kubectl create secret generic porkbun-ddns \
--namespace ddns \
--from-literal=api-key="$PORKBUN_API_KEY" \
--from-literal=secret-api-key="$PORKBUN_SECRET_KEY" \
--dry-run=client -o yaml | kubectl apply -f -
echo "Secret applied"