Browse Source

Pruebas ML y PG

main
Celestino Rey 3 years ago
parent
commit
c2d12dea34
98 changed files with 2229 additions and 146 deletions
  1. +0
    -2
      Drupal/drupal-deployment.yaml
  2. +101
    -0
      Drupal/drupal-deployment.yaml.NodePort
  3. +18
    -0
      Drupal/ingress.yaml
  4. +59
    -0
      Https/app.yaml
  5. +0
    -4
      Https/borra.sh
  6. +0
    -16
      Https/configmap.yaml
  7. +0
    -6
      Https/crea.sh
  8. +1
    -0
      Https/creaCertManager.sh
  9. +0
    -33
      Https/deployment.yaml
  10. +0
    -52
      Https/ejemplo.yaml
  11. +0
    -17
      Https/ingress.yaml
  12. +23
    -0
      Https/nginx-ingress.yaml
  13. +15
    -0
      Https/nginx-issuer.yaml
  14. +0
    -12
      Https/service.yaml
  15. +2
    -0
      Mastodon/creaTodo.sh
  16. +1
    -0
      Mastodon/entra.sh
  17. +7
    -0
      Mastodon/kube_service_create.sh
  18. +12
    -0
      Mastodon/kustomization.yaml
  19. +4
    -0
      Mastodon/namespace.yaml
  20. +1
    -0
      Mastodon/paraTodo.sh
  21. +49
    -0
      Mastodon/pgadmin.yaml
  22. +68
    -0
      Mastodon/postgresql-deployment.yaml
  23. +11
    -0
      Mastodon/pv-local-pgsql.yaml
  24. +1
    -0
      Metallb/borraML.sh
  25. +1
    -0
      Metallb/borraNginsIngres.sh
  26. +4
    -0
      Metallb/creaML.sh
  27. +1
    -0
      Metallb/creaNginxIngress.sh
  28. +1
    -0
      Metallb/describeIngress.sh
  29. +25
    -0
      Metallb/pruebas/apple.yaml
  30. +25
    -0
      Metallb/pruebas/banana.yaml
  31. +0
    -0
      Metallb/pruebas/creaNginx.sh
  32. +31
    -0
      Metallb/pruebas/rutas.yaml
  33. +1
    -0
      Metallb/verDNSIngress.sh
  34. +1
    -0
      NextCloud/describeIngress.sh
  35. +20
    -0
      NextCloud/ingress.yaml
  36. +48
    -0
      NextCloud/nextcloud-deployment.yaml.NodePort
  37. +17
    -0
      Nginx/ingress.yaml
  38. +4
    -4
      Nginx/miweb-deployment.yaml
  39. +60
    -0
      Nginx/miweb-deployment.yaml.LoadB
  40. +62
    -0
      Nginx/miweb-deployment.yaml.copia
  41. +3
    -0
      NginxIngress/creaTodo.sh
  42. +1
    -0
      NginxIngress/entra.sh
  43. +16
    -0
      NginxIngress/ingress.yaml
  44. +3
    -0
      NginxIngress/kustomization.yaml
  45. +62
    -0
      NginxIngress/miweb-deployment.yaml
  46. +60
    -0
      NginxIngress/miweb-deployment.yaml.LoadB
  47. +62
    -0
      NginxIngress/miweb-deployment.yaml.copia
  48. +63
    -0
      NginxIngress/miweb-https-deployment.yaml
  49. +2
    -0
      NginxIngress/paraTodo.sh
  50. +20
    -0
      NginxIngress/pod.yaml
  51. +11
    -0
      NginxIngress/pv-local-nginx.yaml
  52. +12
    -0
      NginxIngress/pv-nginx.yaml
  53. +13
    -0
      NginxIngress/pvc-nginx.yaml
  54. +11
    -0
      NginxIngress/service-loadbalancer.yaml
  55. +13
    -0
      NginxIngress/service-nodeport.yaml
  56. +1
    -0
      Wordpress/describeIngress.sh
  57. +18
    -0
      Wordpress/ingress.yaml
  58. +76
    -0
      Wordpress/wordpress-deployment.yaml.Ingress
  59. +78
    -0
      Wordpress/wordpress-deployment.yaml.sinIngress
  60. +18
    -0
      Wordpress/wp-ingress.yaml
  61. +14
    -0
      WordpressIngress/Papelera/pvc-nginx.yaml
  62. +14
    -0
      WordpressIngress/Papelera/pvc-wordpress.yaml
  63. +4
    -0
      WordpressIngress/creaTodo.sh
  64. +1
    -0
      WordpressIngress/describeIngress.sh
  65. +1
    -0
      WordpressIngress/entra.sh
  66. +17
    -0
      WordpressIngress/index.php
  67. +12
    -0
      WordpressIngress/kustomization.yaml
  68. +68
    -0
      WordpressIngress/mysql-deployment.yaml
  69. +3
    -0
      WordpressIngress/paraTodo.sh
  70. +54
    -0
      WordpressIngress/php-deployment.yaml
  71. +11
    -0
      WordpressIngress/pv-local-mysql.yaml
  72. +12
    -0
      WordpressIngress/pv-local-wordpress.yaml
  73. +76
    -0
      WordpressIngress/wordpress-deployment.yaml
  74. +78
    -0
      WordpressIngress/wordpress-deployment.yaml.sinIngress
  75. +26
    -0
      WordpressIngress/wp-ingress.yaml
  76. +4
    -0
      WordpressIngress/wp-namespace.yaml
  77. +13
    -0
      ownCloud/Readme.md
  78. +71
    -0
      ownCloud/compose/docker-compose.yml
  79. +14
    -0
      ownCloud/compose/files-persistentvolumeclaim.yaml
  80. +62
    -0
      ownCloud/compose/mariadb-deployment.yaml
  81. +14
    -0
      ownCloud/compose/mysql-persistentvolumeclaim.yaml
  82. +71
    -0
      ownCloud/compose/owncloud-deployment.yaml
  83. +19
    -0
      ownCloud/compose/owncloud-service.yaml
  84. +50
    -0
      ownCloud/compose/redis-deployment.yaml
  85. +14
    -0
      ownCloud/compose/redis-persistentvolumeclaim.yaml
  86. +4
    -0
      ownCloud/creaTodo.sh
  87. +1
    -0
      ownCloud/entra.sh
  88. +21
    -0
      ownCloud/environment
  89. +12
    -0
      ownCloud/kustomization.yaml
  90. +68
    -0
      ownCloud/mysql-deployment.yaml
  91. +4
    -0
      ownCloud/oc-namespace.yaml
  92. +10
    -0
      ownCloud/oc-secret.yaml
  93. +61
    -0
      ownCloud/owncloud-deployment.yaml
  94. +3
    -0
      ownCloud/paraTodo.sh
  95. +54
    -0
      ownCloud/php-deployment.yaml
  96. +11
    -0
      ownCloud/pv-local-mysql.yaml
  97. +11
    -0
      ownCloud/pv-local-owncloud.yaml
  98. +29
    -0
      ownCloud/syncNC2LaCie

