Let you use Kubernetes to quickly build a lmap usage environment.
The LAMP contains the following four operating environments.
- Linux
- Apache
- MariaDB or MySQL
- PHP
change the folder to mysql.
kubectl create secret generic mysql-pass --from-file=password.txt
kubectl apply -f mysql.yaml
kubectl get pod
NAME READY STATUS RESTARTS AGE
php-server-2153209126-5dq92 1/1 Running 0 2d
kubectl get svc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mysql-service 192.171.74.152 <none> 3306/TCP 2d
change the folder to php7-apache2.
kubectl apply -f php7-apache2.yaml
kubectl get pod
NAME READY STATUS RESTARTS AGE
my-php7-server-2156581821-lwtsx 1/1 Running 0 1d
kubectl get svc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-php7-server 192.167.37.87 192.16.35.12 80/TCP 16h
[color=#c63760]NOTE: If your EXTERNAL-IP is ,you have to edit the EXTERNAL-IP.
browse 192.16.35.12 can see that connect the database success.