aboutsummaryrefslogtreecommitdiff
path: root/srcs
diff options
context:
space:
mode:
Diffstat (limited to 'srcs')
-rwxr-xr-xsrcs/mysql/entrypoint.sh13
-rw-r--r--srcs/mysql/mysql.yaml43
-rw-r--r--srcs/phpmyadmin/config.inc.php2
3 files changed, 29 insertions, 29 deletions
diff --git a/srcs/mysql/entrypoint.sh b/srcs/mysql/entrypoint.sh
index 73e574e..80ec84c 100755
--- a/srcs/mysql/entrypoint.sh
+++ b/srcs/mysql/entrypoint.sh
@@ -3,11 +3,13 @@
mkdir -p /run/mysqld
mkdir -p /var/lib/mysql
-echo '-----------INSTALL-----------'
-mysql_install_db --user=root --datadir=/var/lib/mysql
+if [ ! -d /var/lib/mysql/mysql ]
+then
+ echo '-----------INSTALL-----------'
+ mysql_install_db --user=root --datadir=/var/lib/mysql
-echo '-----------SETUP-----------'
-/usr/bin/mysqld --user=root --datadir=/var/lib/mysql --bootstrap <<EOF
+ echo '-----------SETUP-----------'
+ /usr/bin/mysqld --user=root --datadir=/var/lib/mysql --bootstrap <<EOF
FLUSH PRIVILEGES;
CREATE DATABASE wordpress;
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
@@ -15,8 +17,7 @@ GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'%' IDENTIFIED BY 'root';
FLUSH PRIVILEGES;
EOF
-echo '-----------SLEEP-----------'
-sleep 3
+fi
echo '-----------DEAMON-----------'
exec /usr/bin/mysqld --user=root --datadir=/var/lib/mysql
diff --git a/srcs/mysql/mysql.yaml b/srcs/mysql/mysql.yaml
index 17ba1e8..e871e05 100644
--- a/srcs/mysql/mysql.yaml
+++ b/srcs/mysql/mysql.yaml
@@ -21,13 +21,13 @@ spec:
- image: cacharle-mysql
imagePullPolicy: Never
name: cacharle-mysql-container
- # volumeMounts:
- # - name: mysql-volume
- # mountPath: /var/lib/data
- # volumes:
- # - name: mysql-volume
- # persistentVolumeClaim:
- # claimName: mysql-volume
+ volumeMounts:
+ - name: mysql-volume
+ mountPath: /var/lib/mysql
+ volumes:
+ - name: mysql-volume
+ persistentVolumeClaim:
+ claimName: mysql-volume
---
@@ -39,7 +39,6 @@ metadata:
app: mysql
spec:
type: ClusterIP
- # clusterIP: None
ports:
- name: mysql
port: 3306
@@ -47,17 +46,17 @@ spec:
selector:
app: mysql
-# ---
-#
-# apiVersion: v1
-# kind: PersistentVolumeClaim
-# metadata:
-# name: mysql-volume
-# labels:
-# app: mysql
-# spec:
-# accessModes:
-# - ReadWriteOnce # read/write by one pod
-# resources:
-# requests:
-# storage: 1Gi
+---
+
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: mysql-volume
+ labels:
+ app: mysql
+spec:
+ accessModes:
+ - ReadWriteOnce # read/write by one pod
+ resources:
+ requests:
+ storage: 1Gi
diff --git a/srcs/phpmyadmin/config.inc.php b/srcs/phpmyadmin/config.inc.php
index 17656a5..8a0b46a 100644
--- a/srcs/phpmyadmin/config.inc.php
+++ b/srcs/phpmyadmin/config.inc.php
@@ -15,7 +15,7 @@ declare(strict_types=1);
* This is needed for cookie based authentication to encrypt password in
* cookie. Needs to be 32 chars long.
*/
-$cfg['blowfish_secret'] = 'bonjour'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
+$cfg['blowfish_secret'] = 'asd12342134llfi12341234231998asdfls9812349871234rjqwl'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
/**
* Servers configuration