removed mariadb from hel chart, after problems with continuous deploy
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
.env
|
.env
|
||||||
localSettings
|
localSettings
|
||||||
archive
|
archive
|
||||||
|
tmp/**
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -12,6 +12,7 @@ Using [NextCloud](https://nextcloud.com/)
|
|||||||
- [delete file locks](#delete-file-locks)
|
- [delete file locks](#delete-file-locks)
|
||||||
- [Setup](#setup)
|
- [Setup](#setup)
|
||||||
- [Requirements - infra](#requirements---infra)
|
- [Requirements - infra](#requirements---infra)
|
||||||
|
- [mariadb database](#mariadb-database)
|
||||||
|
|
||||||
## command
|
## command
|
||||||
|
|
||||||
@@ -62,6 +63,9 @@ su -s /bin/bash www-data -c "php occ files:repair-tree"
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
- deploy mariadb
|
||||||
|
- nextcloud helm chart
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./ops-scripts/apply-app.sh
|
./ops-scripts/apply-app.sh
|
||||||
```
|
```
|
||||||
@@ -71,3 +75,20 @@ su -s /bin/bash www-data -c "php occ files:repair-tree"
|
|||||||
```bash
|
```bash
|
||||||
./ops-scripts/apply-infra.sh
|
./ops-scripts/apply-infra.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## mariadb database
|
||||||
|
|
||||||
|
**Connect to maria db:**
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
kubectl exec -it nextcloud-mariadb-0 -- mariadb -u nextcloud -h nextcloud-mariadb.cloud-limbosolutions-com.svc.cluster.local -p
|
||||||
|
```
|
||||||
|
|
||||||
|
**Restore database:**
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
kubectl run mysql-client -i --rm \
|
||||||
|
--image=mysql:latest --restart=Never -- \
|
||||||
|
mysql -h nextcloud-mariadb.cloud-limbosolutions-com.svc.cluster.local \
|
||||||
|
-u ???? -p???? nextcloud < ./tmp/host-nextcloud-full-backup.sql
|
||||||
|
```
|
||||||
|
|||||||
@@ -35,26 +35,23 @@ spec:
|
|||||||
- name: MYSQL_USER
|
- name: MYSQL_USER
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: nextcloud-db
|
name: nextcloud-mariadb
|
||||||
key: db-username
|
key: MARIADB_USER
|
||||||
|
|
||||||
- name: MYSQL_PWD
|
- name: MYSQL_PWD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: nextcloud-db
|
name: nextcloud-mariadb
|
||||||
key: db-password
|
key: MARIADB_PASSWORD
|
||||||
|
|
||||||
- name: MYSQL_DB
|
- name: MYSQL_DB
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: backup-secret
|
name: nextcloud-mariadb
|
||||||
key: DB_NAME
|
key: MARIADB_DATABASE
|
||||||
|
|
||||||
- name: MYSQL_HOST
|
- name: MYSQL_HOST
|
||||||
valueFrom:
|
value: nextcloud-mariadb.cloud-limbosolutions-com.svc.cluster.local
|
||||||
secretKeyRef:
|
|
||||||
name: backup-secret
|
|
||||||
key: DB_HOST
|
|
||||||
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: backup-var
|
- name: backup-var
|
||||||
@@ -122,7 +119,7 @@ spec:
|
|||||||
|
|
||||||
- name: db-data
|
- name: db-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: data-nextcloud-mariadb-0
|
claimName: mariadb-data-nextcloud-mariadb-0
|
||||||
|
|
||||||
- name: backup-var
|
- name: backup-var
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: backup-secret
|
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
data:
|
|
||||||
PBS_REPOSITORY: ${PBS_REPOSITORY}
|
|
||||||
PBS_PASSWORD: ${PBS_PASSWORD}
|
|
||||||
PBS_FINGERPRINT: ${PBS_FINGERPRINT}
|
|
||||||
DB_NAME: ${DB_NAME}
|
|
||||||
DB_HOST: ${DB_HOST}
|
|
||||||
# get sql client user and password from nextcloud secret
|
|
||||||
@@ -1,17 +1,19 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
|
||||||
- cronjobs/backups/backup-borg-offsite-cronjob.yaml
|
|
||||||
- cronjobs/backups/backup-pbs-cronjob.yaml
|
|
||||||
|
|
||||||
secretGenerator:
|
secretGenerator:
|
||||||
- name: gitea-backup
|
- name: nextcloud-mariadb
|
||||||
namespace: git-limbosolutions-com
|
|
||||||
envs:
|
envs:
|
||||||
- cronjobs/backups/.env.d/secrets
|
- ./.env.d/nextcloud-mariadb.secrets
|
||||||
files:
|
|
||||||
- BORG_KEY=cronjobs/backups/.env.d/borg_key
|
- name: backup-secret
|
||||||
- SSH_ID_RSA=cronjobs/backups/.env.d/id_rsa
|
envs:
|
||||||
|
- ./.env.d/pbs.secrets
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ./mariadb-deploy.yaml
|
||||||
|
- ./backup-cronjob.yaml
|
||||||
|
|
||||||
generatorOptions:
|
generatorOptions:
|
||||||
disableNameSuffixHash: true
|
disableNameSuffixHash: true
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
|||||||
69
deploy/app/mariadb-deploy.yaml
Normal file
69
deploy/app/mariadb-deploy.yaml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: nextcloud-mariadb
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
clusterIP: None
|
||||||
|
selector:
|
||||||
|
app: nextcloud-mariadb
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: 3306
|
||||||
|
targetPort: 3306
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: nextcloud-mariadb
|
||||||
|
spec:
|
||||||
|
serviceName: nextcloud-mariadb
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nextcloud-mariadb
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nextcloud-mariadb
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mariadb
|
||||||
|
image: mariadb:11.4
|
||||||
|
env:
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-mariadb
|
||||||
|
key: MARIADB_ROOT_PASSWORD
|
||||||
|
- name: MARIADB_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-mariadb
|
||||||
|
key: MARIADB_USER
|
||||||
|
- name: MARIADB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-mariadb
|
||||||
|
key: MARIADB_PASSWORD
|
||||||
|
- name: MARIADB_DATABASE
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-mariadb
|
||||||
|
key: MARIADB_DATABASE
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- containerPort: 3306
|
||||||
|
volumeMounts:
|
||||||
|
- name: mariadb-data
|
||||||
|
mountPath: /var/lib/mysql
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: mariadb-data
|
||||||
|
spec:
|
||||||
|
accessModes: ["ReadWriteOnce"]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
|
||||||
@@ -11,22 +11,17 @@ internalDatabase:
|
|||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
externalDatabase:
|
externalDatabase:
|
||||||
enabled: type
|
enabled: true
|
||||||
type: mysql
|
type: mysql
|
||||||
|
host: nextcloud-mariadb.cloud-limbosolutions-com.svc.cluster.local
|
||||||
|
user: "???"
|
||||||
|
password: "???"
|
||||||
|
database: "???"
|
||||||
|
port: 3306
|
||||||
|
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
enabled: true
|
enabled: false
|
||||||
architecture: standalone
|
|
||||||
|
|
||||||
primary:
|
|
||||||
persistence:
|
|
||||||
enabled: true
|
|
||||||
existingClaim: ""
|
|
||||||
storageClass: ""
|
|
||||||
accessMode: ReadWriteOnce
|
|
||||||
size: 8Gi
|
|
||||||
|
|
||||||
|
|
||||||
service:
|
service:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
set -e
|
set -e
|
||||||
echo "Executing app deploy."
|
echo "Executing app deploy."
|
||||||
|
|
||||||
#kubectl kustomize deploy/app | kubectl apply -f -
|
kubectl kustomize deploy/app | kubectl apply -f -
|
||||||
|
|
||||||
|
|
||||||
helm repo add nextcloud https://nextcloud.github.io/helm/ 2>/dev/null || true
|
helm repo add nextcloud https://nextcloud.github.io/helm/ 2>/dev/null || true
|
||||||
helm repo update nextcloud
|
helm repo update nextcloud
|
||||||
|
|
||||||
helm upgrade --install nextcloud nextcloud/nextcloud \
|
helm upgrade --install nextcloud nextcloud/nextcloud \
|
||||||
--values ./deploy/helm/values.yaml \
|
--values ./deploy/helm/values.yaml \
|
||||||
--values ./deploy/helm/values.local.yaml \
|
--values ./deploy/helm/values.local.yaml \
|
||||||
--namespace=cloud-limbosolutions-com
|
--namespace cloud-limbosolutions-com
|
||||||
|
|
||||||
Reference in New Issue
Block a user