• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
  • Create NCache Client in EKS
Show / Hide Table of Contents
  • Deploying NCache in Elastic Kubernetes Service
  • Create Elastic Kubernetes Cluster
  • Deploy NCache Resources in EKS
    • Manually Deploy NCache in EKS
      • Create NCache Deployment in EKS
      • Create Discovery Service in EKS
      • Create Access for NCache Management in EKS
    • Deploy NCache in EKS Through Operator
      • Create Service Account in EKS
      • Create Role Definition in EKS
      • Create Role Binding in EKS
      • Create NCache Operator in EKS
      • Create Custom Resources in EKS
  • Create NCache Client in EKS
  • Create NCache Client Deployment in EKS
  • Create Cache Cluster in EKS
  • Monitor NCache Cluster and Clients in EKS
  • Adding Cache Servers in EKS at Runtime
  • Removing Cache Severs in EKS at Runtime

Create Cache Client in Amazon EKS

After deploying the NCache headless cache discovery service for Amazon EKS, you can now deploy your NCache client application(s) in the cluster. There are multiple ways to create NCache client deployment and these vary depending upon your requirements.

Embed NCache Client Libraries in Application for Amazon EKS

Note

If you want to use OutProc client caches and monitor your client-side NCache performance counters, please refer to the next section instead.

To allow for the NCache clients to communicate with the servers, you can simply add the NCache client libraries to your application project solution. Using these, you can then use the NCache Client API to generate code for cache management and CRUD operations.

The NCache libraries also allow you to use InProc client caches but do not offer OutProc client caches to be shared between multiple applications running in same container nor can you monitor client-side performance counters.

For .NET applications, you can use NuGet packages to deploy NCache client in your cluster if you don't have NCache installed on the machine that is running your client application.

  • You will find the NuGet packages provided by Alachisoft at NCache NuGet Packages

  • To install these packages in your client application, follow the steps provided in Install NuGet in Microsoft Visual Studio

Use NCache Client Dockerfile

To create an image of your client application, you can create a Dockerfile that contains the commands to create a container image using either runtime .NET or .NET SDK. This allows you to use both InProc and OutProc client caches.

Create Client Dockerfile

To create your client Dockerfile, follow the steps mentioned below:

  • Access the Dockerfile provided by Alachisoft.

    • Place NCache installation setup tag.gz file in the resources folder.
Note

In case of .NET SDK, you need to change the base image tag in the Dockerfile to the one shown below and this will allow access to runtime and other packages like PowerShell tool to enable automating scripts from within the client containers.

FROM mcr.microsoft.com/dotnet/core/sdk

Method 1

  • Place your client application in the resources folder.
  • Go to startup.sh in the resources folder and replace sleep infinity with the name of your client application.
  • Save the startup.sh file.

Method 2

  • In the Dockerfile, add the path to your client application under the COPY command and save the file like shown below:
COPY [application path] .       # assuming you are in the /app directory
  • Go to the startup.sh file and replace the sleep infinity tag with the path of your application and save the file.
Tip

You can simply add your client application path in the ENTRYPOINT section of the Dockerfile and avoid using startup.sh altogether.

Create Docker Client Image

Once the Dockerfile is updated according to your requirements, execute the following commands from your build environment. These commands convert your client application's Dockerfile into a container image and upload it on the container registry.

docker build . -t [image tag]
docker push [repository]:[image tag]
Note
  • You need to have Docker installed on your machine to create your client Docker image.
  • You need to run these commands from inside the directory that contains your Dockerfile.

Import NCache PowerShell Tool

The advantage of creating your client image with .NET SDK is that it comes packed with not only .NET Runtime but also PowerShell tool. Hence, it is recommended to use .NET SDK environment in order to automate scripting in PowerShell.

Execute the following command on a shell platform to get access to PowerShell tool inside your client pod.

kubectl exec <client_pod_name> -- pwsh -NoExit

You can verify that you have entered PowerShell by the tag PS:>. Now, you need to import NCache PowerShell module to start using NCache specific PowerShell tools. Execute the following command in your PowerShell environment to import NCache PowerShell tools.

Note

To use NCache PowerShell module, NCache must be installed on your machine.

Import-Module /opt/ncache/bin/tools/ncacheps

This will allow you to execute PowerShell commands on any of the pods present inside the Amazon EKS cluster. From here on, you can start, stop, add, remove NCache nodes all while staying inside your cluster.

After creating and pushing the application container images to a Docker repository, e.g., DockerHub, ECR, you can then create and deploy the Kubernetes resources needed to run the NCache client applications on the Amazon EKS cluster.

The next step is to create NCache client deployment, explained in the next chapter.

See Also

Create Access for NCache Management in EKS
Create NCache Client Deployment in EKS
Create Cache Cluster in EKS
Monitor NCache Cluster and Clients in EKS

In This Article
  • Embed NCache Client Libraries in Application for Amazon EKS
  • Use NCache Client Dockerfile
    • Create Client Dockerfile
  • Create Docker Client Image
    • Import NCache PowerShell Tool
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top