I want to deploy the Spring MVC project into Azure through Kubernetes. I am having docker image. Please provide the guide for the steps. I am not much aware of Azure, kubernetes and docker. It will help if provide the guidance regarding step by step execution. Even what part should I learn to understand these technologies. Any good resource please?
I think if you are a new one to all the things, you'd better take a quick learn about the Docker, Kubernetes and Azure Kubernetes Service. When you know what they are and what they do for you, then you can follow the tutorial to learn how to deploy your project to Azure Kubernetes Service. I think it's the necessary steps and there is not any more simple way.
Related
I see there are many Github pages for gradle kubernetes plugin like
https://github.com/bmuschko/gradle-kubernetes-plugin
https://github.com/kolleroot/gradle-kubernetes-plugin
https://github.com/qaware/gradle-cloud-deployer
None of these having any concrete example how to connect to kubernetes from gradle and create a new deployment and service I tried all about git link in gradle but no luck...
Since I also faced a lack of plugins that deal with Kubernetes I started working on a Gradle plugin to make deploying resources to a Kubernetes cluster easier: https://github.com/kuberig-io/kuberig.
In the user manual you will find details about how to connect to a kubernetes cluster here:
https://kuberig-io.github.io/kuberig/#/initializing-an-environment
It also includes an example of how to define a deployment here: https://kuberig-io.github.io/kuberig/#/defining-a-deployment
And a service here:
https://kuberig-io.github.io/kuberig/#/defining-a-service
It may also be useful to go through the quickstart first https://kuberig-io.github.io/kuberig/#/quick-start.
Hope it can be of use to you.
I have a Spring Boot web application which is currently deployed Google App Engine. Now I am shifted to Docker and want to deploy the docker image of this application on to App Engine.
So far, I could not find any document related to this. Most of the documents explain how to deploy a docker image of Spring boot on Tomcat. Is there any way to achieve this?
First you need App Engine using the flexible environment , if you want deploy by docker image.
Here is the document Building Custom Runtimes.
A custom runtime allows you to use an alternate implementation of any supported App Engine flexible environment language, or to customize a Google-provided one. It also allows you to write code in any other language that can handle incoming HTTP requests (example). With a custom runtime, the App Engine flexible environment provides and manages your scaling, monitoring, and load balancing infrastructure for you, so you can focus on building your application.
In official case they have their sample DockeFile by jetty. But you can ignore the jetty part, just make your spring boot application executable ,and run it.
FROM gcr.io/google-appengine/jetty
ADD test-webapp-1.0-SNAPSHOT.war $JETTY_BASE/webapps/root.war
WORKDIR $JETTY_BASE
RUN java -jar $JETTY_HOME/start.jar --approve-all-licenses --add-to-startd=jmx,stats,hawtio
&& chown -R jetty:jetty $JETTY_BASE
Hopefully this helps:
https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/helloworld-springboot
One compelling benefit with Docker containers is that, when the containers works on one runtime (e.g. Tomcat), it should be relatively straighttforward to swap in a different runtime (e.g. App Engine).
NB App Engine Flexible is the specific service that you want. It is similar to App Engine Standard but it schedules containers for you.
The primarily requirement for a container (image) to work with App Engine Flexible is that the container expose an HTTP endpoint on port 8080. As long as your container meets this obligation, you can run anything within it.
Does anyone have experience with running Spring Cloud Micro Services in production?
I have about 10 micro services within one big Maven multi-project. This means that all the source code is under a single repo. The advantages are that it is easy to check out and manage the project in my IDE.
My concern is with CI as it means that the build server will need to figure out which services changed and deploy them respectively. Alternatively all the micro services will be deployed every time a change is committed.
I'm eyeing exploding the project into a source repo per micro service (my gut feel is that this is the correct approach). This way only the affected service is deployed.
My goal is to run every micro service as a container on Kubernetes.
Do you have any advise / tips / concerns that you can raise that might be an unwelcome surprise down the line?
More important than separating codebase is to create a separate CI/CD pipeline per microservice (running its own unit and integration tests), and another pipeline to integrate all microservices and run end-to-end tests.
Since you plan to release your microservices as Docker containers, consider a Docker Registry for versioning and distribution of your images.
Here are some references that follow this idea: DZone, Microsoft
Which is good in production environment? Individual embedded tomcat for each app or one tomcat for many apps?
The idea of making micro services is mainly to build services that are developed/ deployed/scaled independently. When you try to deploy multiple microservices inside a same container/jvm then you may not be able to leverage all these benefits. Also you CI/CD/integration testing may be hard. Try using embedded containers or container technologies like Docker which ensures complete isolation of the microservices.
The decision also depends on what is the deployment environment of yours. If its cloud going for Docker would be a good idea
Can we develop a struts+spring+hibernate application on tomcat server and later deploy it on say Web Sphere or Web logic Application servers?
If this can be done please explain the process of deployment? If this cannot be done please let me know the reason?
I am new to working with application servers. An explanation will be greatly helpful.
Thank you,
user181333
Most of the time, Spring is application server agnostic (but well, people always, always debate such things). That means that you should have no trouble deploying web applications in different containers.
Anyways, some portability issues may arise. The only ones I am aware of is classpath loading resources because of the servlet container implementation of class loading. Another is if you registered a TomcatInstrumentableClassLoader or something similar. And maybe JtaTransactionManager lookups.
For exact details in concern of deploying a web app just refer to the documentation of your specific application server.