This commit is contained in:
Matthos Denys 2021-03-09 15:17:06 +03:00
parent 45bf00dba9
commit 3671d4b6a6
19 changed files with 2492 additions and 5 deletions

2
run.sh
View File

@ -10,6 +10,7 @@ docker build -t phpmyadmin_image srcs/phpmyadmin
docker build -t mariadb-image srcs/mariadb docker build -t mariadb-image srcs/mariadb
docker build -t my_ftps srcs/ftps docker build -t my_ftps srcs/ftps
docker build -t wp-image srcs/wp docker build -t wp-image srcs/wp
docker build -t grafana-image srcs/grafana
kubectl apply -f srcs/yaml/metallb.yaml kubectl apply -f srcs/yaml/metallb.yaml
kubectl apply -f srcs/yaml/nginx_service.yaml kubectl apply -f srcs/yaml/nginx_service.yaml
@ -17,5 +18,6 @@ kubectl apply -f srcs/yaml/mariadb.yaml
kubectl apply -f srcs/yaml/phpsvc.yaml kubectl apply -f srcs/yaml/phpsvc.yaml
kubectl apply -f srcs/yaml/wp.yaml kubectl apply -f srcs/yaml/wp.yaml
kubectl apply -f srcs/yaml/ftps.yaml kubectl apply -f srcs/yaml/ftps.yaml
kubectl apply -f srcs/yaml/grafana.yaml
echo "Minikube IP: ${IP}" echo "Minikube IP: ${IP}"

View File

@ -11,6 +11,6 @@ seccomp_sandbox=NO
rsa_cert_file=/etc/ssl/certs/vsftpd.crt rsa_cert_file=/etc/ssl/certs/vsftpd.crt
rsa_private_key_file=/etc/ssl/private/vsftpd.key rsa_private_key_file=/etc/ssl/private/vsftpd.key
ssl_enable=YES ssl_enable=YES
pasv_address=192.168.99.150 pasv_address=192.168.99.166
pasv_min_port=30020 pasv_min_port=30020
pasv_max_port=30021 pasv_max_port=30021

BIN
srcs/grafana/.DS_Store vendored Executable file

Binary file not shown.

15
srcs/grafana/Dockerfile Executable file
View File

@ -0,0 +1,15 @@
FROM alpine:3.12
LABEL maintainer="mdenys"
RUN apk update
RUN apk add supervisor nginx php7 php7-fpm php7-opcache php7-gd php7-mysqli php7-zlib php7-curl php7-mbstring php7-json php7-session mysql openssl
RUN mkdir -p /var/www/localhost/htdocs/
RUN mkdir -p /run/php7
RUN mkdir -p /run/nginx
RUN mkdir /etc/nginx/ssl
RUN openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out /etc/nginx/ssl/html.pem -keyout /etc/nginx/ssl/html.key -subj "/C=RU/ST=Kazan/L=Kazan/O=21 School/OU=mdenys/CN=html"
RUN mkdir -p /var/www/localhost/htdocs/tmp
RUN chmod 777 /var/www/localhost/htdocs/tmp
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisord.conf
EXPOSE 5000
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

14
srcs/grafana/index.html Executable file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
</head>
<body>
<div class="container-sm"><h1 class="display-1">phpmyadmin</h1></div>
<?php echo phpinfo();?>
</body>
</html>

16
srcs/grafana/nginx.conf Executable file
View File

@ -0,0 +1,16 @@
server {
listen 0.0.0.0:3000 ssl default_server;
server_name localhost;
ssl_certificate /etc/nginx/ssl/html.pem;
ssl_certificate_key /etc/nginx/ssl/html.key;
root /var/www/localhost/htdocs/;
autoindex on;
index index.php;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_index index.php;
}
}

1173
srcs/grafana/php.ini Executable file

File diff suppressed because it is too large Load Diff

7
srcs/grafana/supervisord.conf Executable file
View File

@ -0,0 +1,7 @@
[supervisord]
nodaemon=true
user=root
[program:php]
command= /usr/sbin/php-fpm7
[program:nginx]
command=sh -c "nginx -g 'daemon off;' && kill -s SIGTERM $(cat supervisord.pid)"

BIN
srcs/influxdb/.DS_Store vendored Executable file

Binary file not shown.

15
srcs/influxdb/Dockerfile Executable file
View File

