Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Running in a kubernetes environment #6

Closed
ghudgins opened this issue Oct 31, 2020 · 1 comment
Closed

Running in a kubernetes environment #6

ghudgins opened this issue Oct 31, 2020 · 1 comment

Comments

@ghudgins
Copy link

ghudgins commented Oct 31, 2020

Wrote the steps to get this up and running in a kubernetes environment. It's a bit different but maybe my understanding of k8s is still too limited. Anyway, I hope this helps someone.

Running in a Kubernetes Environment

The instructions and deployment is a bit different when you wish to run this container in kubernetes.

  • Create a Persistent Volume Claim for your logged-in user data. This will be used by each pod after you set things up once.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: protonmail-bridge-pv-claim
spec:
  storageClassName: your-storageclass
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi

  • Deploy the image of your choice that matches your architecture that leverages the PVC for your /root/ user directory (config is stored here). I use an arm64 image here.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: protonmail-bridge-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: protonmail-bridge
  template:
    metadata:
      labels:
        app: protonmail-bridge
    spec:
      volumes: 
        - name: protonmail-data
          persistentVolumeClaim: 
            claimName: protonmail-bridge-pv-claim
      containers:
      - name: protonmail-bridge-container
        volumeMounts:
          - mountPath: "/root/"
            name: protonmail-data
        image: shenxn/protonmail-bridge:1.3.3-build
        ports:
        - containerPort: 25
  • Get the name of your deployed pod kubectl get pods
  • Run interactively on the pod (setup only) kubectl exec --stdin --tty protonmail-bridge-deployment-6c79fd7f84-ftwcw -- /bin/bash
  • Once logged in, execute the init command bash /protonmail/entrypoint.sh init
  • You should now see the CLI for protonmail-bridge, authenticate with login
  • (optional) if you're like me and use split address mode, change mode and info are good for printing the details.
  • Copy your SMTP server info (or IMAP, your choice)
  • delete the active pod so a new one gets created (which will properly fire up with your persisted settings)
  • create a service for your new SMPT server
apiVersion: v1
kind: Service
metadata:
  name: smtp-service
spec:
  type: NodePort
  selector:
    app: protonmail-bridge
  ports:
    - port: 25
  • test it out! If all went well you should be able to enter the smtp-service.default.svc.cluster.local for the service on port 25. In wordpress I had to set none for encryption and specify port 25
@sdwilsh
Copy link

sdwilsh commented Feb 19, 2024

Just wanted to add that this command failed for me:

Once logged in, execute the init command bash /protonmail/entrypoint.sh init

INFO[0000] Migrating keychain helper
WARN[Feb 19 21:18:12.373] Failed to create lock file; another instance is running

I had to kill the bridge process in order for the command to work.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants