Kubernetes-php-example
This is a example for checking kubernetes concepts using php internal web server.
prerequisite
- Installed minikube
- Basic knowledge of docker
How to use
- set docker environment using minikbe docker-env
eval $(minikube docker-env) # if you're using windows, just type minikube docker-env and # copy last of output, run it on powershell.
- build docker image.
docker build -t gwkim/php .
- create kubernetes deployment.
kubectl apply -f sample-deployment.yaml
- create service and expose.
kubectl expose deployment sample --type=LoadBalancer
- using minikube service, check the load balancing mechanism!
minikube service sample # If run it, you will see a browser tab open. # Refresh it so you can check load balancing.