@ -0,0 +1,15 @@
FROM alpine:3.12
LABEL maintainer="mdenys"
RUN apk update
RUN apk add supervisor nginx php7 php7-fpm php7-opcache php7-gd php7-mysqli php7-zlib php7-curl php7-mbstring php7-json php7-session mysql openssl
RUN mkdir -p /var/www/localhost/htdocs/
RUN mkdir -p /run/php7
RUN mkdir -p /run/nginx
RUN mkdir /etc/nginx/ssl
RUN openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out /etc/nginx/ssl/html.pem -keyout /etc/nginx/ssl/html.key -subj "/C=RU/ST=Kazan/L=Kazan/O=21 School/OU=mdenys/CN=html"
RUN mkdir -p /var/www/localhost/htdocs/tmp
RUN chmod 777 /var/www/localhost/htdocs/tmp
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisord.conf
EXPOSE 5000
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

14
srcs/influxdb/index.html Executable file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
</head>
<body>
<div class="container-sm"><h1 class="display-1">phpmyadmin</h1></div>
<?php echo phpinfo();?>
</body>
</html>

16
srcs/influxdb/nginx.conf Executable file
View File

@ -0,0 +1,16 @@
server {
listen 0.0.0.0:3000 ssl default_server;
server_name localhost;
ssl_certificate /etc/nginx/ssl/html.pem;
ssl_certificate_key /etc/nginx/ssl/html.key;
root /var/www/localhost/htdocs/;
autoindex on;
index index.php;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_index index.php;
}
}

1173
srcs/influxdb/php.ini Executable file

File diff suppressed because it is too large Load Diff

7
srcs/influxdb/supervisord.conf Executable file
View File

@ -0,0 +1,7 @@
[supervisord]
nodaemon=true
user=root
[program:php]
command= /usr/sbin/php-fpm7
[program:nginx]
command=sh -c "nginx -g 'daemon off;' && kill -s SIGTERM $(cat supervisord.pid)"

View File

@ -25,11 +25,11 @@ http {
} }
location = ^(/phpmyadmin)$ { location = ^(/phpmyadmin)$ {
proxy_pass https://192.168.99.150:5000/$1; proxy_pass https://192.168.99.166:5000/$1;
} }
location /phpmyadmin { location /phpmyadmin {
proxy_pass https://192.168.99.150:5000/; proxy_pass https://192.168.99.166:5000/;
proxy_redirect /index.php /phpmyadmin/index.php; proxy_redirect /index.php /phpmyadmin/index.php;
} }
} }

View File

@ -5,7 +5,7 @@ rc-service mariadb start
cd /var/www/localhost/htdocs/ cd /var/www/localhost/htdocs/
wp core download --allow-root --quiet wp core download --allow-root --quiet
wp core config --allow-root --dbname=wp_db --dbuser=mdenys --dbpass=mdenys --dbhost=mariadb-service --dbprefix=wp_ --quiet wp core config --allow-root --dbname=wp_db --dbuser=mdenys --dbpass=mdenys --dbhost=mariadb-service --dbprefix=wp_ --quiet
wp core install --allow-root --url="http://192.168.99.150:5050" --title="ecole 21" --admin_user="admin" --admin_password="123456" --admin_email="denis.nadey@gmail.com" --quiet wp core install --allow-root --url="http://192.168.99.166:5050" --title="ecole 21" --admin_user="admin" --admin_password="123456" --admin_email="denis.nadey@gmail.com" --quiet
wp user create bob bob@example.com --role=author --allow-root --quiet wp user create bob bob@example.com --role=author --allow-root --quiet
wp user create bob2 bob2@example.com --role=author --allow-root --quiet wp user create bob2 bob2@example.com --role=author --allow-root --quiet
wp user create bob3 bob3@example.com --role=author --allow-root --quiet wp user create bob3 bob3@example.com --role=author --allow-root --quiet

View File

@ -10,6 +10,7 @@ spec:
ports: ports:
- name: data - name: data
port: 20 port: 20
protocol: TCP
- name: ftps - name: ftps
port: 21 port: 21
protocol: TCP protocol: TCP

34
srcs/yaml/grafana.yaml Executable file
View File

@ -0,0 +1,34 @@
apiVersion: v1
kind: Service
metadata:
name: grafana-service
annotations:
metallb.universe.tf/allow-shared-ip: minikube
spec:
selector:
app: grafana
ports:
- name: https
protocol: TCP
port: 3000
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana-deployment
spec:
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
containers:
- name: grafana
imagePullPolicy: Never
image: grafana_image
ports:
- containerPort: 3000

View File

@ -9,4 +9,4 @@ data:
- name: default - name: default
protocol: layer2 protocol: layer2
addresses: addresses:
- 192.168.99.150-192.168.99.200 - 192.168.99.166-192.168.99.200