+ 0
- 2
Drupal/drupal-deployment.yaml View File

@ -6,10 +6,8 @@ metadata:
labels:
app: drupal
spec:
type: NodePort
ports:
- port: 80
nodePort: 30898
targetPort: drupal
selector:
app: drupal


+ 101
- 0
Drupal/drupal-deployment.yaml.NodePort View File

@ -0,0 +1,101 @@
apiVersion: v1
kind: Service
metadata:
name: drupal
namespace: drupal
labels:
app: drupal
spec:
type: NodePort
ports:
- port: 80
nodePort: 30898
targetPort: drupal
selector:
app: drupal
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: drupal-pv-claim
namespace: drupal
labels:
app: drupal
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: drupal
namespace: drupal
labels:
app: drupal
spec:
selector:
matchLabels:
app: drupal
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: drupal
tier: frontend
spec:
initContainers:
-
name: init-sites-volume
image: drupal:latest
command: ['/bin/bash', '-c']
args: ['cp -r /var/www/html/sites/ /data/; chown www-data:www-data /data/ -R']
volumeMounts:
- mountPath: /data
name: drupal-persistent-storage
containers:
- image: drupal:latest
name: drupal
env:
- name: DB_TYPE
value: mysql
- name: DB_NAME
value: drupal
- name: DB_HOST
value: drupal-mysql
- name: DB_PASS
valueFrom:
secretKeyRef:
name: mysqldrupal-pass
key: password
- name: DB_USER
valueFrom:
secretKeyRef:
name: mysqldrupal-pass
key: db_user
ports:
- containerPort: 80
name: drupal
volumeMounts:
- name: drupal-persistent-storage
mountPath: /var/www/html/modules
subPath: modules
- name: drupal-persistent-storage
mountPath: /var/www/html/profiles
subPath: profiles
- name: drupal-persistent-storage
mountPath: /var/www/html/sites
subPath: sites
- name: drupal-persistent-storage
mountPath: /var/www/html/themes
subPath: themes
volumes:
- name: drupal-persistent-storage
persistentVolumeClaim:
claimName: drupal-pv-claim

+ 18
- 0
Drupal/ingress.yaml View File

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: drupal-ingress
namespace: drupal
spec:
ingressClassName: nginx
rules:
- host: "reymota.ddns.net"
http:
paths:
- pathType: Prefix
path: "/drupal"
backend:
service:
name: drupal
port:
number: 80

+ 59
- 0
Https/app.yaml View File

@ -0,0 +1,59 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt"
spec:
tls:
- hosts:
- reymota.ddns.net
secretName: letsencrypt
rules:
- host: reymota.ddns.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: app
port:
number: 80
---
apiVersion: v1
kind: Service
metadata:
name: app
spec:
selector:
app: app
type: NodePort
ports:
- name: http
port: 80
nodePort: 30580
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
labels:
app: app
spec:
replicas: 1
selector:
matchLabels:
app: app
template:
metadata:
labels:
app: app
spec:
containers:
- name: app
image: nginx:latest
ports:
- containerPort: 80

+ 0
- 4
Https/borra.sh View File

@ -1,4 +0,0 @@
kubectl delete -f configmap.yaml
kubectl delete -f deployment.yaml
kubectl delete -f service.yaml
kubectl delete -f ingress.yaml

+ 0
- 16
Https/configmap.yaml View File

@ -1,16 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: https-config
data:
default.conf: |
server {
listen 80;
listen [::]:80;
server_name _;
location / {
add_header Content-Type text/plain; # Prevents download
return 200 "¡Hola mundo! Demo de Kubernetes + Let's encrypt.";
}
}

