This project demonstrates simple IaC (Infrastructure as Code) for NVM boilerplate to Minikube.
This is a Kubernetes sample project, not for a production use.
Start minikube
$ minikube start
$ minikube addons enable ingress
$ minikube addons enable metrics-server
Go to terraform
folder
Run Terraform commands
$ terraform init
$ terraform plan
$ terraform apply
or simply run bash script
$ ./script/deploy.sh
Update hosts file
$ ./script/update-hosts.sh
To see orchestrator, run following port forward.
$ kubectl -nnvm-db port-forward service/presslabs-mysql-operator 8080:80
And open http://localhost:8080
To see operator logs, run following command
$ kubectl -nnvm-db logs presslabs-mysql-operator-0 -c operator -f
To access mysql, run following command
$ kubectl -nnvm-db port-forward mysql-cluster-mysql-0 3307:3306
$ mysql -h127.0.0.1 -uroot -proot -P3307 boilerplate
$ kubectl get hpa --all-namespaces
If you see <unknown>/50%
, make sure you enabled metrics-server.
$ minikube addons enable metrics-server
You can access Grafana via http://nvm-boilerplate.local/grafana
.
Once the deployment is completed, then you will see the result like below:
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
Outputs:
grafana_admin_password = ynSVNykpU72RM5x6
For example, as above, if admin password ynSVNykpU72RM5x6
then you can login Grafana with admin
/ynSVNykpU72RM5x6
.
Author: chrisleekr
Source Code: https://github.com/chrisleekr/k8s-nodejs-vuejs-mysql-boilerplate
#vue #vuejs #javascript