Browse Source

Añado Appsmith

main
Celestino Rey 3 years ago
parent
commit
d3e8d9d86f
16 changed files with 311 additions and 5 deletions
  1. +82
    -0
      Appsmith/appsmith-deployment.yaml
  2. +4
    -0
      Appsmith/as-namespace.yaml
  3. +24
    -0
      Appsmith/copyMediawikiDB
  4. +4
    -0
      Appsmith/creaTodo.sh
  5. +23
    -0
      Appsmith/docker-compose.yml
  6. +1
    -0
      Appsmith/entra.sh
  7. +12
    -0
      Appsmith/kustomization.yaml
  8. +71
    -0
      Appsmith/mysql-deployment-as.yaml
  9. +3
    -0
      Appsmith/paraTodo.sh
  10. +54
    -0
      Appsmith/php-myadmin-as-deployment.yaml
  11. +12
    -0
      Appsmith/pv-local-appsmith.yaml
  12. +11
    -0
      Appsmith/pv-local-mysql-as.yaml
  13. BIN
      Drupal/copia.zip
  14. +7
    -3
      Drupal/copyDrupalDB
  15. +1
    -1
      Firefly/k8s-cluster/copyDBK8S
  16. +2
    -1
      Mediawiki/copyMediawikiDB

+ 82
- 0
Appsmith/appsmith-deployment.yaml View File

@ -0,0 +1,82 @@
apiVersion: v1
kind: Service
metadata:
name: appsmith
namespace: appsmith
labels:
app: appsmith
spec:
type: NodePort
ports:
- port: 80
nodePort: 30798
targetPort: appsmith
selector:
app: appsmith
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: as-pv-claim
namespace: appsmith
labels:
app: appsmith
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: appsmith
namespace: appsmith
labels:
app: appsmith
spec:
selector:
matchLabels:
app: appsmith
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: appsmith
tier: frontend
spec:
containers:
- image: index.docker.io/appsmith/appsmith-ce
name: appsmith
env:
- name: DB_TYPE
value: mysql
- name: DB_NAME
value: appsmith
- name: DB_HOST
value: appsmith-mysql
- name: DB_PASS
valueFrom:
secretKeyRef:
name: mysqlas-pass
key: password
- name: DB_USER
valueFrom:
secretKeyRef:
name: mysqlas-pass
key: db_user
ports:
- containerPort: 80
name: appsmith
volumeMounts:
- name: appsmith-persistent-storage
mountPath: /var/www/html
volumes:
- name: appsmith-persistent-storage
persistentVolumeClaim:
claimName: as-pv-claim

+ 4
- 0
Appsmith/as-namespace.yaml View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: appsmith

+ 24
- 0
Appsmith/copyMediawikiDB View File

@ -0,0 +1,24 @@
# 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_mediawiki
new_name=$file_name-$today.sql
echo "Backup file name: " "$new_name"
#sudo docker exec `sudo docker container ls | grep mysql_mediawiki | cut -f1 -d' '` /usr/bin/mysqldump -u root --password=Dsa-0213 mediawiki > $new_name
sudo kubectl --kubeconfig /home/creylopez/.kube/config exec `kubectl --kubeconfig /home/creylopez/.kube/config get pod -n mediawiki|grep mysql|cut -f1 -d' '` -n mediawiki -- /usr/bin/mysqldump -u root --password=Dsa-0213 mediawiki > $new_name
message="Backup stored "$today
sudo -u creylopez cat $new_name | mail -s "Mediawiki backup finished" "creylopez@yahoo.es"
sudo rm $new_name

+ 4
- 0
Appsmith/creaTodo.sh View File

@ -0,0 +1,4 @@
kubectl create -f pv-local-mysql-as.yaml
kubectl create -f pv-local-appsmith.yaml
kubectl create -k ./
watch kubectl get all -n appsmith

+ 23
- 0
Appsmith/docker-compose.yml View File

@ -0,0 +1,23 @@
version: "3"
services:
appsmith:
image: index.docker.io/appsmith/appsmith-ce
container_name: appsmith
ports:
- "80:80"
- "443:443"
volumes:
- ./stacks:/appsmith-stacks
restart: unless-stopped
# # Uncomment the lines below to enable auto-update
# labels:
# com.centurylinklabs.watchtower.enable: "true"
# auto_update:
# image: containrrr/watchtower:latest-dev
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# # Update check interval in seconds.
# command: --schedule "0 0 * ? * *" --label-enable --cleanup
# restart: unless-stopped

+ 1
- 0
Appsmith/entra.sh View File

@ -0,0 +1 @@
kubectl exec -ti deployment.apps/appsmith -n appsmith -- /bin/bash

+ 12
- 0
Appsmith/kustomization.yaml View File

@ -0,0 +1,12 @@
secretGenerator:
- name: mysqlas-pass
namespace: appsmith
literals:
- password=Dsa-0213
- db_user=root
- db_passwd=Dsa-0213
resources:
- as-namespace.yaml
- mysql-deployment-as.yaml
- appsmith-deployment.yaml
- php-myadmin-as-deployment.yaml

+ 71
- 0
Appsmith/mysql-deployment-as.yaml View File

