deployment

This commit is contained in:
2025-10-23 19:24:07 +02:00
parent c4ff4efeba
commit f054bacfe0
3 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: exim-forwarder-config
data:
domains: |
mainscnt.eu
addresses: |
wn@mainscnt.eu: wolfgang.hottgenroth@icloud.com
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: exim-forwarder
annotations:
configmap.reloader.stakater.com/reload: "exim-forwarder-config"
spec:
replicas: 1
selector:
matchLabels:
app: exim-forwarder
template:
metadata:
labels:
app: exim-forwarder
spec:
containers:
- name: exim-forwarder
image: %IMAGE%
ports:
- name: smtp
containerPort: 25
protocol: TCP
volumeMounts:
- name: exim-config
mountPath: /etc/exim
readOnly: true
volumes:
- name: exim-config
configMap:
name: exim-forwarder-config
items:
- key: domains
path: forward_domains
- key: addresses
path: forward_addresses
---
apiVersion: v1
kind: Service
metadata:
name: exim-forwarder
spec:
type: LoadBalancer
selector:
app: exim-forwarder
ports:
- name: smtp
port: 25
targetPort: 25
protocol: TCP

26
deployment/deploy.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
if [ "$IMAGE_TAG" == "" ]; then
echo "Make sure IMAGE_TAG is set"
exit 1
fi
IMAGE_NAME=gitea.hottis.de/deployments/exim-forwarder
NAMESPACE=forwarder
DEPLOYMENT_DIR=$PWD/deployment
pushd $DEPLOYMENT_DIR > /dev/null
kubectl create namespace $NAMESPACE \
--dry-run=client \
-o yaml | \
kubectl -f - apply
cat $DEPLOYMENT_DIR/deploy-yml.tmpl | \
sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
kubectl apply -f - -n $NAMESPACE
popd > /dev/null