Welcome to the Globaleaks Kubernetes deployment using Helm and Traefik as the ingress controller! This repository contains the necessary files and instructions to deploy Globaleaks on Kubernetes using a Helm chart.
The goal of this project is to deploy Globaleaks on Kubernetes using Traefik as the ingress controller, packaged as a Helm chart for easy deployment and management.
- Deploy Globaleaks using Kubernetes and Traefik as the ingress controller.
- Package the deployment into a Helm chart for easy distribution.
- Implement a daily backup strategy using Kubernetes CronJobs and Velero for volume snapshots.
- Rancher Desktop with k3s as the Kubernetes runtime.
- Traefik and Helm already installed and configured within the Kubernetes cluster.
git clone https://github.com/mirabelle4/globaleaks-helm-k8s.git
cd globaleaks-helm-k8s
tar -xzvf globaleaks-helm-chart.tgz
helm install globaleaks ./globaleaks-helm-chart
To access the Traefik dashboard, run the following command:
kubectl port-forward -n kube-system $(kubectl -n kube-system get pods --selector "app.kubernetes.io/name=traefik" -o jsonpath="{.items[0].metadata.name}") 9000:9000
Now, you can access the Traefik dashboard at:
http://localhost:9000/dashboard/
To access Globaleaks through the browser, use:
http://localhost:443
If you're deploying this in a production environment or using a custom domain, you'll need to replace localhost
in the IngressRoute definition file with your actual domain name.
The provided Helm chart includes the following:
- Kubernetes Deployment for Globaleaks.
- Traefik IngressRoute configuration.
- Persistent Volume setup to handle Globaleaks data.
- Services and Pods to ensure scalability and stability.
Velero is a tool that helps manage backups, restores, and disaster recovery in Kubernetes. You can use it to create volume snapshots of Globaleaksβ persistent storage.
Install Velero using Helm:
helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
helm install velero vmware-tanzu/velero --namespace velero --create-namespace \
--set-file credentials.secretContents.cloud=./credentials-velero \
--set configuration.provider=aws \
--set configuration.backupStorageLocation.name=default \
--set configuration.backupStorageLocation.bucket=<YOUR-BUCKET> \
--set configuration.volumeSnapshotLocation.name=default \
--set configuration.volumeSnapshotLocation.config.region=<YOUR-REGION>
Note: You will need to replace the AWS S3 bucket and region with your actual cloud storage configuration (e.g., AWS, Azure, GCP).
Configure Velero for daily backups:
velero create schedule daily-backup --schedule="0 2 * * *" --include-namespaces=default
This creates a daily backup at 2:00 AM UTC for all resources within the default namespace, including Globaleaks data.
Take manual snapshots:
velero backup create globaleaks-backup --include-namespaces=default
Check backup status:
velero backup describe globaleaks-backup
Restore from a backup:
velero restore create --from-backup globaleaks-backup
In addition to volume snapshots, you can also back up specific Globaleaks data using Kubernetes CronJobs to schedule regular file backups.
Create a CronJob YAML file:
apiVersion: batch/v1
kind: CronJob
metadata:
name: globaleaks-backup
spec:
schedule: "0 2 * * *" # Daily at 2:00 AM
jobTemplate:
spec:
template:
spec:
containers:
- name: backup
image: alpine
volumeMounts:
- name: globaleaks-data
mountPath: /data
command:
- /bin/sh
- -c
- "tar -czf /backup/globaleaks-backup-$(date +\\%F).tar.gz -C /data ."
volumeMounts:
- name: backup-storage
mountPath: /backup
restartPolicy: OnFailure
volumes:
- name: globaleaks-data
persistentVolumeClaim:
claimName: globaleaks-pvc
- name: backup-storage
persistentVolumeClaim:
claimName: backup-pvc
Apply the CronJob:
kubectl apply -f globaleaks-backup-cronjob.yaml
Verify the CronJob:
kubectl logs $(kubectl get pods --selector=job-name=globaleaks-backup -o jsonpath='{.items[0].metadata.name}')
Retrieve backups: You can retrieve the generated .tar.gz
files from the backup storage (e.g., S3, NFS, or any storage solution mounted in the backup-pvc
).
- Ensure to replace
localhost
with your domain name in the IngressRoute file when deploying to production or non-local environments. - The daily backup strategy using Velero for volume snapshots and Kubernetes CronJobs for file backups provides a robust and automated backup solution.