@ -0,0 +1,71 @@
apiVersion: v1
kind: Service
metadata:
name: appsmith-mysql
namespace: appsmith
labels:
app: appsmith
spec:
type: NodePort
ports:
- name: mysql
port: 3306
nodePort: 30781
targetPort: mysql
selector:
app: appsmith
tier: mysql
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-as-pv-claim
namespace: appsmith
labels:
app: appsmith
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: appsmith-mysql
namespace: appsmith
labels:
app: appsmith
spec:
selector:
matchLabels:
app: appsmith
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: appsmith
tier: mysql
spec:
containers:
- image: mariadb
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlas-pass
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-as-pv-claim

+ 3
- 0
Appsmith/paraTodo.sh View File

@ -0,0 +1,3 @@
kubectl delete -k ./
kubectl delete -f pv-local-mysql-as.yaml
kubectl delete -f pv-local-appsmith.yaml

+ 54
- 0
Appsmith/php-myadmin-as-deployment.yaml View File

@ -0,0 +1,54 @@
apiVersion: v1
kind: Service
metadata:
name: phpmyadmin-appsmith
namespace: appsmith
labels:
app: appsmith
spec:
selector:
app: appsmith
tier: phpmyadmin
type: NodePort
ports:
- name: phpadmin
port: 80
nodePort: 30780
targetPort: phpmyadm
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: phpmyadmin-appsmith
namespace: appsmith
labels:
app: appsmith
spec:
selector:
matchLabels:
app: appsmith
tier: phpmyadmin
strategy:
type: Recreate
template:
metadata:
labels:
app: appsmith
tier: phpmyadmin
spec:
containers:
- name: phpmyadmin
image: phpmyadmin
ports:
- containerPort: 80
name: phpmyadm
env:
- name: PMA_HOST
value: appsmith-mysql
- name: PMA_PORT
value: "3306"
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlas-pass
key: password

+ 12
- 0
Appsmith/pv-local-appsmith.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: as-folder
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/cluster/appsmith/appsmith"

+ 11
- 0
Appsmith/pv-local-mysql-as.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: as-data
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/cluster/appsmith/appsmith-db"

BIN
Drupal/copia.zip View File


+ 7
- 3
Drupal/copyDrupalDB View File

@ -14,10 +14,14 @@ file_name=$BACKUP_FOLDER/bkup_drupal
new_name=$file_name-$today.sql
echo "Backup file name: " "$new_name"
sudo docker exec `sudo docker container ls | grep mysql_drupal | cut -f1 -d' '` /usr/bin/mysqldump -u root --password=Dsa-0213 drupaldb > $new_name
sudo kubectl --kubeconfig /home/creylopez/.kube/config -n drupal exec `sudo kubectl --kubeconfig /home/creylopez/.kube/config get pod -n drupal | grep mysql | cut -f1 -d' '` -- /usr/bin/mysqldump -u root --password=Dsa-0213 drupaldb > $new_name
message="Backup stored "$today
sudo -u creylopez cat $new_name | mail -s "Drupal backup finished" "creylopez@yahoo.es"
zip $new_name.zip $new_name
sudo -u creylopez echo "Copia terminada" | mail -s "Drupal backup finished" "creylopez@yahoo.es" -A $new_name.zip
sudo rm $new_name*
sudo rm $new_name

+ 1
- 1
Firefly/k8s-cluster/copyDBK8S View File

@ -14,7 +14,7 @@ file_name=$BACKUP_FOLDER/bkup_fireflyiii
new_name=$file_name-$today.sql
echo "Backup file name: " "$new_name"
sudo docker exec `sudo docker container ls | grep mysql_firefly | cut -f1 -d' '` /usr/bin/mysqldump -u root --password=Rey-1176 fireflyiii > $new_name
sudo kubectl --kubeconfig /home/creylopez/.kube/config exec `kubectl --kubeconfig /home/creylopez/.kube/config get pod -n firefly|grep iii-mysql|cut -f1 -d' '` -n firefly -- /usr/bin/mysqldump -u root --password=Rey-1176 fireflyiii > $new_name
message="Backup stored "$today


+ 2
- 1
Mediawiki/copyMediawikiDB View File

@ -14,7 +14,8 @@ file_name=$BACKUP_FOLDER/bkup_mediawiki
new_name=$file_name-$today.sql
echo "Backup file name: " "$new_name"
sudo docker exec `sudo docker container ls | grep mysql_mediawiki | cut -f1 -d' '` /usr/bin/mysqldump -u root --password=Dsa-0213 mediawiki > $new_name
#sudo docker exec `sudo docker container ls | grep mysql_mediawiki | cut -f1 -d' '` /usr/bin/mysqldump -u root --password=Dsa-0213 mediawiki > $new_name
sudo kubectl --kubeconfig /home/creylopez/.kube/config exec `kubectl --kubeconfig /home/creylopez/.kube/config get pod -n mediawiki|grep mysql|cut -f1 -d' '` -n mediawiki -- /usr/bin/mysqldump -u root --password=Dsa-0213 mediawiki > $new_name
message="Backup stored "$today


Loading…
Cancel
Save