Email: imap web client using alps
diff --git a/apps/alps/Dockerfile b/apps/alps/Dockerfile
new file mode 100644
index 0000000..d6b38c8
--- /dev/null
+++ b/apps/alps/Dockerfile
@@ -0,0 +1,18 @@
+FROM golang:1.17.2 AS build
+
+WORKDIR /code
+RUN git clone https://git.sr.ht/~migadu/alps
+WORKDIR /code/alps
+RUN go mod download
+
+ENV CGO_ENABLED=0
+ENV GO111MODULE=on
+RUN go build -o alps cmd/alps/main.go
+
+FROM alpine:3.14.2
+
+WORKDIR /
+COPY --from=build /code/alps ./alps
+# COPY --from=build /code/alps/alps ./alps
+# RUN chmod +x /alps/alps
+# COPY --from=build /code/alps/themes ./themes
diff --git a/apps/alps/Makefile b/apps/alps/Makefile
new file mode 100644
index 0000000..27074a1
--- /dev/null
+++ b/apps/alps/Makefile
@@ -0,0 +1,5 @@
+image_arm64:
+	docker build --tag=giolekva/alps:latest . --platform=linux/arm64
+
+push_arm64: image_arm64
+	docker push giolekva/alps:latest
diff --git a/apps/alps/install.yaml b/apps/alps/install.yaml
new file mode 100644
index 0000000..4a6310c
--- /dev/null
+++ b/apps/alps/install.yaml
@@ -0,0 +1,89 @@
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: app-alps
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: alps
+  namespace: app-alps
+spec:
+  type: ClusterIP
+  selector:
+    app: alps
+  ports:
+  - name: http
+    port: 80
+    targetPort: http
+    protocol: TCP
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: ingress
+  namespace: app-alps
+  annotations:
+    cert-manager.io/cluster-issuer: "selfsigned-ca"
+    acme.cert-manager.io/http01-edit-in-place: "true"
+spec:
+  ingressClassName: nginx-private
+  tls:
+  - hosts:
+    - mail.pcloud
+    secretName: cert-mail.pcloud
+  rules:
+  - host: mail.pcloud
+    http:
+      paths:
+      - path: /
+        pathType: Prefix
+        backend:
+          service:
+            name: alps
+            port:
+              name: http
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: alps
+  namespace: app-alps
+spec:
+  selector:
+    matchLabels:
+      app: alps
+  replicas: 1
+  template:
+    metadata:
+      labels:
+        app: alps
+    spec:
+      containers:
+      - name: alps
+        image: giolekva/alps:latest
+        imagePullPolicy: Always
+        ports:
+        - name: http
+          containerPort: 8080
+          protocol: TCP
+        workingDir: "/alps"
+        command:
+        - "./alps"
+        - "--addr=0.0.0.0:8080"
+        - "--theme=alps"
+        - "imaps://mx1.lekva.me:993"
+        - "smtps://mx1.lekva.me:465"
+        resources:
+          requests:
+            memory: "10Mi"
+            cpu: "10m"
+          limits:
+            memory: "20Mi"
+            cpu: "100m"
+      tolerations:
+      - key: "pcloud"
+        operator: "Equal"
+        value: "role"
+        effect: "NoSchedule"
diff --git a/scripts/homelab/k3s-install.sh b/scripts/homelab/k3s-install.sh
index a6f1fa7..8e78908 100755
--- a/scripts/homelab/k3s-install.sh
+++ b/scripts/homelab/k3s-install.sh
@@ -107,6 +107,7 @@
 # kubectl apply -f maddy-config.yaml
 ## maddyctl -config /etc/maddy/config/maddy.conf creds create *****@lekva.me
 ## maddyctl -config /etc/maddy/config/maddy.conf imap-acct create *****@lekva.me
+# kubectl apply -f ../../apps/alps/install.yaml
 
 
 ## kubectl -n ingress-nginx get secret cert-wildcard.lekva.me -o yaml > cert-wildcard.lekva.me.yaml