Deploying Lagom Microservices on Kubernetes - maven

I'm trying to deploy Lagom microservices on Kubernetes by following-up the Chirper Lagom example. So According to the provided guide link, I configured a kubernetes cluster by installing Minikube and everything is good.
But when I tried to build Chirper Docker images by using fabric8’s docker-maven-plugin, I got this error:
[ERROR] Failed to execute goal
io.fabric8:docker-maven-plugin:0.20.1:build (default-cli) on project
friend-impl: Execution default-cli of goal
io.fabric8:docker-maven-plugin:0.20.1:build failed: No
given, no DOCKER_HOST environment variable, no read/writable
'/var/run/docker.sock' or '//./pipe/docker_engine' and no external
provider like Docker machine configured -> [Help 1]
Is there anyone that can help me to understand that error? Thanks.

[Updating based on discussions in comments]
The issue here is that the Docker CLI is not able to reach the Docker Engine. Since you are using Minikube, you can point docker CLI to Docker engine inside Minikube. That will ensure that images are built inside minikube VM and also ran there subsequently. You can run command:
eval $(minikube docker-env)
This command will set the parameters required by Docker CLI to communicate with Docker engine in Minikube and it should be able to run command which is failing for you!

Related

Maven docker goal bulds failing in newever version of AKS pods

When we are executing the docker-compose with maven plugin iside AKS based build agents of Azuredevops getting below err
"Failed to execute goal com.dkanejs.maven.plugins:docker-compose-maven-plugin:4.0.0:up (up) on project acceptance-tests: Cannot run program "docker-compose": error=2, No such file or directory "
We are aware that docker daemon is not supported for new version of Kubernetes and containerd is the replacement. But looking for alternate ways to get this done using containerd.

Is the docker daemon running? Spring-boot java project on Ubuntu

I have Ubuntu 22.04,
I have Java Spring-boot project, I run Idea, then run docker-compose.yml and get this message:
Cannot connect to the docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running? (Details:[13] Permission denied)
What should I check?
You can take this perfect Tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
The important section for you is: Step 2 — Executing the Docker Command Without Sudo (Optional)
Your Problem is that you try to use docker without sudo. You have no permission for that.

Error syncing pod on starting Beam - Dataflow pipeline from docker

We are constantly getting an error while starting our Beam Golang SDK pipeline (driver program) from a docker image which works when started from local / VM instance. We are using Dataflow runner for our pipeline and Kubernetes to deploy.
LOCAL SETUP:
We have GOOGLE_APPLICATION_CREDENTIALS variable set with service account for our GCP cluster. When running the job from local, job gets submitted to dataflow and completes successfully.
DOCKER SETUP:
Build image used is FROM golang:1.14-alpine. When we pack the same program with Dockerfile and try to run, it fails with error
User program exited: fork/exec /bin/worker: no such file or directory
On checking Stackdriver logs for more details, we see this:
Error syncing pod 00014c7112b5049966a4242e323b7850 ("dataflow-go-job-1-1611314272307727-
01220317-27at-harness-jv3l_default(00014c7112b5049966a4242e323b7850)"),
skipping: failed to "StartContainer" for "sdk" with CrashLoopBackOff:
"back-off 2m40s restarting failed container=sdk pod=dataflow-go-job-1-
1611314272307727-01220317-27at-harness-jv3l_default(00014c7112b5049966a4242e323b7850)"
Found reference to this error in Dataflow common errors doc, but it is too generic to figure out whats failing. After multiple retries, we were able to eliminate any permission / access related issues from pods. Not sure what else could be the problem here.
After multiple attempts, we decided to start the job manually from a new Debian 10 based VM instance and it worked. This brought to our notice that we are using alpine based golang image in Docker which may not have all the required dependencies installed to start the job.
On golang docker hub, we found a golang:1.14-buster where buster is codename for Debian 10. Using that for docker build helped us solve the issue. Self answering here to help anyone else facing the same issues.

GCloud: unable to listen on the Port defined by env variable

I am trying to deploy on Google Cloud Platform for the first time using the following two tutorials:
Gcloud build quickstart
Gcloud deploy quickstart
However, when running the final command gcloud builds submit --config cloudbuild.yaml, where cloudbuild.yaml is the name of the yaml file as per tutorial, throws the following error:
Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.
The image created by the build quickstart is not appropriate for the deploy quickstart. The latter, using Cloud Run needs something talking HTTP on port 8080.
If you using the deploy quickstart as-is, that should work. You can test this container image locally using:
docker run \
--interactive --tty \
--publish=8080:8080 \
gcr.io/gcbdocs/hello
and then try browsing or curling the endpoint http://localhost:8080. You should see Hello world!.
The error message from Cloud Run is somewhat generic and means that something went wrong. As a result it's often unhelpful.
If you're confident you're deploying a container image that talks HTTP on port 8080, I recommend you step through the instructions to try to see where you went wrong.

How to containerize the spring boot application without installing docker and deploying in centos

I have a spring boot application in my local machine , i want to containerize it without installing docker in local machine and i want to deploy it in a Cent Os machine which docker has installed in an offline mode .
while i have tried to containerizing it by building an image file , it is actually looking for Docker Daemon in local and the build is getting failed.
Using GoogleContainerTools' Jib you can easily build a Docker compliant container image without Docker installed.
You need to install the Jib plugin in your pom.xml or gradle.build file.
Here is a simple example: https://www.baeldung.com/jib-dockerizing
Without Docker engine you cannot containerize the application, Docker daemon is needed for creating the container for your spring boot application in unix. You can use ECS on AWS that can create the container without docker but lot of configurations and deep knowledge is needed for that.

Resources