Skip to content

yensky95/boutique-basic

Versioned Online Boutique Application achieved through SADP methodology.

Four different variants are available:

  • Normal High Performance
  • Normal Low Power
  • Basic High Performance
  • Basic Low Power

Those variants can be deployed on a kubernetes cluster using the respective shell scripts contained in the release folder.

Loadgenerator10/50/100 generated a respective load of users into the application deployed.

Cluster setup on GCE (Google Compute Engine):

  • Enter the Kubernetes Engine section
  • Create cluster
  • GKE Standard
  • Cluster basics: name, region (eu-westx-x), release channel (default)
  • Node Pools: name, number of nodes (3), Nodes -> image type (Container-Optimized OS with containerd (cos_containerd))
  • Series -> N1, Machine Type -> n1-standard-2
  • Networking -> Enable HTTP load balancing
  • Features -> Enable Cloud Logging (System and Workloads), Enable Cloud Monitoring (System and Workloads)

Cloud Storage Bucket:

  • Create bucket
  • name, region (europe-west-x), standard, uniform, data encryption (none)

Kubernetes setup after cluster is created:

Docker images build:

  • open a terminal inside the path of the microservice folder we want to build (e.g. boutique-basic/src/recommendationservice)
  • execute the docker build command:
    • docker build -t dockerhub_username/desired_name .
  • this will create a local image in docker
  • push this image to dockerhub (connect docker with dockerhub) with the button in the GUI or with command line

YAML files image change:

  • open the manifest file
  • search for the desired microservice for which we desire to change image
  • e.g. below
apiVersion: apps/v1
kind: Deployment
metadata:
  name: loadgenerator
spec:
  selector:
    matchLabels:
      app: loadgenerator
  replicas: 1
  template:
    metadata:
      labels:
        app: loadgenerator
      annotations:
        sidecar.istio.io/rewriteAppHTTPProbers: "true"
    spec:
      serviceAccountName: default
      terminationGracePeriodSeconds: 5
      restartPolicy: Always
      initContainers:
      - command:
        - /bin/sh
        - -exc
        - |
          echo "Init container pinging frontend: ${FRONTEND_ADDR}..."
          STATUSCODE=$(wget --server-response http://${FRONTEND_ADDR} 2>&1 | awk '/^  HTTP/{print $2}')
          if test $STATUSCODE -ne 200; then
              echo "Error: Could not reach frontend - Status code: ${STATUSCODE}"
              exit 1
          fi
        name: frontend-check
        image: busybox:latest
        env:
        - name: FRONTEND_ADDR
          value: "frontend:80"
      containers:
      - name: main
        image: yensky/loadgeneratortenusers:latest  <------ HERE (always put dockerhub_username/name:version_tag)
        env:
        - name: FRONTEND_ADDR
          value: "frontend:80"
        - name: USERS
          value: "10"
        resources:
          requests:
            cpu: 300m
            memory: 256Mi
          limits:
            cpu: 500m
            memory: 512Mi

Transfer a file from VM to Cloud Storage bucket:

  • open the Google Cloud Shell
  • gsutil cp file_name.xxx gs://bucket_name
  • go in the Google Cloud Storage bucket and download

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published