- Create .env.example for API credentials - Update .gitignore to include .env file - Add cluster issuer configurations for internal CA and Let's Encrypt - Implement porkbun-secret.sh for creating Kubernetes secrets - Define Helm values for cert-manager, Gitea, and Pihole with TLS settings
24 lines
698 B
Bash
Executable File
24 lines
698 B
Bash
Executable File
#!/bin/bash
|
|
# Usage: bash manifests/cert-manager/porkbun-secret.sh
|
|
# Requires: .env file in repo root with PORKBUN_API_KEY and PORKBUN_SECRET_API_KEY
|
|
|
|
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 at $ENV_FILE"
|
|
echo "Copy .env.example to .env and fill in your values"
|
|
exit 1
|
|
fi
|
|
|
|
source "$ENV_FILE"
|
|
|
|
kubectl create secret generic porkbun-api-credentials \
|
|
--namespace cert-manager \
|
|
--from-literal=api-key="$PORKBUN_API_KEY" \
|
|
--from-literal=secret-api-key="$PORKBUN_SECRET_API_KEY" \
|
|
--dry-run=client -o yaml | kubectl apply -f -
|
|
|
|
echo "Secret applied successfully" |