Adding kubernetest deployment stuff for private registry

This commit is contained in:
Moritz Graf 2025-12-20 14:35:26 +01:00
parent 574eed4dd1
commit ebbfb4f169
2 changed files with 23 additions and 3 deletions

View File

@ -2,7 +2,9 @@
# Configuration
NAMESPACE="haumdaucher"
IMAGE_NAME="haumdaucher-website"
REGISTRY="registry.moritzgraf.de"
IMAGE_BASE_NAME="haumdaucher-website"
IMAGE_NAME="$REGISTRY/$IMAGE_BASE_NAME"
TAG="latest"
echo "🚀 Starting deployment for Haumdaucher..."
@ -14,6 +16,10 @@ kubectl create namespace $NAMESPACE --dry-run=client -o yaml | kubectl apply -f
echo "📦 Building Docker image..."
docker build -t $IMAGE_NAME:$TAG .
# Push the docker image
echo "📤 Pushing Docker image to $REGISTRY..."
docker push $IMAGE_NAME:$TAG
# Apply manifests
echo "🎡 Applying Kubernetes manifests..."
kubectl apply -f k8s-manifests.yaml

View File

@ -15,10 +15,12 @@ spec:
labels:
app: haumdaucher
spec:
imagePullSecrets:
- name: registry-haumdaucher-de
containers:
- name: haumdaucher
image: haumdaucher-website:latest
imagePullPolicy: IfNotPresent
image: registry.moritzgraf.de/haumdaucher-website:latest
imagePullPolicy: Always
ports:
- containerPort: 80
---
@ -42,8 +44,16 @@ metadata:
name: haumdaucher-ingress
namespace: haumdaucher
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-buffering: "off"
nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: nginx
rules:
- host: haumdaucher.de
http:
@ -55,3 +65,7 @@ spec:
name: haumdaucher-service
port:
number: 80
tls:
- hosts:
- haumdaucher.de
secretName: haumdaucher-de-tls