diff --git a/kubernetes/10_pvc.yaml b/kubernetes/10_pvc.yaml index 59b84fd..47ea77a 100644 --- a/kubernetes/10_pvc.yaml +++ b/kubernetes/10_pvc.yaml @@ -40,17 +40,3 @@ spec: resources: requests: storage: 10G ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: zammad-backup - namespace: zammad - annotations: - volume.beta.kubernetes.io/storage-class: standard -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 10G \ No newline at end of file diff --git a/kubernetes/20_configmap_backup.yaml b/kubernetes/20_configmap_backup.yaml deleted file mode 100644 index 00e384f..0000000 --- a/kubernetes/20_configmap_backup.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: zammad-backup - namespace: zammad -data: - S3_PATH: s3://BUCKET_NAME/ diff --git a/kubernetes/30_secret_backup.yaml b/kubernetes/30_secret_backup.yaml deleted file mode 100644 index e7ede46..0000000 --- a/kubernetes/30_secret_backup.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: zammad-backup-s3 - namespace: zammad -type: Opaque -data: - ACCESS_KEY: 'bash ACCESS_KEY | base64' - SECRET_KEY: 'bash SECRET_KEY | base64' \ No newline at end of file diff --git a/kubernetes/56_statefulset_backup.yaml b/kubernetes/56_statefulset_backup.yaml deleted file mode 100644 index 9b1ad22..0000000 --- a/kubernetes/56_statefulset_backup.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: apps/v1beta1 -kind: StatefulSet -metadata: - name: zammad-backup - namespace: zammad - labels: - component: backup - app: zammad -spec: - serviceName: zammad-backup - replicas: 1 - template: - metadata: - labels: - component: backup - app: zammad - spec: - terminationGracePeriodSeconds: 10 - volumes: - - name: zammad-home - persistentVolumeClaim: - claimName: zammad-home - - name: zammad-backup - persistentVolumeClaim: - claimName: zammad-backup - containers: - - name: zammad-backup - image: zammad/zammad-docker-compose:zammad-postgresql - command: - - /usr/local/bin/backup.sh - args: - - zammad-backup - imagePullPolicy: Always - volumeMounts: - - mountPath: /home/zammad - name: zammad-home - - mountPath: /var/tmp/zammad - name: zammad-backup \ No newline at end of file diff --git a/kubernetes/60_cronjob_backup.yaml b/kubernetes/60_cronjob_backup.yaml deleted file mode 100644 index 821be48..0000000 --- a/kubernetes/60_cronjob_backup.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -apiVersion: batch/v1beta1 -kind: CronJob -metadata: - name: zammad-backup - namespace: zammad - labels: - component: cronjob - app: backup -spec: - failedJobsHistoryLimit: 0 - successfulJobsHistoryLimit: 0 - concurrencyPolicy: Forbid - schedule: "0 0 * * *" - jobTemplate: - spec: - template: - metadata: - labels: - component: cronjob - app: backup - spec: - volumes: - - name: zammad-backup - persistentVolumeClaim: - claimName: zammad-backup - containers: - - name: zammad-backup-s3 - imagePullPolicy: Always - image: robbydooo/docker-backup-to-s3 - args: - - "/start.sh" - - "no-cron" - envFrom: - - configMapRef: - name: zammad-backup - env: - - name: ACCESS_KEY - valueFrom: - secretKeyRef: - name: zammad-backup-s3 - key: ACCESS_KEY - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: zammad-backup-s3 - key: SECRET_KEY - volumeMounts: - - mountPath: /data - name: zammad-backup - restartPolicy: OnFailure \ No newline at end of file diff --git a/kubernetes/Readme.md b/kubernetes/Readme.md index 4526c3d..25bc459 100644 --- a/kubernetes/Readme.md +++ b/kubernetes/Readme.md @@ -5,19 +5,20 @@ - On every node you need to set `sysctl -w vm.max_map_count=262144` - Change the ingress to your needs. -## Amazon S3 Backup - -If you want to be synced with a S3 bucket, then just fill the `30_secret_backup.yaml` with your secret and access keys. - -```bash -echo -n "ACCESS_KEY" | base64 -echo -n "SECRET_KEY" | base64 -``` - -Change the bucket path in the `20_configmap_backup.yaml`. - -That's it. ## Deploy zammad -Hit `kubectl apply -f ./` and wait till everything is setup. \ No newline at end of file +### Install on Minikube example + +* Install kubectl + * https://kubernetes.io/docs/tasks/tools/install-kubectl/ +* Install Minkube + * https://github.com/kubernetes/minikube +* minikube start --memory=4096 --cpus=2 +* minikube ssh + * su - + * sysctl -w vm.max_map_count=262144 +* kubectl apply -f . +* minikube dashboard + * switch to namespace "zammad" + * open "Overview" and wait until all pods are green