Kaynağa Gözat

PHP my admin en cluster solo. Añado Reevolutiontherapy

Tino 7 ay önce
ebeveyn
işleme
9d8d7b82bd

+ 3 - 0
MysqlOperator/README.md

@@ -64,3 +64,6 @@ en el prompt,
 
     \connect root@mycluster
 
+## 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í

+ 2 - 2
WordpresSite/php-deployment.yaml → MysqlOperator/php-deployment.yaml

@@ -2,7 +2,7 @@ apiVersion: v1
 kind: Service
 metadata:
   name: phpmyadmin-wordpress
-  namespace: wordpress
+  namespace: mysql-cluster
   labels:
     app: wordpress
 spec:
@@ -20,7 +20,7 @@ apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: phpmyadmin-wordpress
-  namespace: wordpress
+  namespace: mysql-cluster
   labels:
     app: wordpress
 spec:

+ 9 - 0
MysqlOperator/wordpress-secrets.yaml

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

+ 14 - 0
Reevolution/README.md

@@ -0,0 +1,14 @@
+# ¿Cómo accedo a mi sitio a través de conexión SSH?
+
+1. Genera un nuevo par de claves SSH desde Site Tools > Desarrolladores > Gestor claves SSH > Añadir nuevo > Generar.
+2. Copia la clave privada desde Site Tools > Desarrolladores > Gestor claves SSH > Acciones > Clave privada y guárdala en un archivo en tu máquina local.
+3. Cambia los permisos del archivo que acabas de crear a unos más seguros. Para ello, ejecuta en la terminal el siguiente comando: chmod 600 /Users/tuusuario/private_key
+    * Reemplaza /Users/tuusuario/private_key con la localización de tu archivo de texto con la clave privada
+4. Carga la clave en tu máquina local dependiendo del sistema operativo que estés usando:
+    * Para Linux/Mac OS, usa ssh-add /ruta/a/tu/clave_privada
+    * Para Windows, abre PuTTy y haz clic en Cargar y abre el archivo con la clave privada
+
+5. Introduce la clave de seguridad elegida durante la generación de la clave.
+6. Conecta via SSH dependiendo del sistema operativo que estés usando:
+    * Para Linux/Mac OS: ssh USER@HOST_NAME -pPORTLas credenciales SSH están disponibles en Site Tools > Desarrolladores > Gestor claves SSH. Debajo de Gestionar claves SSH, elige tu clave y ve al menú de tres puntos > Credenciales SSH. Por ejemplo:ssh user1@tudominio.com -p18765
+    * Para Windows – en PuTTY introduce el nombre de host del servidor. Configura el tipo de conexión a SSH y el puerto en 18765. Introduce tu usuario y pulsa Intro. Las credenciales SSH están disponibles en Site Tools > Desarrolladores > Gestor claves SSH. Debajo de Gestionar claves SSH, elige tu clave y ve al menú de tres puntos > Credenciales SSH.

+ 9 - 0
Reevolution/Reevolutiontherapy/clave-privada.txt

@@ -0,0 +1,9 @@
+-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABDKhNLSAq
+FkeShqbGCqTKcWAAAAGAAAAAEAAAAzAAAAC3NzaC1lZDI1NTE5AAAAIFW9undg+MKnDO9n
+r7znfNzw/Un+0NshZtFLM3jkGOOrAAAAoLz/E2rH2r0pSWXOOumjLZIFwg17mbS2EIVsQ/
+nFaJVTyFxLsJgkiGMkD6J7a/gwEWUFWOBLBzk09IvE9unGVhO88n3OQcpRvjUFK4SXwv4U
+MApX4R+lZn06uxFGEtQlRETxz8WdndGkcCMyFm5X2A94eDapVXtRfKzJHcruLW30goQYOo
+NQj1HYzkpsuV7eQshAEmU9SXm5D13S6x4uhd8=
+-----END OPENSSH PRIVATE KEY-----
+

+ 4 - 0
Reevolution/Reevolutiontherapy/credenciales

@@ -0,0 +1,4 @@
+Nombre de host: ssh.reevolutiontherapy.com
+Nombre de usuario: u1857-nlfngz5ondxt
+Contraseña: Contraseña de la clave SSH
+Puerto: 18765

+ 1 - 0
Reevolution/Reevolutiontherapy/passphrase

@@ -0,0 +1 @@
+@e3^32rxx1bo

+ 57 - 0
Reevolution/Reevolutiontherapy/php-deployment.yaml

@@ -0,0 +1,57 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: phpmyadmin-wp-therapy
+  namespace: wp-therapy
+  labels:
+    app: wp-therapy
+spec:
+  selector:
+    app: wp-therapy
+    tier: phpmyadmin
+  type: NodePort
+  ports:
+    - name: phpadmin
+      port: 80
+      nodePort: 30183
+      targetPort: phpmyadm
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: phpmyadmin-wp-therapy
+  namespace: wp-therapy
+  labels:
+    app: wp-therapy
+spec:
+  selector:
+    matchLabels:
+      app: wp-therapy
+      tier: phpmyadmin
+  strategy:
+    type: Recreate
+  template:
+    metadata:
+      labels:
+        app: wp-therapy
+        tier: phpmyadmin
+    spec:
+      containers:
+        - name: phpmyadmin
+          image: phpmyadmin
+          #image: docker-registry:32000/phpmyadmin:1.0
+          ports:
+            - containerPort: 80
+              name: phpmyadm
+          env:
+            - name: PMA_HOST
+              value: mycluster-instances.mysql-cluster.svc.cluster.local
+            - name: PMA_PORT
+              value: "3306"
+            - name: MYSQL_ROOT_PASSWORD
+              valueFrom:
+                secretKeyRef:
+                  name: mysqlwp-pass
+                  key: password
+      imagePullSecrets:
+      - name: reg-cred-secret

+ 14 - 0
Reevolution/Reevolutiontherapy/pvc-wordpress.yaml

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

+ 65 - 0
Reevolution/Reevolutiontherapy/wordpress-deployment.yaml

@@ -0,0 +1,65 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: wp-therapy
+  namespace: wp-therapy
+  labels:
+    app: wp-therapy
+spec:
+  type: NodePort
+  ports:
+    - port: 80
+      nodePort: 30089
+      targetPort: wp-therapy
+  selector:
+    app: wp-therapy
+    tier: frontend
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: wp-therapy
+  namespace: wp-therapy
+  labels:
+    app: wp-therapy
+spec:
+  selector:
+    matchLabels:
+      app: wp-therapy
+      tier: frontend
+  strategy:
+    type: Recreate
+  template:
+    metadata:
+      labels:
+        app: wp-therapy
+        tier: frontend
+    spec:
+      containers:
+      - image: wordpress
+        name: wp-therapy
+        env:
+        - name: WORDPRESS_DB_HOST
+          value: mycluster-instances.mysql-cluster.svc.cluster.local
+        - 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: wp-therapy
+        volumeMounts:
+        - name: wp-therapy-persistent-storage
+          mountPath: /var/www/html
+      imagePullSecrets:
+      - name: reg-cred-secret
+      volumes:
+      - name: wp-therapy-persistent-storage
+        persistentVolumeClaim:
+          claimName: wp-pv-claim

+ 9 - 0
Reevolution/Reevolutiontherapy/wordpress-secrets.yaml

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