Hello World - Scala using Akka HTTP

    Follow the steps below to create the sample code and then deploy the app to your cluster. You can also download a working copy of the sample, by running the following commands:

    • A Kubernetes cluster installation with Knative Serving up and running.
    • installed locally, and running, optionally a Docker Hub account configured or some other Docker Repository installed locally.
    • Java JDK8 or later installed locally.
    • standard build tool sbt installed locally.

    Configuring the sbt build

    If you want to use your Docker Hub repository, set the repository to “docker.io/yourusername/yourreponame”.

    If you use Minikube, you first need to run:

    1. eval $(minikube docker-env)

    If want to use the Docker Repository inside Minikube, either set this to “dev.local” or if you want to use another repository name, then you need to run the following command after :

      You specify the repository in build.sbt:

      1. dockerRepository := Some("your_repository_name")

      You can learn more about the build configuration syntax .

      Importantly, in helloworld-scala.yaml change the image reference to match up with the repository, name, and version specified in the in the previous section.

      Publishing to Docker

      In order to build the project and create and push the Docker image, run either:

      1. sbt docker:publishLocal

      Which of them to use is depending on whether you are publishing to a remote or a local Docker Repository.

      Apply the :

      1. kubectl apply --filename helloworld-scala.yaml

      Then find the service host:

      Finally, to try your service, use the obtained URL:

      1. curl -v http://helloworld-scala.default.1.2.3.4.xip.io

      Cleanup