瀏覽代碼

Quito MysqlOperator de aquí. Aclaraciones en README

Celestino Rey 7 月之前
父節點
當前提交
bfcbb76245

+ 0 - 71
MysqlOperator/README.md

@@ -1,71 +0,0 @@
-# MySQL Operator for Kubernetes Installation
-
-## Using Manifest Files with kubectl
-
-First deploy the Custom Resource Definition (CRDs):
-
-    kubectl apply -f https://raw.githubusercontent.com/mysql/mysql-operator/9.6.0-2.2.7/deploy/deploy-crds.yaml
-
-Then deploy MySQL Operator for Kubernetes:
-
-    kubectl apply -f https://raw.githubusercontent.com/mysql/mysql-operator/9.6.0-2.2.7/deploy/deploy-operator.yaml
-
-Verify the operator is running by checking the deployment inside the mysql-operator namespace:
-
-    kubectl get deployment -n mysql-operator mysql-operator
-
-    NAME             READY   UP-TO-DATE   AVAILABLE   AGE
-    mysql-operator   1/1     1            1           1h
-
-
-# MySQL InnoDB Cluster Installation
-
-## Using kubectl
-
-For creating a MySQL InnoDB Cluster, first create a secret with credentials for a MySQL root user used to perform administrative tasks in the cluster. For example:
-
-    kubectl create secret generic mypwds \
-        --from-literal=rootUser=root \
-        --from-literal=rootHost=% \
-        --from-literal=rootPassword="sakila"
-
-Define your MySQL InnoDB Cluster, which references the secret. For example:
-
-    apiVersion: mysql.oracle.com/v2
-    kind: InnoDBCluster
-    metadata:
-      name: mycluster
-    spec:
-      secretName: mypwds
-      tlsUseSelfSigned: true
-      instances: 3
-      router:
-        instances: 1
-
-Assuming it's saved as mycluster.yaml, deploy it:
-
-    kubectl apply -f mycluster.yaml
-
-This sample creates an InnoDB Cluster with three MySQL Server instances and one MySQL Router instance. The process can be observed using:
-
-    kubectl get innodbcluster --watch
-
-    NAME          STATUS    ONLINE   INSTANCES   ROUTERS   AGE
-    mycluster     PENDING   0        3           1         2m6s
-    ...
-    mycluster     ONLINE    3        3           1         10s
-
-# Conectar al cluster
-
-
-    kubectl run --rm -it myshell --image=container-registry.oracle.com/mysql/community-operator -- mysqlsh
-
-en el prompt,
-
-    \connect root@mycluster-instances.mysql-cluster.svc.cluster.local
-
-> NOTA: el nombre del host es el del servicio del cluster (```mycluster-instances```) seguido del namespace (```mysql-cluster```) y finalmente por ```svc.cluster.local```.
-
-## PHP my admin
-
-Como php my admin tiene que trabajar con el cluster, no hace falta tener uno en cada wordpress. Solo hay una instancia y está aquí

+ 0 - 1
MysqlOperator/conecta.sh

@@ -1 +0,0 @@
-kubectl run --rm -it myshell --image=container-registry.oracle.com/mysql/community-operator -- mysqlsh

+ 0 - 11
MysqlOperator/mysql-innodb-cluster.yaml

@@ -1,11 +0,0 @@
-apiVersion: mysql.oracle.com/v2
-kind: InnoDBCluster
-metadata:
-  name: mycluster
-  namespace: mysql-cluster
-spec:
-  secretName: mypwds
-  tlsUseSelfSigned: true
-  instances: 1
-  router:
-    instances: 1

+ 0 - 57
MysqlOperator/php-deployment.yaml

@@ -1,57 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
-  name: phpmyadmin-mysql-cluster
-  namespace: mysql-cluster
-  labels:
-    app: wordpress
-spec:
-  selector:
-    app: wordpress
-    tier: phpmyadmin
-  type: NodePort
-  ports:
-    - name: phpadmin
-      nodePort: 30089
-      port: 80
-      targetPort: phpmyadm
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: phpmyadmin-mysql-cluster
-  namespace: mysql-cluster
-  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_UPLOADDIR
-              value: /var/www/html/subidas
-            - name: PMA_HOST
-              # value: wordpress-mysql
-              value: mycluster-instances.mysql-cluster.svc.cluster.local
-            - name: PMA_PORT
-              value: "3306"
-            - name: MYSQL_ROOT_PASSWORD
-              valueFrom:
-                secretKeyRef:
-                  name: mysqlwp-pass
-                  key: password

+ 0 - 8
MysqlOperator/secreto.yaml

@@ -1,8 +0,0 @@
-apiVersion: v1
-kind: Secret
-metadata:
-  name: mypwds
-data:
-  rootPassword: RHNhLTAyMTM=
-  rootUser: cm9vdA==
-  rootHost: JQ==

+ 0 - 9
MysqlOperator/wordpress-secrets.yaml

@@ -1,9 +0,0 @@
-apiVersion: v1
-kind: Secret
-metadata:
-  name: mysqlwp-pass
-  namespace: mysql-cluster
-data:
-  password: RHNhLTAyMTM=
-  db_user: cm9vdA==
-  db_passwd: RHNhLTAyMTM=

+ 7 - 1
Reevolution/Academia-ES/php-deployment.yaml

@@ -39,10 +39,12 @@ spec:
       containers:
         - name: phpmyadmin
           image: phpmyadmin
-          #image: docker-registry:32000/phpmyadmin:1.0
           ports:
             - containerPort: 80
               name: phpmyadm
+          volumeMounts:
+            - name: phpmyadmin-persistent-storage
+              mountPath: /var/www/html/themes
           env:
             - name: PMA_HOST
               value: wp-academia-mysql
@@ -55,3 +57,7 @@ spec:
                   key: password
       imagePullSecrets:
       - name: reg-cred-secret
+      volumes:
+      - name: phpmyadmin-persistent-storage
+        persistentVolumeClaim:
+          claimName: phpmyadmin-pv-claim

+ 14 - 0
Reevolution/Academia-ES/pvc-phpmyadmin.yaml

@@ -0,0 +1,14 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: phpmyadmin-pv-claim
+  namespace: wp-academia
+  labels:
+    app: wp-academia
+spec:
+  accessModes:
+    - ReadWriteOnce
+  resources:
+    requests:
+      storage: 1Gi
+---

+ 14 - 0
Reevolution/COSAS_PENDIENTES.md

@@ -0,0 +1,14 @@
+# Cosas pendientes
+
+Hay que aumentar el tamaño del cluster mysql porque los 2Gi creados por defecto ya están casi llenos.
+
+1. hacer una copia de la base de datos (o bases de datos) con mysqldump (¡no con phpmyadmin!)
+2. destruir el cluster y la pvc
+3. Modificar el yaml para especificar el nuevo tamaño.
+4. Crear el cluster. La pvc se creará automáticamente.
+5. Desde phpmyadmin, crear la base de datos.
+6. Importar las tablas en la base de datos.
+
+Con esto debería de funcionar todo otra vez.
+
+