| @ -0,0 +1,21 @@ | |||||
| # Backup date | |||||
| today=$(date "+%Y_%m_%d-%H_%M_%S") | |||||
| echo "Current date: $today" | |||||
| # build up filename | |||||
| # destination folder (change to your own needs) | |||||
| BACKUP_FOLDER=/tmp | |||||
| file_name=$BACKUP_FOLDER/bkup_fireflyiii | |||||
| new_name=$file_name-$today.sql | |||||
| echo "Backup file name: " "$new_name" | |||||
| docker exec `docker container ls | grep mysql_firefly | cut -f1 -d' '` /usr/bin/mysqldump -u root --password=Rey-1176 fireflyiii > $new_name | |||||
| message="Backup stored "$today | |||||
| sudo -u creylopez echo $message | mail -s "FireflyIII backup finished" "creylopez@yahoo.es" -A $new_name | |||||
| @ -0,0 +1,4 @@ | |||||
| kubectl create -f pv-local-ff.yaml | |||||
| kubectl create -f pv-local-mysql.yaml | |||||
| kubectl create -k ./ | |||||
| watch kubectl get all -n firefly | |||||
| @ -0,0 +1,3 @@ | |||||
| kubectl delete -k ./ | |||||
| kubectl delete -f pv-local-ff.yaml | |||||
| kubectl delete -f pv-local-mysql.yaml | |||||
| @ -0,0 +1,11 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: data-firefly-iii | |||||
| spec: | |||||
| capacity: | |||||
| storage: 10Gi | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| hostPath: | |||||
| path: "/mnt/cluster/fireflyiii/firefly-uploads" | |||||
| @ -0,0 +1,11 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: data-firefly-iii-mysql | |||||
| spec: | |||||
| capacity: | |||||
| storage: 20Gi | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| hostPath: | |||||
| path: "/mnt/cluster/fireflyiii/firefly-uploads" | |||||
| @ -0,0 +1,16 @@ | |||||
| apiVersion: v1 | |||||
| kind: ConfigMap | |||||
| metadata: | |||||
| name: nginx-config | |||||
| data: | |||||
| default.conf: | | |||||
| server { | |||||
| listen 80; | |||||
| listen [::]:80; | |||||
| server_name _; | |||||
| location / { | |||||
| add_header Content-Type text/plain; # Prevents download | |||||
| return 200 "Hello world! Kubernetes + Let's encrypt demo."; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,31 @@ | |||||
| apiVersion: apps/v1 | |||||
| kind: Deployment | |||||
| metadata: | |||||
| name: lets | |||||
| labels: | |||||
| app: lets | |||||
| spec: | |||||
| selector: | |||||
| matchLabels: | |||||
| app: lets | |||||
| tier: frontend | |||||
| replicas: 1 | |||||
| template: | |||||
| metadata: | |||||
| labels: | |||||
| app: lets | |||||
| tier: frontend | |||||
| spec: | |||||
| containers: | |||||
| - name: lets | |||||
| image: nginx | |||||
| ports: | |||||
| - containerPort: 80 | |||||
| volumeMounts: | |||||
| - name: nginx-configs | |||||
| mountPath: /etc/nginx/conf.d | |||||
| # Load the configuration files for nginx | |||||
| volumes: | |||||
| - name: nginx-configs | |||||
| configMap: | |||||
| name: nginx-config | |||||
| @ -0,0 +1,17 @@ | |||||
| apiVersion: networking.k8s.io/v1 | |||||
| kind: Ingress | |||||
| metadata: | |||||
| name: "kubernetes-demo-app-ingress-service" | |||||
| spec: | |||||
| rules: | |||||
| - host: kubernetes-letsencrypt.crey.fail # CHANGE ME! | |||||
| http: | |||||
| paths: | |||||
| # The * is needed so that all traffic gets redirected to nginx | |||||
| - path: /* | |||||
| pathType: Prefix | |||||
| backend: | |||||
| service: | |||||
| name: lets | |||||
| port: | |||||
| number: 80 | |||||
| @ -0,0 +1,12 @@ | |||||
| apiVersion: v1 | |||||
| kind: Service | |||||
| metadata: | |||||
| name: lets | |||||
| spec: | |||||
| type: NodePort | |||||
| selector: | |||||
| app: lets | |||||
| ports: | |||||
| - protocol: "TCP" | |||||
| port: 80 | |||||
| nodePort: 30380 | |||||
| @ -0,0 +1,43 @@ | |||||
| apiVersion: v1 | |||||
| kind: Service | |||||
| metadata: | |||||
| name: code-server | |||||
| namespace: nextcloud | |||||
| labels: | |||||
| app: code | |||||
| spec: | |||||
| selector: | |||||
| pod-label: code-server-pod | |||||
| type: NodePort | |||||
| ports: | |||||
| - port: 9980 | |||||
| nodePort: 30389 | |||||
| targetPort: code | |||||
| --- | |||||
| apiVersion: apps/v1 | |||||
| kind: Deployment | |||||
| metadata: | |||||
| name: code-server | |||||
| namespace: nextcloud | |||||
| labels: | |||||
| app: code | |||||
| spec: | |||||
| replicas: 1 | |||||
| selector: | |||||
| matchLabels: | |||||
| pod-label: code-server-pod | |||||
| template: | |||||
| metadata: | |||||
| labels: | |||||
| pod-label: code-server-pod | |||||
| spec: | |||||
| containers: | |||||
| - name: code | |||||
| image: collabora/code | |||||
| env: | |||||
| - name: extra_params | |||||
| value: --o:ssl.enable=false | |||||
| ports: | |||||
| - containerPort: 9980 | |||||
| name: code | |||||
| @ -1,3 +1,3 @@ | |||||
| kubectl create -f pv-nextcloud.yaml | |||||
| kubectl create -f pv-local-nextcloud.yaml | |||||
| kubectl create -k ./ | kubectl create -k ./ | ||||
| kubectl get all -n nextcloud | |||||
| watch kubectl get all -n nextcloud | |||||
| @ -1,2 +1,2 @@ | |||||
| kubectl delete -k ./ | kubectl delete -k ./ | ||||
| kubectl delete -f pv-nextcloud.yaml | |||||
| kubectl delete -f pv-local-nextcloud.yaml | |||||
| @ -0,0 +1,11 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: nextcloud | |||||
| spec: | |||||
| capacity: | |||||
| storage: 50Gi | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| hostPath: | |||||
| path: "/mnt/cluster/nextcloud" | |||||
| @ -0,0 +1,11 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: www-nginx-folder | |||||
| spec: | |||||
| capacity: | |||||
| storage: 2Gi | |||||
| accessModes: | |||||
| - ReadWriteMany | |||||
| hostPath: | |||||
| path: "/mnt/cluster/nginx" | |||||
| @ -1,3 +1,4 @@ | |||||
| kubectl create -f pv-mysql.yaml | |||||
| kubectl create -f pv-wordpress.yaml | |||||
| kubectl create -f pv-local-mysql.yaml | |||||
| kubectl create -f pv-local-wordpress.yaml | |||||
| kubectl create -k ./ | kubectl create -k ./ | ||||
| watch kubectl get all -n wordpress | |||||
| @ -1,3 +1,3 @@ | |||||
| kubectl delete -k ./ | kubectl delete -k ./ | ||||
| kubectl delete -f pv-mysql.yaml | |||||
| kubectl delete -f pv-wordpress.yaml | |||||
| kubectl delete -f pv-local-mysql.yaml | |||||
| kubectl delete -f pv-local-wordpress.yaml | |||||
| @ -0,0 +1,11 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: wp-data | |||||
| spec: | |||||
| capacity: | |||||
| storage: 20Gi | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| hostPath: | |||||
| path: "/mnt/cluster/wordpress/wordpress-db" | |||||
| @ -0,0 +1,12 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: wp-folder | |||||
| spec: | |||||
| capacity: | |||||
| storage: 10Gi | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| hostPath: | |||||
| path: "/mnt/cluster/wordpress/wordpress-wp" | |||||
| @ -0,0 +1,4 @@ | |||||
| apiVersion: v1 | |||||
| kind: Namespace | |||||
| metadata: | |||||
| name: wordpress | |||||