#!/bin/bash set -e echo "Installing Forgejo" # Get the directory where the script is located SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" # Define namespace NAMESPACE="forgejo" MANIFESTS_DIR="${SCRIPT_DIR}/../../k3s/forgejo" echo "Creating namespace..." if ! kubectl get namespace "${NAMESPACE}" >/dev/null 2>&1; then kubectl create namespace "${NAMESPACE}" else echo "Namespace '${NAMESPACE}' already exists." fi echo "Creating PersistentVolumeClaim..." kubectl apply -f ${MANIFESTS_DIR}/pvc.yaml echo "Creating Service..." kubectl apply -f ${MANIFESTS_DIR}/service.yaml echo "Creating Deployment..." kubectl apply -f ${MANIFESTS_DIR}/deployment.yaml echo "Creating Certificate Issuer..." kubectl apply -f ${MANIFESTS_DIR}/issuer.yaml echo "Creating Ingress..." kubectl apply -f ${MANIFESTS_DIR}/ingress.yaml echo "Forgejo installation complete." echo "Verify deployment with: kubectl -n ${NAMESPACE} get pods,svc,ingress,pvc" exit; # Note: The ingressTCP.yaml is for a different application (galene) and should be applied separately # echo "Note: The ingressTCP.yaml is for the galene application and has not been applied."