Run C program as EKS POD


Hi Team,

Currently we have a customer running application in C program compiled as dll's and hosted the apps into Windows 2016 server in their on-prem data center.

Now we have to migrate the apps into AWS cloud. Customer prefer to deploy this apps into container solution without code change.

Is it possible to run C program dlls into EKS with small code change ? If NOT then what is the best possible treatment we should offer to customers for this application seamlessly deployed into AWS cloud.


1 Answer
Accepted Answer

Depending on the application itself, it might be difficult to impossible to containerize such a Windows application (e.g. if it requires user interaction via Windows UI). You should first analyze and assess that application to understand whether it can be containerized.

If so, you have several options then.

Amazon EKS supports running Windows containers, see this blog post for details. Note that running applications in a Kubernetes cluster requires a deep understanding of how Kubernetes works.

If there is no requirement to use Kubernetes, you can consider Amazon ECS with Fargate for running your Windows containers. You can read this blog post that explains how to do this. By using Amazon ECS with Fargate, you can take advantage of the serverless, pay-as-you-go compute engine for running Windows applications.

If the application in question cannot be containerized, you can run it directly on Windows EC2 instances.


Considering the additional information you provided in the comment of this answer:

  • Containerizing a "headless" Windows app should be possible without large code changes. You will still need an executable that loads the app's DLL and runs the code functions.
  • Migrating a native C application code to a managed environment (e.g. .NET or Java) might be challenging; there are some incompatible features in the programming languages and runtimes such as memory management, pointers, object-oriented paradigm, and so on - thus, the code might need to change a lot. Also, a managed environment might execute some functions slower than a native one, so if performance is a strict requirement, this has to be measured.
  • With your current setup (a .NET webapp that calls a native C library), you should be able to integrate that library in the webapp as a dependency and containerize it. Then, use the container options mentioned above (Amazon ECS or Amazon EKS).
  • You can also separate the .NET webapp from the calculation engine and introduce another .NET webapp which will serve as a wrapper for the native library. Consider this approach if you want to offer that calculation engine as a microservice.
  • AWS offers a tool (Porting Assistant for .NET) for migrating from old .NET Framework to the new .NET platform, but not from native to managed.
  • AWS App2Container can help you containerize your existing .NET application.
profile picture
answered 9 days ago
  • Thanks @Dmitry for your response.

    This application contains logic of a calculation engine and also it doesn't have any UI. This application is yet again invoked by another neighboring application hosted in the same server. That caller application is a web application written in C#. It invokes DLL of this C application and get the calcs response.

    So it has only functions written inside for various calculations. Can we migrate this application into .NET core ? Do we have any supported tools in AWS for migrating to a new technology ?


  • Thank you for providing more details! I updated my answer.

  • I would add that, since the calculation engine library is written in C, that it may be worth assessing whether (and how many) Windows APIs (or MFC, Win32 API, etc) that the code uses. If it's none, or minimal, you may consider compiling the C library for Linux (using gcc or another compiler). If you then port your existing ASP.NET application to ASP.NET Core (and as Dmitry said, we have a tool to help with that), you could then move the entire application to Linux container(s), which would cost less, and launch/scale faster.

  • Thank you for sharing such a valuable information

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions