Skip to content

joma1021/vs_microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vs_microservices

Abgabe für das Verteilte Systeme Labor

Docker:

  • build jar file:
    cd ./product-service 
    ./gradlew build
    cd .././category-service 
    ./gradlew build
    cd ../
  • test jar file:
    java -jar ./product-service/build/libs/product-service.jar
    java -jar ./category-service/build/libs/category-service.jar
  • build image:
    cd ./product-service
    docker build -t joma1021/product-service-docker .
    cd .././category-service
    docker build -t unsi1012/category-service-docker .
  • docker compose:
    cd ../
    docker-compose up -d
    
    

Gegen DB Verbinden

  • Gegen DB verbinden und SQL-Befehl ausführen:

    mysql --host=127.0.0.1 --port=3306 -u root -p

    Password: c8de110f37300a53a971749

  • SQl-Bsp zum DB anlegen:

        CREATE DATABASE IF NOT EXISTS `product`;   
        CREATE USER 'user'@'%' IDENTIFIED BY 'password';
        GRANT ALL ON *.* TO 'user'@'%';

Kubernetes

Deployment

  • start minikube:

    minikube start
  • map minikube to docker-env:

    minikube docker-env
    & minikube -p minikube docker-env | Invoke-Expression

    oder

    eval $(minikube -p minikube docker-env)
  • docker build:

    docker-compose build
  • kubectl apply:

    kubectl apply -f product-service-service.yaml,category-service-service.yaml,web-shop-db-image-service.yaml,product-service-deployment.yaml,category-service-deployment.yaml,web-shop-db-image-deployment.yaml,web-shop-db-image-claim0-persistentvolumeclaim.yaml,apache-development.yaml,apache-service.yaml,hska-vis-legacy-service.yaml,hska-vis-legacy-deployment.yaml
    OR 
    sh ./kubernetes-apply.sh
  • open apache page:

    minikube service apache
  • remove kubernetes deployments:

    ./kubernetes-remove.sh
  • delete minikube:

    minikube delete --all
  • open minikube dashboard:

    minikube dashboard
  • open tunnel + show external ip

    minikube tunnel -c
    kubectl get svc

istio:

  • set istioctl

    cd istio-1.12.1/
    export PATH=$PWD/bin:$PATH
  • open kiali

    cd ../
    kubectl rollout status deployment/kiali -n istio-system
    istioctl dashboard kiali
  • open prometheus

    istioctl dashboard prometheus
  • open grafana

    istioctl dashboard grafana

Logging/Monitoring:

  • Product-Service Example Average Response Time

sum(rate(istio_request_duration_milliseconds_sum{pod_template_hash="5559b5f6df|6b67458f69|69f8fd644f",source_workload="product-service",source_workload_namespace="default"}[1m])) / sum(rate(istio_request_duration_milliseconds_count{pod_template_hash="5559b5f6df|6b67458f69|69f8fd644f",source_workload="product-service",source_workload_namespace="default"}[1m]))

  • Average Response Time of all Services:

sum(rate(istio_request_duration_milliseconds_sum{source_workload="apache|product-service|category-service",source_workload_namespace="default"}[1m])) / sum(rate(istio_request_duration_milliseconds_count{source_workload="apache|product-service|category-service",source_workload_namespace="default"}[1m]))

About

Abgabe für das Verteilte Systeme Labor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •