bionet
所属分类:Docker
开发工具:Astro
文件大小:0KB
下载次数:0
上传日期:2023-10-29 19:52:37
上 传 者:
sh-1993
说明: 生物网
(bionet)
文件列表:
.dockerignore (111, 2023-11-14)
bionet-ui/ (0, 2023-11-14)
bionet-ui/.dockerignore (127, 2023-11-14)
bionet-ui/.vscode/ (0, 2023-11-14)
bionet-ui/.vscode/extensions.json (87, 2023-11-14)
bionet-ui/.vscode/launch.json (207, 2023-11-14)
bionet-ui/astro.config.mjs (159, 2023-11-14)
bionet-ui/bionet-ui.nginx.prod.conf (217, 2023-11-14)
bionet-ui/dev.Dockerfile (198, 2023-11-14)
bionet-ui/k8s.Dockerfile (371, 2023-11-14)
bionet-ui/package.json (265, 2023-11-14)
bionet-ui/prod.Dockerfile (374, 2023-11-14)
bionet-ui/public/ (0, 2023-11-14)
bionet-ui/public/apple-touch-icon.png (3311, 2023-11-14)
bionet-ui/public/browserconfig.xml (246, 2023-11-14)
bionet-ui/public/favicon-16.png (470, 2023-11-14)
bionet-ui/public/favicon-32.png (647, 2023-11-14)
bionet-ui/public/favicon.ico (15406, 2023-11-14)
bionet-ui/public/footer.svg (2584, 2023-11-14)
bionet-ui/public/hero.svg (58947, 2023-11-14)
bionet-ui/public/icon-192.png (3637, 2023-11-14)
bionet-ui/public/icon-256.png (1956, 2023-11-14)
bionet-ui/public/icon-512.png (12878, 2023-11-14)
bionet-ui/public/icon.svg (1886, 2023-11-14)
bionet-ui/public/manifest.webmanifest (535, 2023-11-14)
bionet-ui/public/mstile-150x150.png (1775, 2023-11-14)
bionet-ui/public/robots.txt (64, 2023-11-14)
bionet-ui/public/safari-pinned-tab.svg (1210, 2023-11-14)
bionet-ui/src/ (0, 2023-11-14)
bionet-ui/src/components/ (0, 2023-11-14)
bionet-ui/src/components/About.astro (402, 2023-11-14)
bionet-ui/src/components/Contact.astro (296, 2023-11-14)
bionet-ui/src/components/Footer.astro (144, 2023-11-14)
bionet-ui/src/components/Header.astro (246, 2023-11-14)
bionet-ui/src/components/Hero.astro (1192, 2023-11-14)
bionet-ui/src/components/Main.astro (180, 2023-11-14)
bionet-ui/src/components/Masthead.astro (245, 2023-11-14)
... ...
# bionet
## Running the app
### Docker compose
```bash
# DEBUG MODE
# buid docker images based on docker-compose config; running on port 7800
docker compose -f docker-compose.dev.yml up --build
# stop running container
docker compose -f docker-compose.dev.yml down
# to restart on detach mode
docker compose -f docker-compose.dev.yml up -d
# PROD MODE
# buid docker images based on docker-compose config; running on port 7800
docker compose -f docker-compose.prod.yml up --build
# stop running container
docker compose -f docker-compose.prod.yml down
# to restart on detach mode
docker compose -f docker-compose.prod.yml up -d
# check images
docker images
# clean slate
docker system prune -a && docker images prune -a && docker volume prune -a
```
### Kubernetes
```bash
# build the app images and ensure the the app runs on dockerize mode before running K8s
cd bionet-ui/ && docker build -t aiotrope/bionet-ui -f ./k8s.Dockerfile .
# check images
docker images
# tag the image
docker tag aiotrope/bionet-ui aiotrope/bionet-ui
# push to docker hub
docker push aiotrope/bionet-ui
# check if dockerized app will run at port specified port e.g 8000
docker run -d -p 8000:4321 aiotrope/bionet-ui:latest
docker ps
# stop running dockerized app
docker stop $(docker ps -a -q)
# start minikube
cd kubernetes/ && minikube start
# start a new terminal, and leave this running
minikube dashboard
# enable metric server
minikube addons enable metrics-server
# check if metric server is running
kubectl get pods -n kube-system
# create new namespace & set it as a default namespace
kubectl create namespace bionet-namespace && kubectl config set-context --current --namespace=bionet-namespace
# deploy to k8s
kubectl apply -f bionet-ui-deployment.yml
kubectl apply -f bionet-ui-service.yml
kubectl apply -f bionet-ui-deployment-hpa.yml
# check deployment
kubectl get deployments
# check services
kubectl get services
kubectl get svc
# check hpa
kubectl get hpa
# check and ensure the pods are running with no errors
kubectl get pods
# check resource usage of the pods
kubectl top pod
# check auto-scaling
minikube service bionet-ui-service -n bionet-namespace --url
# e.g http://127.0.0.1:50766
# access k86 deployed service
minikube service -n bionet-namespace bionet-ui-service
# auto scaling without config file
kubectl autoscale -f bionet-ui-deployment.yml --min=2 --max=5 --cpu-percent=5
# check hpa
kubectl get hpa
# delete auto scaling
kubectl delete hpa bionet-ui-deployment
# delete and cleanup
kubectl delete -f bionet-ui-deployment.yml
kubectl delete -f bionet-ui-service.yml
kubectl delete -f bionet-ui-deployment-hpa.yml
# stop cluster but no deletion
minikube stop
# delete all
kubectl delete pods --all -A
kubectl delete deploy --all -A
kubectl delete all --all -A # all resources
minikube delete
```
近期下载者:
相关文件:
收藏者: