diff --git a/mail-archiver/docker-compose.yaml b/mail-archiver/docker-compose.yaml new file mode 100644 index 0000000..0ed15b5 --- /dev/null +++ b/mail-archiver/docker-compose.yaml @@ -0,0 +1,45 @@ +services: + mailarchive-app: + image: s1t5/mailarchiver:latest + restart: always + environment: + # Database Connection + - ConnectionStrings__DefaultConnection=Host=postgres;Database=MailArchiver;Username=mailuser;Password=masterkey; + + # Authentication Settings + - Authentication__Username=admin + - Authentication__Password=secure123! + + # TimeZone Settings + - TimeZone__DisplayTimeZoneId=Etc/UCT + ports: + - "5000:5000" + networks: + - postgres + volumes: + - ./data-protection-keys:/app/DataProtection-Keys + depends_on: + postgres: + condition: service_healthy + + + postgres: + image: postgres:17-alpine + restart: always + environment: + POSTGRES_DB: MailArchiver + POSTGRES_USER: mailuser + POSTGRES_PASSWORD: masterkey + volumes: + - ./postgres-data:/var/lib/postgresql/data + networks: + - postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U mailuser -d MailArchiver"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s + +networks: + postgres: diff --git a/mail-archiver/mailarchive-app-claim0-persistentvolumeclaim.yaml b/mail-archiver/mailarchive-app-claim0-persistentvolumeclaim.yaml new file mode 100644 index 0000000..14aea46 --- /dev/null +++ b/mail-archiver/mailarchive-app-claim0-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: mailarchive-app-claim0 + name: mailarchive-app-claim0 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/mail-archiver/mailarchive-app-deployment.yaml b/mail-archiver/mailarchive-app-deployment.yaml new file mode 100644 index 0000000..7077e59 --- /dev/null +++ b/mail-archiver/mailarchive-app-deployment.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: mailarchive-app + name: mailarchive-app +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mailarchive-app + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: mailarchive-app + spec: + containers: + - env: + - name: Authentication__Password + value: secure123! + - name: Authentication__Username + value: admin + - name: ConnectionStrings__DefaultConnection + value: Host=postgres;Database=MailArchiver;Username=mailuser;Password=masterkey; + - name: TimeZone__DisplayTimeZoneId + value: Etc/UCT + image: s1t5/mailarchiver:latest + name: mailarchive-app + ports: + - containerPort: 5000 + protocol: TCP + volumeMounts: + - mountPath: /app/DataProtection-Keys + name: mailarchive-app-claim0 + restartPolicy: Always + volumes: + - name: mailarchive-app-claim0 + persistentVolumeClaim: + claimName: mailarchive-app-claim0 diff --git a/mail-archiver/mailarchive-app-service.yaml b/mail-archiver/mailarchive-app-service.yaml new file mode 100644 index 0000000..6328816 --- /dev/null +++ b/mail-archiver/mailarchive-app-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: mailarchive-app + name: mailarchive-app +spec: + ports: + - name: "5000" + port: 5000 + targetPort: 5000 + selector: + io.kompose.service: mailarchive-app diff --git a/mail-archiver/postgres-claim0-persistentvolumeclaim.yaml b/mail-archiver/postgres-claim0-persistentvolumeclaim.yaml new file mode 100644 index 0000000..c974039 --- /dev/null +++ b/mail-archiver/postgres-claim0-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: postgres-claim0 + name: postgres-claim0 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/mail-archiver/postgres-deployment.yaml b/mail-archiver/postgres-deployment.yaml new file mode 100644 index 0000000..37b9cdc --- /dev/null +++ b/mail-archiver/postgres-deployment.yaml @@ -0,0 +1,50 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: postgres + name: postgres +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: postgres + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: postgres + spec: + containers: + - env: + - name: POSTGRES_DB + value: MailArchiver + - name: POSTGRES_PASSWORD + value: masterkey + - name: POSTGRES_USER + value: mailuser + image: postgres:17-alpine + livenessProbe: + exec: + command: + - pg_isready -U mailuser -d MailArchiver + failureThreshold: 5 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + name: postgres + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: postgres-claim0 + restartPolicy: Always + volumes: + - name: postgres-claim0 + persistentVolumeClaim: + claimName: postgres-claim0 diff --git a/metallb/metallb-advert.yaml b/metallb/metallb-advert.yaml index 75f2b55..0cc5c16 100644 --- a/metallb/metallb-advert.yaml +++ b/metallb/metallb-advert.yaml @@ -1,5 +1,8 @@ apiVersion: metallb.io/v1beta1 kind: L2Advertisement metadata: - name: example + name: l2adv-main namespace: metallb-system +spec: + ipAddressPools: + - main-pool