AllSetup
  • Introduction
  • Docker
  • Common commands
    • Various S3 utilities
    • Mac stuff
  • Mac stuff
  • Dockerfile examples
  • Docker GPU
  • TensorFlow
  • tensorFlow on iOS
  • Jupyter
  • iOS
  • SSD work
  • SSD using Inception
  • Object Detection
  • Docker GPU
  • TitBits
  • MySQL
  • FAIR Multipathnet
  • Git and GitFlow
  • Java Scala Mongo Installation
  • Devops
  • scratchpad
  • GCP Production
  • GStreamer
  • bash
  • Scala
  • Unix commands
  • Publish-Subscribe
  • Sensor-project
  • Flutter-project
Powered by GitBook
On this page
  • Containerizing scala backend
  • Kubernetes

Was this helpful?

Devops

Containerizing scala backend

  1. Logged in kops.<domain>.com as superuser (sudo su)

  2. cd /home/ubuntu/tf_files/cootbackend

  3. Used the Dockerfile in this location

  4. We need to definitely have the COPY <dir>-rest-services /<dir>-rest-services in the Dockerfile.

    Only then the image can have the resources we need to do the scala

  5. Build the image:

    docker build -t <dockerhub registry name>/<bkend-scala-image-v0:v0 .

  6. Run the image docker run -p 8091:8091 --name backend_service_v0 \ -it -v /home/ubuntu/tf_files:/tf_files <dockerhub registry name>/bkend-scala-image-v0:v0

    FRONT END
     docker build -t <dockerhub registry name>/-fend-react-image-v0:v0 .
     docker run -p 8080:80 --name _frontend_service_v0 \
         -it -v /home/ubuntu/tf_files:/tf_files <dockerhub registry name>/-fend-react-image-v0:v0
    
     # to run the container in detached mode and put the
     # CMD in the background, so that the xterm can be used
     # don't forget to open port 8080 as custom tcp port in AWS
     docker run -p 8080:80 --name _frontend_service_v0 -it -v /home/ubuntu:/home/ubuntu \
         -d <dockerhub registry name>/-fend-react-image-v0:v0

    Get a bash in docker VM docker exec -it f27eed929330 bash -c "export COLUMNS=tput cols; export LINES=tput lines; exec bash"

     Note: here the docker port 80(Right side) binds to host port 8080. Need to open port 8080 in AWS

Kubernetes

Horizontal pod autoscaling

HPA:
To setup HPA, first install metrics-server
Ref: https://github.com/kubernetes/kubernetes/issues/57996
        https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/metrics-server
        https://github.com/kubernetes-incubator/metrics-server
To get HPA metrics to start working
git clone https://github.com/kubernetes-incubator/metrics-server.git
cd metrics_server/metrics-server
kubectl create -f deploy/1.8+/
PreviousJava Scala Mongo InstallationNextscratchpad

Last updated 4 years ago

Was this helpful?

Ref:

https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics