Hello world app: nginx+php+pgsql module
438
You'll need:
brew cask install minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
git clone https://github.com/pathcl/helloworld.git && cd helloworld
You'll find several files:
.
├── Makefile
├── README.md
├── config.env
├── deploy.env
├── helloworld
│ ├── Dockerfile
│ ├── database-all-objects-one-file.yml
│ ├── database-configmap.yml
│ ├── database-deployment.yml
│ ├── database-service.yml
│ ├── database-storage.yml
│ ├── database.sql
│ ├── frontend.yml
│ ├── nginx-service.yml
│ ├── redis.yml
│ └── wwwroot
│ ├── dbconfig.php
│ └── index.php
└── version.env
Main folder for web application
make -i deploy
This command will try to install: postgresql, nginx, redis. You should wait until every pod is running:
kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-bb58ff6bb-9mztl 1/1 Running 0 1m
postgres-77cd88ff7d-kr2mg 1/1 Running 0 1m
redis-6c78c5c69-w29f2 1/1 Running 0 1m
This is only needed first time since we're using persistent volumes.
make postgres &
psql -U postgres -f helloworld/database.sql -h localhost
make nginx
kubectl create -f helloworld/database-all-objects-one-file.yml
kubectl create -f helloworld/frontend.yml
kubectl create -f helloworld/redis.yml
make build
make publish
NGINX_POD=`kubectl get pods --no-headers=true|grep nginx|cut -f1 -d' '`
kubectl port-forward $NGINX_POD 8080:80
or
make nginx
Content type
Image
Digest
Size
121.1 MB
Last updated
about 8 years ago
docker pull pathcl/helloworld:master