+ 0
- 6
Https/crea.sh View File

@ -1,6 +0,0 @@
kubectl create -f configmap.yaml
kubectl create -f deployment.yaml
kubectl create -f service.yaml
kubectl create -f ingress.yaml
watch kubectl get all
kubectl describe ing kubernetes-demo-app-ingress-service

+ 1
- 0
Https/creaCertManager.sh View File

@ -0,0 +1 @@
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.0/cert-manager.yaml

+ 0
- 33
Https/deployment.yaml View File

@ -1,33 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: https
labels:
app: https
spec:
selector:
matchLabels:
app: https
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: https
tier: frontend
spec:
containers:
- image: nginx
name: https
ports:
- containerPort: 80
volumeMounts:
- name: https-configs
mountPath: /etc/nginx/conf.d
# Load the configuration files for nginx
volumes:
- name: https-configs
configMap:
name: https-config

+ 0
- 52
Https/ejemplo.yaml View File

@ -1,52 +0,0 @@
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.";
}
---
apiVersion: v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
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
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
app: nginx
ports:
- protocol: "TCP"
port: 80

+ 0
- 17
Https/ingress.yaml View File

@ -1,17 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "kubernetes-demo-app-ingress-service"
spec:
rules:
- host: kubernetes-letsencrypt.jorge.fail
http:
paths:
# The * is needed so that all traffic gets redirected to nginx
- path: /*
pathType: Prefix
backend:
service:
name: https
port:
number: 80

+ 23
- 0
Https/nginx-ingress.yaml View File

@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt"
spec:
tls:
- hosts:
- reymota.ddns.net
secretName: letsencrypt
rules:
- host: reymota.ddns.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-example
port:
number: 443

+ 15
- 0
Https/nginx-issuer.yaml View File

@ -0,0 +1,15 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt
namespace: cert-manager
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: celestino.rey@gmail.com
privateKeySecretRef:
name: letsencrypt
solvers:
- http01:
ingress:
class: nginx

+ 0
- 12
Https/service.yaml View File

@ -1,12 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: https
spec:
selector:
app: https
type: NodePort
ports:
- protocol: "TCP"
port: 80
nodePort: 30058

+ 2
- 0
Mastodon/creaTodo.sh View File

@ -0,0 +1,2 @@
kubectl create -k ./
watch kubectl get all -n mastodon

+ 1
- 0
Mastodon/entra.sh View File

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

+ 7
- 0
Mastodon/kube_service_create.sh View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
kubectl create -f pgadmin.yaml
sleep 15s
kubectl logs pgadmin-76gjgvvjh-yghg
## Access pgAdmin
## https://<IP>:31560
## username/password: user@e-mail.com / password

+ 12
- 0
Mastodon/kustomization.yaml View File

@ -0,0 +1,12 @@
secretGenerator:
- name: pgsql-pass
namespace: mastodon
literals:
- password=Dsa-0213
- db_user=root
- db_passwd=Dsa-0213
resources:
- pv-local-pgsql.yaml
- namespace.yaml
- postgresql-deployment.yaml
- pgadmin.yaml

+ 4
- 0
Mastodon/namespace.yaml View File

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

+ 1
- 0
Mastodon/paraTodo.sh View File

@ -0,0 +1 @@
kubectl delete -k ./

+ 49
- 0
Mastodon/pgadmin.yaml View File

@ -0,0 +1,49 @@
---
apiVersion: v1
kind: Service
metadata:
labels:
app: pgadmin
name: pgadmin
namespace: mastodon
spec:
ports:
- name: padmin-port
nodePort: 30165
port: 80
targetPort: 80
selector:
app: pgadmin
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pgadmin
namespace: mastodon
spec:
replicas: 1
selector:
matchLabels:
app: pgadmin
template:
metadata:
labels:
app: pgadmin
spec:
containers:
- env:
- name: PGADMIN_DEFAULT_EMAIL
value: celestino.rey@gmail.com
- name: PGADMIN_DEFAULT_PASSWORD
value: Rey-1176
- name: PGADMIN_PORT
value: "80"
image: dpage/pgadmin4:3.6
imagePullPolicy: IfNotPresent
name: pgadmin
ports:
- containerPort: 80
resources:
limits:
memory: 4096Mi

+ 68
- 0
Mastodon/postgresql-deployment.yaml View File

@ -0,0 +1,68 @@
apiVersion: v1
kind: Service
metadata:
name: mastodon-pgsql
namespace: mastodon
labels:
app: mastodon
spec:
type: NodePort
ports:
- port: 5432
name: pgsql
nodePort: 30798
targetPort: pgsql
selector:
app: mastodon
tier: pgsql
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pgsql-pv-claim
namespace: mastodon
labels:
app: mastodon
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mastodon-pgsql
namespace: mastodon
labels:
app: mastodon
spec:
selector:
matchLabels:
app: mastodon
tier: pgsql
strategy:
type: Recreate
template:
metadata:
labels:
app: mastodon
tier: pgsql
spec:
containers:
- image: postgres
name: pgsql
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: pgsql-pass
key: password
volumeMounts:
- name: pgsql-persistent-storage
mountPath: /var/lib/postgresql/data
volumes:
- name: pgsql-persistent-storage
persistentVolumeClaim:
claimName: pgsql-pv-claim

+ 11
- 0
Mastodon/pv-local-pgsql.yaml View File

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

+ 1
- 0
Metallb/borraML.sh View File

@ -0,0 +1 @@
kubectl delete -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml

+ 1
- 0
Metallb/borraNginsIngres.sh View File

@ -0,0 +1 @@
kubectl delete -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.5.1/deploy/static/provider/cloud/deploy.yaml

+ 4
- 0
Metallb/creaML.sh View File

@ -0,0 +1,4 @@
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml
watch kubectl get all -n metallb-system
kubectl apply -f ipaddresspool.yaml
kubectl apply -f announceips.yaml

+ 1
- 0
Metallb/creaNginxIngress.sh View File

@ -0,0 +1 @@
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.5.1/deploy/static/provider/cloud/deploy.yaml

+ 1
- 0
Metallb/describeIngress.sh View File

@ -0,0 +1 @@
kubectl describe ingress.networking.k8s.io nginx-ingress

+ 25
- 0
Metallb/pruebas/apple.yaml View File

@ -0,0 +1,25 @@
kind: Pod
apiVersion: v1
metadata:
name: apple-app
labels:
app: apple
spec:
containers:
- name: apple-app
image: hashicorp/http-echo
args:
- "-text=apple"
---
kind: Service
apiVersion: v1
metadata:
name: apple-service
spec:
type: LoadBalancer
selector:
app: apple
ports:
- port: 5678 # Default port for image

+ 25
- 0
Metallb/pruebas/banana.yaml View File

@ -0,0 +1,25 @@
kind: Pod
apiVersion: v1
metadata:
name: banana-app
labels:
app: banana
spec:
containers:
- name: banana-app
image: hashicorp/http-echo
args:
- "-text=banana"
---
kind: Service
apiVersion: v1
metadata:
name: banana-service
spec:
type: LoadBalancer
selector:
app: banana
ports:
- port: 5678 # Default port for image

Metallb/creaNginx.sh → Metallb/pruebas/creaNginx.sh View File


+ 31
- 0
Metallb/pruebas/rutas.yaml View File

@ -0,0 +1,31 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /apple
pathType: Prefix
backend:
service:
name: apple-service
port:
number: 5678
- path: /banana
pathType: Prefix
backend:
service:
name: banana-service
port:
number: 5678
- path: /wordpress
pathType: Prefix
backend:
service:
name: wordpress
port:
number: 80

+ 1
- 0
Metallb/verDNSIngress.sh View File

@ -0,0 +1 @@
kubectl --namespace ingress-nginx get services -o wide

+ 1
- 0
NextCloud/describeIngress.sh View File

@ -0,0 +1 @@
kubectl describe ingress.networking.k8s.io nextcloud-ingress -n nextcloud

+ 20
- 0
NextCloud/ingress.yaml View File

@ -0,0 +1,20 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nextcloud-ingress
namespace: nextcloud
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: nginx
rules:
- host: "reymota.ddns.net"
http:
paths:
- pathType: Prefix
path: "/nextcloud"
backend:
service:
name: nextcloud-server
port:
number: 80

+ 48
- 0
NextCloud/nextcloud-deployment.yaml.NodePort View File

@ -0,0 +1,48 @@
apiVersion: v1
kind: Service
metadata:
name: nextcloud-server
namespace: nextcloud
labels:
app: nextcloud
spec:
selector:
pod-label: nextcloud-server-pod
type: NodePort
ports:
- port: 80
nodePort: 30289
targetPort: nextcloud
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nextcloud-server
namespace: nextcloud
labels:
app: nextcloud
spec:
replicas: 1
selector:
matchLabels:
pod-label: nextcloud-server-pod
template:
metadata:
labels:
pod-label: nextcloud-server-pod
spec:
containers:
- name: nextcloud
image: nextcloud
volumeMounts:
- name: server-storage
mountPath: /var/www/html
subPath: server-data
ports:
- containerPort: 80
name: nextcloud
volumes:
- name: server-storage
persistentVolumeClaim:
claimName: dbnc-pv-claim

+ 17
- 0
Nginx/ingress.yaml View File

@ -0,0 +1,17 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: reymota-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /nginx
pathType: Prefix
backend:
service:
name: nginx-example
port:
number: 80

+ 4
- 4
Nginx/miweb-deployment.yaml View File

@ -47,15 +47,15 @@ spec:
spec:
containers:
- name: nginx
#image: linuxserver/nginx
image: httpd
image: linuxserver/nginx
#image: httpd
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
# mountPath: /config/www
mountPath: /usr/local/apache2/htdocs
mountPath: /config/www
#mountPath: /usr/local/apache2/htdocs
volumes:
- name: nginx-www-folder
persistentVolumeClaim:


+ 60
- 0
Nginx/miweb-deployment.yaml.LoadB View File

@ -0,0 +1,60 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-example
spec:
type: LoadBalancer
ports:
- name: http
port: 80
selector:
app: nginx
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-example
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: nginx
tier: frontend
spec:
containers:
- name: nginx
#image: linuxserver/nginx
image: httpd
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
# mountPath: /config/www
mountPath: /usr/local/apache2/htdocs
volumes:
- name: nginx-www-folder
persistentVolumeClaim:
claimName: nginx-pv-claim

+ 62
- 0
Nginx/miweb-deployment.yaml.copia View File

@ -0,0 +1,62 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-example
spec:
type: NodePort
ports:
- name: http
port: 80
nodePort: 30080
targetPort: nginx-http
selector:
app: nginx
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-example
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: nginx
tier: frontend
spec:
containers:
- name: nginx
#image: linuxserver/nginx
image: httpd
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
# mountPath: /config/www
mountPath: /usr/local/apache2/htdocs
volumes:
- name: nginx-www-folder
persistentVolumeClaim:
claimName: nginx-pv-claim

+ 3
- 0
NginxIngress/creaTodo.sh View File

@ -0,0 +1,3 @@
kubectl create -f pv-local-nginx.yaml
kubectl create -k ./
#watch kubectl get all

+ 1
- 0
NginxIngress/entra.sh View File

@ -0,0 +1 @@
kubectl exec -ti deployment.apps/nginx-crey -- /bin/bash

+ 16
- 0
NginxIngress/ingress.yaml View File

@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
spec:
ingressClassName: nginx
rules:
- http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: nginx-crey
port:
number: 80

+ 3
- 0
NginxIngress/kustomization.yaml View File

@ -0,0 +1,3 @@
resources:
- miweb-deployment.yaml
- ingress.yaml

+ 62
- 0
NginxIngress/miweb-deployment.yaml View File

@ -0,0 +1,62 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-crey
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: nginx-http
protocol: TCP
selector:
app: nginx
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-crey
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: nginx
tier: frontend
spec:
containers:
- name: nginx
image: linuxserver/nginx
#image: httpd
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
mountPath: /config/www
#mountPath: /usr/local/apache2/htdocs
volumes:
- name: nginx-www-folder
persistentVolumeClaim:
claimName: nginx-pv-claim

+ 60
- 0
NginxIngress/miweb-deployment.yaml.LoadB View File

@ -0,0 +1,60 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-example
spec:
type: LoadBalancer
ports:
- name: http
port: 80
selector:
app: nginx
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-example
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: nginx
tier: frontend
spec:
containers:
- name: nginx
#image: linuxserver/nginx
image: httpd
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
# mountPath: /config/www
mountPath: /usr/local/apache2/htdocs
volumes:
- name: nginx-www-folder
persistentVolumeClaim:
claimName: nginx-pv-claim

+ 62
- 0
NginxIngress/miweb-deployment.yaml.copia View File

@ -0,0 +1,62 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-example
spec:
type: NodePort
ports:
- name: http
port: 80
nodePort: 30080
targetPort: nginx-http
selector:
app: nginx
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-example
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: nginx
tier: frontend
spec:
containers:
- name: nginx
#image: linuxserver/nginx
image: httpd
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
# mountPath: /config/www
mountPath: /usr/local/apache2/htdocs
volumes:
- name: nginx-www-folder
persistentVolumeClaim:
claimName: nginx-pv-claim

+ 63
- 0
NginxIngress/miweb-https-deployment.yaml View File

@ -0,0 +1,63 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-example
spec:
type: NodePort
ports:
- name: http
port: 80
nodePort: 30080
targetPort: nginx-http
selector:
app: nginx
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-example
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: nginx
tier: frontend
spec:
containers:
- name: nginx
image: steveltn/https-portal:1
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
mountPath: /config/www
env:
- name: DOMAINS
value: 'reymota.ddns.net -> http://nginx:80'
volumes:
- name: nginx-www-folder
persistentVolumeClaim:
claimName: nginx-pv-claim

+ 2
- 0
NginxIngress/paraTodo.sh View File

@ -0,0 +1,2 @@
kubectl delete -k ./
kubectl delete -f pv-local-nginx.yaml

+ 20
- 0
NginxIngress/pod.yaml View File

@ -0,0 +1,20 @@
apiVersion: v1
kind: Pod
metadata:
name: nginx-example
labels:
app: nginx
spec:
containers:
- name: nginx
image: linuxserver/nginx
ports:
- containerPort: 80
name: "nginx-http"
volumeMounts:
- name: nginx-www-folder
mountPath: /config/www
volumes:
- name: nginx-www-folder
persistentVolumeClaim:
claimName: nginx-pv-claim

+ 11
- 0
NginxIngress/pv-local-nginx.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: www-nginx-folder
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/cluster/nginx"

+ 12
- 0
NginxIngress/pv-nginx.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: www-nginx-folder
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
nfs:
server: k8s-router
path: "/media/discoexterno/nginx"

+ 13
- 0
NginxIngress/pvc-nginx.yaml View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi

+ 11
- 0
NginxIngress/service-loadbalancer.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-lb
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: nginx-http
selector:
app: nginx

+ 13
- 0
NginxIngress/service-nodeport.yaml View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-example
spec:
type: NodePort
ports:
- name: http
port: 80
nodePort: 30080
targetPort: nginx-http
selector:
app: nginx

+ 1
- 0
Wordpress/describeIngress.sh View File

@ -0,0 +1 @@
kubectl describe ingress.networking.k8s.io wordpress-ingress -n wordpress

+ 18
- 0
Wordpress/ingress.yaml View File

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: wordpress-ingress
namespace: wordpress
spec:
ingressClassName: nginx
rules:
- host: "reymota.ddns.net"
http:
paths:
- pathType: Prefix
path: "/wordpress"
backend:
service:
name: wordpress
port:
number: 80

+ 76
- 0
Wordpress/wordpress-deployment.yaml.Ingress View File

@ -0,0 +1,76 @@
apiVersion: v1
kind: Service
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
ports:
- port: 80
targetPort: wordpress
selector:
app: wordpress
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pv-claim
namespace: wordpress
labels:
app: wordpress
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: frontend
spec:
containers:
- image: wordpress:5.7.2-php7.4-apache
name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: wordpress-mysql
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: password
- name: WORDPRESS_DB_USER
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: db_user
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: wordpress-persistent-storage
mountPath: /var/www/html
volumes:
- name: wordpress-persistent-storage
persistentVolumeClaim:
claimName: wp-pv-claim

+ 78
- 0
Wordpress/wordpress-deployment.yaml.sinIngress View File

@ -0,0 +1,78 @@
apiVersion: v1
kind: Service
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
type: NodePort
ports:
- port: 80
nodePort: 30088
targetPort: wordpress
selector:
app: wordpress
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pv-claim
namespace: wordpress
labels:
app: wordpress
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: frontend
spec:
containers:
- image: wordpress:5.7.2-php7.4-apache
name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: wordpress-mysql
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: password
- name: WORDPRESS_DB_USER
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: db_user
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: wordpress-persistent-storage
mountPath: /var/www/html
volumes:
- name: wordpress-persistent-storage
persistentVolumeClaim:
claimName: wp-pv-claim

+ 18
- 0
Wordpress/wp-ingress.yaml View File

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: wordpress-ingress
namespace: wordpress
annotations:
ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: wordpress
port:
number: 80

+ 14
- 0
WordpressIngress/Papelera/pvc-nginx.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nginx-pv-claim
namespace: wordpress
labels:
app: nginx
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi

+ 14
- 0
WordpressIngress/Papelera/pvc-wordpress.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pv-claim
namespace: wordpress
labels:
app: wordpress
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 20Gi

+ 4
- 0
WordpressIngress/creaTodo.sh View File

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

+ 1
- 0
WordpressIngress/describeIngress.sh View File

@ -0,0 +1 @@
kubectl describe ingress.networking.k8s.io wordpress -n wordpress

+ 1
- 0
WordpressIngress/entra.sh View File

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

+ 17
- 0
WordpressIngress/index.php View File

@ -0,0 +1,17 @@
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';

+ 12
- 0
WordpressIngress/kustomization.yaml View File

@ -0,0 +1,12 @@
secretGenerator:
- name: mysqlwp-pass
namespace: wordpress
literals:
- password=Dsa-0213
- db_user=root
- db_passwd=Dsa-0213
resources:
- wp-namespace.yaml
- mysql-deployment.yaml
- wordpress-deployment.yaml
- php-deployment.yaml

+ 68
- 0
WordpressIngress/mysql-deployment.yaml View File

@ -0,0 +1,68 @@
apiVersion: v1
kind: Service
metadata:
name: wordpress-mysql
namespace: wordpress
labels:
app: wordpress
spec:
ports:
- port: 3306
selector:
app: wordpress
tier: mysql
clusterIP: None
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-wp-pv-claim
namespace: wordpress
labels:
app: wordpress
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress-mysql
namespace: wordpress
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: mysql
spec:
containers:
- image: mariadb
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlwp-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-wp-pv-claim

+ 3
- 0
WordpressIngress/paraTodo.sh View File

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

+ 54
- 0
WordpressIngress/php-deployment.yaml View File

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

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

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

+ 12
- 0
WordpressIngress/pv-local-wordpress.yaml View File

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

+ 76
- 0
WordpressIngress/wordpress-deployment.yaml View File

@ -0,0 +1,76 @@
apiVersion: v1
kind: Service
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
ports:
- port: 80
targetPort: wordpress
selector:
app: wordpress
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pv-claim
namespace: wordpress
labels:
app: wordpress
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: frontend
spec:
containers:
- image: wordpress:5.7.2-php7.4-apache
name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: wordpress-mysql
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: password
- name: WORDPRESS_DB_USER
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: db_user
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: wordpress-persistent-storage
mountPath: /var/www/html
volumes:
- name: wordpress-persistent-storage
persistentVolumeClaim:
claimName: wp-pv-claim

+ 78
- 0
WordpressIngress/wordpress-deployment.yaml.sinIngress View File

@ -0,0 +1,78 @@
apiVersion: v1
kind: Service
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
type: NodePort
ports:
- port: 80
nodePort: 30088
targetPort: wordpress
selector:
app: wordpress
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pv-claim
namespace: wordpress
labels:
app: wordpress
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress
namespace: wordpress
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: frontend
spec:
containers:
- image: wordpress:5.7.2-php7.4-apache
name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: wordpress-mysql
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: password
- name: WORDPRESS_DB_USER
valueFrom:
secretKeyRef:
name: mysqlwp-pass
key: db_user
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: wordpress-persistent-storage
mountPath: /var/www/html
volumes:
- name: wordpress-persistent-storage
persistentVolumeClaim:
claimName: wp-pv-claim

+ 26
- 0
WordpressIngress/wp-ingress.yaml View File

@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
name: wordpress
namespace: wordpress
spec:
ingressClassName: nginx
rules:
- http:
paths:
- pathType: Prefix
path: /wordpress(/|$)(.*)
backend:
service:
name: wordpress
port:
number: 80
- pathType: Prefix
path: /wp-admin(/|$)(.*)
backend:
service:
name: wordpress
port:
number: 80

+ 4
- 0
WordpressIngress/wp-namespace.yaml View File

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

+ 13
- 0
ownCloud/Readme.md View File

@ -0,0 +1,13 @@
# Nextcloud
para que funcione hay que dar permisos al directorio para www-data:www-data.
El nombre del directorio está definido en
nextcloud-deployment.yaml: subPath: server-data
y este está alojado dentro del directorio definido en el volumen persistente.
En micaso en
pi@k8s-router:/media/discoexterno/owncloud/server-data $

+ 71
- 0
ownCloud/compose/docker-compose.yml View File

@ -0,0 +1,71 @@
version: "3"
volumes:
files:
driver: local
mysql:
driver: local
redis:
driver: local
services:
owncloud:
image: owncloud/server:${OWNCLOUD_VERSION}
container_name: owncloud_server
restart: always
ports:
- ${HTTP_PORT}:8080
depends_on:
- mariadb
- redis
environment:
- OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
- OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS}
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=owncloud
- OWNCLOUD_DB_HOST=mariadb
- OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
- OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- OWNCLOUD_MYSQL_UTF8MB4=true
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=redis
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- files:/mnt/data
mariadb:
image: mariadb:10.6 # minimum required ownCloud version is 10.9
container_name: owncloud_mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=owncloud
- MYSQL_USER=owncloud
- MYSQL_PASSWORD=owncloud
- MYSQL_DATABASE=owncloud
command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- mysql:/var/lib/mysql
redis:
image: redis:6
container_name: owncloud_redis
restart: always
command: ["--databases", "1"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- redis:/data

+ 14
- 0
ownCloud/compose/files-persistentvolumeclaim.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: files
name: files
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

+ 62
- 0
ownCloud/compose/mariadb-deployment.yaml View File

@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: mariadb
name: mariadb
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: mariadb
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: mariadb
spec:
containers:
- args:
- --max-allowed-packet=128M
- --innodb-log-file-size=64M
env:
- name: MYSQL_DATABASE
value: owncloud
- name: MYSQL_PASSWORD
value: owncloud
- name: MYSQL_ROOT_PASSWORD
value: owncloud
- name: MYSQL_USER
value: owncloud
image: mariadb:10.6
livenessProbe:
exec:
command:
- mysqladmin
- ping
- -u
- root
- --password=owncloud
failureThreshold: 5
periodSeconds: 10
timeoutSeconds: 5
name: owncloud-mariadb
resources: {}
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql
restartPolicy: Always
volumes:
- name: mysql
persistentVolumeClaim:
claimName: mysql
status: {}

+ 14
- 0
ownCloud/compose/mysql-persistentvolumeclaim.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: mysql
name: mysql
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

+ 71
- 0
ownCloud/compose/owncloud-deployment.yaml View File

@ -0,0 +1,71 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: owncloud
name: owncloud
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: owncloud
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: owncloud
spec:
containers:
- env:
- name: OWNCLOUD_ADMIN_PASSWORD
value: Dsa-0213
- name: OWNCLOUD_ADMIN_USERNAME
value: tino
- name: OWNCLOUD_DB_HOST
value: mariadb
- name: OWNCLOUD_DB_NAME
value: owncloud
- name: OWNCLOUD_DB_PASSWORD
value: owncloud
- name: OWNCLOUD_DB_TYPE
value: mysql
- name: OWNCLOUD_DB_USERNAME
value: owncloud
- name: OWNCLOUD_DOMAIN
- name: OWNCLOUD_MYSQL_UTF8MB4
value: "true"
- name: OWNCLOUD_REDIS_ENABLED
value: "true"
- name: OWNCLOUD_REDIS_HOST
value: redis
- name: OWNCLOUD_TRUSTED_DOMAINS
image: 'owncloud/server:'
livenessProbe:
exec:
command:
- /usr/bin/healthcheck
failureThreshold: 5
periodSeconds: 30
timeoutSeconds: 10
name: owncloud-server
ports:
- containerPort: 8080
resources: {}
volumeMounts:
- mountPath: /mnt/data
name: files
restartPolicy: Always
volumes:
- name: files
persistentVolumeClaim:
claimName: files
status: {}

+ 19
- 0
ownCloud/compose/owncloud-service.yaml View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: owncloud
name: owncloud
spec:
ports:
- name: "8080"
port: 8080
targetPort: 8080
selector:
io.kompose.service: owncloud
status:
loadBalancer: {}

+ 50
- 0
ownCloud/compose/redis-deployment.yaml View File

@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: redis
name: redis
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: redis
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: redis
spec:
containers:
- args:
- --databases
- "1"
image: redis:6
livenessProbe:
exec:
command:
- redis-cli
- ping
failureThreshold: 5
periodSeconds: 10
timeoutSeconds: 5
name: owncloud-redis
resources: {}
volumeMounts:
- mountPath: /data
name: redis
restartPolicy: Always
volumes:
- name: redis
persistentVolumeClaim:
claimName: redis
status: {}

+ 14
- 0
ownCloud/compose/redis-persistentvolumeclaim.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: redis
name: redis
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

+ 4
- 0
ownCloud/creaTodo.sh View File

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

+ 1
- 0
ownCloud/entra.sh View File

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

+ 21
- 0
ownCloud/environment View File

@ -0,0 +1,21 @@
- env:
- name: OWNCLOUD_ADMIN_PASSWORD
value: Dsa-0213
- name: OWNCLOUD_ADMIN_USERNAME
value: tino
- name: OWNCLOUD_DB_HOST
value: mariadb
- name: OWNCLOUD_DB_NAME
value: owncloud
- name: OWNCLOUD_DB_PASSWORD
value: owncloud
- name: OWNCLOUD_DB_TYPE
value: mysql
- name: OWNCLOUD_DB_USERNAME
value: owncloud
- name: OWNCLOUD_MYSQL_UTF8MB4
value: "true"
- name: OWNCLOUD_REDIS_ENABLED
value: "true"
- name: OWNCLOUD_REDIS_HOST
value: redis

+ 12
- 0
ownCloud/kustomization.yaml View File

@ -0,0 +1,12 @@
secretGenerator:
- name: mysqloc-pass
namespace: owncloud
literals:
- password=Dsa-0213
- db_user=root
- db_passwd=Dsa-0213
resources:
- oc-namespace.yaml
- mysql-deployment.yaml
- php-deployment.yaml
- owncloud-deployment.yaml

+ 68
- 0
ownCloud/mysql-deployment.yaml View File

@ -0,0 +1,68 @@
apiVersion: v1
kind: Service
metadata:
name: owncloud-mysql
namespace: owncloud
labels:
app: owncloud
spec:
ports:
- port: 3306
selector:
app: owncloud
tier: mysql
clusterIP: None
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-oc-pv-claim
namespace: owncloud
labels:
app: owncloud
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: owncloud-mysql
namespace: owncloud
labels:
app: owncloud
spec:
selector:
matchLabels:
app: owncloud
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: owncloud
tier: mysql
spec:
containers:
- image: mariadb
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysqloc-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-oc-pv-claim

+ 4
- 0
ownCloud/oc-namespace.yaml View File

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

+ 10
- 0
ownCloud/oc-secret.yaml View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: mysqloc-pass
namespace: owncloud
type: Opaque
data:
password: RHNhLTAyMTM=
db_user: cm9vdA==
db_passwd: RHNhLTAyMTM=

+ 61
- 0
ownCloud/owncloud-deployment.yaml View File

@ -0,0 +1,61 @@
apiVersion: v1
kind: Service
metadata:
name: owncloud-server
namespace: owncloud
labels:
app: owncloud
spec:
selector:
pod-label: owncloud-server-pod
type: NodePort
ports:
- port: 8080
nodePort: 30689
targetPort: owncloud
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dboc-pv-claim
namespace: owncloud
labels:
app: owncloud
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: owncloud-server
namespace: owncloud
labels:
app: owncloud
spec:
replicas: 1
selector:
matchLabels:
pod-label: owncloud-server-pod
template:
metadata:
labels:
pod-label: owncloud-server-pod
spec:
containers:
- name: owncloud
image: 'owncloud/server:latest'
volumeMounts:
- name: server-storage
mountPath: /mnt/data
ports:
- containerPort: 8080
name: owncloud
volumes:
- name: server-storage
persistentVolumeClaim:
claimName: dboc-pv-claim

+ 3
- 0
ownCloud/paraTodo.sh View File

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

+ 54
- 0
ownCloud/php-deployment.yaml View File

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

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

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

+ 11
- 0
ownCloud/pv-local-owncloud.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: owncloud
spec:
capacity:
storage: 50Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/cluster/owncloud"

+ 29
- 0
ownCloud/syncNC2LaCie View File

@ -0,0 +1,29 @@
comienzo=$(date "+%Y_%m_%d-%H_%M_%S")
SINCRONIZANDO=/tmp/sincronizando
LOG=/tmp/resultadosync.log
ORIGEN=/mnt/cluster
DESTINO=/mnt/LaCie/BeeLink
DESTINOext=/mnt/Externo/Cluster
echo "$comienzo - Sincronizacion con LaCie" > $LOG
#echo "$comienzo - Sincronizacion con LaCie"
if [ ! -f "$SINCRONIZANDO" ]
then
touch $SINCRONIZANDO
echo "Empieza sincronización..." >> $LOG
for i in fireflyiii nextcloud nginx reevolution wordpress
do
echo "Guardando '$i'..." >> $LOG
# sudo rsync -avh $ORIGEN/$i $DESTINO --delete >> $LOG
sudo rsync -avh $ORIGEN/$i $DESTINOext --delete >> $LOG
done
final=$(date "+%Y_%m_%d-%H_%M_%S")
echo "$final - Fin de sincronizacion con LaCie" >> $LOG
mensaje="Copia de seguridad del disco duro realizada en la LaCie CloudBox y en disco externo"
sudo -u creylopez cat $LOG | mail -s "Copia realizada" "celestino.rey@gmail.com"
rm $SINCRONIZANDO
else
echo "ya se está sincronizando"
fi

Loading…
Cancel
Save