{"id":6684,"date":"2021-05-25T16:49:42","date_gmt":"2021-05-25T11:19:42","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/?p=6684"},"modified":"2021-05-25T16:53:33","modified_gmt":"2021-05-25T11:23:33","slug":"running-non-containerized-microservices","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2021\/05\/25\/running-non-containerized-microservices\/","title":{"rendered":"Running Non-containerized Microservices"},"content":{"rendered":"\n<p class=\"has-text-align-justify\">Whenever someone says orchestration for microservices, the first thing that usually comes to mind is Kubernetes. I believe that&#8217;s normal. I used to think the same but then I came across an interesting scenario that changed the way I used to think about microservice orchestration completely.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Usually, people think microservices mean containers, hence they build their application in a cloud-native approach so that it can easily run on any platform using the containerized approach. Well, I agree that containerization is a decent way of designing a cloud-native application especially when we integrate it with orchestrators like Kubernetes or OpenShift. It takes away a lot of overhead from us like:- scaling, failover, deployment, etc but it doesn&#8217;t imply that microservices can only be managed inside a containerized ecosystem. Microservice is an ideology or mindset for designing the application and containerization is a power-up that supports the ideology.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"has-text-align-justify\">Now, I believe you guys must be thinking what could be the possible scenario that containerization cannot support. Well, the kind of application I was dealing with was .net based which can only run on Windows platform. Now, obviously, we could use windows containers and we did try it but it&#8217;s still in the development phase and will take time to mature. Another way was to use static VMs but that will be a wastage of resources. Therefore, we didn&#8217;t go with those options and went with another option i.e. &#8220;Nomad&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Nomad?<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">Kubernetes is an orchestration system that is designed to manage the container ecosystem but, as we discussed, here we wanted to orchestrate a windows process (mainly windows IIS webserver-based process). It means we can say that Nomad is an orchestration engine that supports not only containerized but virtualized and standalone applications as well including Docker, Java, IIS on Windows, etc.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Nomad works in a plugin-based model in which you can leverage the existing plugins like Docker, Java, IIS or you can write a custom plugin as well using Golang-SDK.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Nomad doesn&#8217;t support Windows IIS webserver by default, to achieve this we need to install the plugin on the Nomad client nodes. We decided to go with the IIS plugin developed by Roblox Developers.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/Roblox\/nomad-driver-iis\" target=\"_blank\" rel=\"noreferrer noopener\">Check Here<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation using Nomad<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">While using the IIS plugin, we evaluated that there&#8217;re some gaps that needed to be filled.  So we decided to add those features by ourselves. Additional features which we have added are:-<\/p>\n\n\n\n<ul><li>Resource Limit on IIS<\/li><li>Recycle Parameters<\/li><li>Environment Variables<\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify\">Basic features of an orchestration engine was already supported by Nomad like:-<\/p>\n\n\n\n<ul><li>Scaling\/Autoscaling<\/li><li>Failover<\/li><li>Metrics Monitoring<\/li><li>Service Discovery<\/li><li>Service Mesh<\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify\">The plugin is available <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/iamabhishek-dubey\/nomad-driver-iis\" target=\"_blank\">here<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2021\/05\/nomad-architecture.png?w=1024\" alt=\"\" class=\"wp-image-6689\" width=\"700\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Since we are assuming Nomad and Consul are already part of the setup, we can directly jump to the configuration part of the IIS Job. If you haven&#8217;t and want to setup Nomad quickly, please <a href=\"https:\/\/learn.hashicorp.com\/nomad\" target=\"_blank\" rel=\"noreferrer noopener\">refer to this document<\/a><a href=\"https:\/\/learn.hashicorp.com\/nomad\" target=\"_blank\" rel=\"noopener\">.<\/a><\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">job \"iis-test\" {\n  datacenters = [\"dc1\"]\n  type = \"service\"\n\n  group \"iis-test\" {\n    count = 1\n    restart {\n      attempts = 10\n      interval = \"5m\"\n      delay = \"25s\"\n      mode = \"delay\"\n    }\n    task \"iis-test\" {\n      driver = \"win_iis\"\n\n      artifact {\n        source = \"https:\/\/github.com\/iamabhishek-dubey\/nomad-driver-iis\/releases\/download\/v0.4\/test-hello-world.zip\"\n      }\n      config {\n        path = \"${NOMAD_TASK_DIR}\\\\netcoreapp2.1\"\n\n        apppool_identity {\n          identity = \"NetworkService\"\n        }\n\n        bindings {\n          type = \"http\"\n          resource_port = \"httplabel\"\n        }\n      }\n      resources {\n        cpu    = 100\n        memory = 20\n        network {\n          port \"httplabel\" {}\n        }\n      }\n      service {\n        name = \"iis-test\"\n        tags = [\"iis-test\", \"windows-iis-test\"]\n        port = \"httplabel\"\n        check {\n          type = \"tcp\"\n          interval = \"10s\"\n          timeout = \"2s\"\n        }\n      }\n    }\n  }\n}\n<\/pre>\n\n\n\n<p class=\"has-text-align-justify\">Once the job configuration is complete, we can create the job using the Nomad UI in our cluster.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"685\" height=\"340\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2021\/05\/image-3.png?w=685\" alt=\"\" class=\"wp-image-6693\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Now, if you try to open the service on your browser, the content will look like this:-<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"606\" height=\"251\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2021\/05\/image-4.png?w=606\" alt=\"\" class=\"wp-image-6695\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">So as we can see the application is working fine here, now let&#8217;s see the service health on consul as well.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2021\/05\/image-5.png?w=1024\" alt=\"\" class=\"wp-image-6697\" width=\"700\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">As we can see the service looks healthy. Further, we can still try the orchestrator&#8217;s functionality, like, scaling. Scale the iis-test count and see what changes have been made by Nomad and Consul.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"568\" height=\"429\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2021\/05\/image-6.png?w=568\" alt=\"\" class=\"wp-image-6699\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"638\" height=\"378\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2021\/05\/image-7.png?w=638\" alt=\"\" class=\"wp-image-6700\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Once we have scaled the application count to 2, the nomad has started another IIS process for the application and the consul registered it as a second replica of the service. If we try to kill the process as well, the nomad will create another replica of the process just like Kubernetes ;). <\/p>\n\n\n\n<p class=\"has-text-align-justify\">If you want to access the code of the blog, please <a href=\"https:\/\/github.com\/iamabhishek-dubey\/nomad-driver-iis\" target=\"_blank\" rel=\"noreferrer noopener\">check this repository<\/a>. All the configuration files for nomad and consul are present inside the repository. Also, if you want to test out this setup quickly, there is a Vagrantfile in the repository. To execute the vagrant we simply need to run:-<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">vagrant up<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">By thinking out of the box, we solved the issue for non-containerized-based applications as well and we have achieved some basic functionalities of an orchestration engine like- scaling, failover, management, service discovery, etc. for Windows-based applications.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">But again, it doesn&#8217;t mean that this approach is restricted for Windows-based applications only, by using this plug-n-play method of Nomad we can solve a lot of issues.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">I hope you guys have enjoyed the reading but if you have any feedback or suggestions, please reach out to me. In my upcoming blog, I will discuss the production parameters for Nomad and Consul and how we can integrate autoscaling in nomad.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p> <strong>Blog Pundit:<\/strong>   <a href=\"https:\/\/opstree.com\/blog\/\/author\/adeel109\/\"><strong>Adeel Ahmad<\/strong><\/a> &amp; <a href=\"https:\/\/opstree.com\/blog\/\/author\/sandeep7c51ad81ba\/\"><strong>Sandeep Rawat<\/strong><\/a> <\/p>\n\n\n\n<p>Opstree is an End to End DevOps solution provider<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/www.opstree.com\/contact-us\" target=\"_blank\" rel=\"noreferrer noopener\">CONTACT US<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Whenever someone says orchestration for microservices, the first thing that usually comes to mind is Kubernetes. I believe that&#8217;s normal. I used to think the same but then I came across an interesting scenario that changed the way I used to think about microservice orchestration completely. Usually, people think microservices mean containers, hence they build &hellip; <a href=\"https:\/\/opstree.com\/blog\/2021\/05\/25\/running-non-containerized-microservices\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Running Non-containerized Microservices&#8221;<\/span><\/a><\/p>\n","protected":false},"author":89038429,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474],"tags":[115740126,1804072,14013,138063,448419,301202,800],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-1JO","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/6684"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/89038429"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=6684"}],"version-history":[{"count":25,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/6684\/revisions"}],"predecessor-version":[{"id":6900,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/6684\/revisions\/6900"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=6684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=6684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=6684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}