Implementación de Kubernetes y Docker

NCache Es totalmente compatible con varios tipos de Kubernetes, incluidos Azure Kubernetes Service (AKS), AWS Elastic Kubernetes Server (EKS), Google Kubernetes Engine (GKE), Red Hat OpenShift Kubernetes y más. NCache También es totalmente compatible con Docker.

Kubernetes
Docker
Servicio Azure Kubernetes
Servicio de Elastic Kubernetes
Red Hat OpenShift
Motor Kubernetes de Google
 

Despliegue NCache en un clúster de Kubernetes

Puedes desplegar NCache dentro de un clúster de Kubernetes y acceda a este NCache implementación tanto desde aplicaciones que se ejecutan dentro de Kubernetes como desde fuera. También puede administrar y monitorear estos NCache Clústeres que ejecutan Kubernetes desde fuera de Kubernetes. El siguiente diagrama muestra el despliegue de NCache en un clúster de Kubernetes. Esta imagen es la misma en Azure Kubernetes Service, Amazon Elastic Kubernetes Service, Google Kubernetes Engine (GKE), Red Hat OpenShift Kubernetes y cualquier otro entorno de Kubernetes.

NCache Conceptos del clúster de Kubernetes

A continuación se detallan algunos de los conceptos que se deben comprender en la implementación anterior de NCache en Kubernetes.

  1. NCache Servicio de descubrimiento: Este es un servicio sin cabeza que permite el acceso a las aplicaciones que se ejecutan dentro del clúster de Kubernetes. NCache Pods del servidor utilizando su nombre DNS. NCache Los pods del servidor no tienen una dirección IP fija, ya que se asigna cada vez que se inicia o reinicia un pod. Es por eso que el Servicio Discovery desempeña un papel fundamental al ayudar a los clientes a hablar con NCache Pods de servidor.
  2. NCache Puerta de enlace de gestión/monitoreo: Se requiere un servicio de puerta de enlace para administrar y monitorear NCache que se ejecuta dentro del clúster de Kubernetes desde fuera. Todas las operaciones de gestión/monitoreo se enrutan a través de esta puerta de enlace a NCache módulos de servidor. La puerta de enlace se puede configurar para enviar siempre el tráfico a un punto específico. NCache servidor Pod entonces NCache El Centro de gestión puede conectarse a él desde el exterior.
  3. NCache Operador de Kubernetes (viniendo): NCache proporciona un operador que maneja la activación y desactivación de licencias de todos los pods dentro de un NCache despliegue. El operador es consciente de NCache despliegue y activa un número específico de NCache licencias solo de servidor con anticipación para poder utilizarlas como NCache Los pods del servidor se inician o reinician.

Sabores de Kubernetes compatibles

  1. Azure Kubernetes Service (AKS): NCache admite implementaciones de AKS.
    - Obtener YAML
    - Vídeo de AKS
    - Documentos de AKS
  2. Servicio AWS Elastic Kubernetes (EKS): NCache admite implementaciones de EKS.
    - Obtener YAML
    - Vídeo EKS
    - Documentos de EKS
  3. Red Hat OpenShift Kubernetes: NCache admite implementaciones de OpenShift.
    - Obtener YAML
    - Vídeo de OpenShift
    - Documentos de OpenShift
  4. Motor de Google Kubernetes (GKE): NCache admite implementaciones de GKE.
    - Obtener YAML
    - Vídeo de GKE
    - Documentos de GKE

Compatibilidad con Docker

NCache Es totalmente compatible con Docker de las siguientes maneras.

1. Imágenes de Docker en Docker Hub

  • - NCache Enterprise
    • Edición .NET
    • estirar del estibador alachisoft/ncache:más reciente
    • Sistema operativo: Linux (Debian), Windows Server Core 2019
    • Edición Java
    • estirar del estibador alachisoft/ncache:último-java
    • Sistema operativo: Linux (Ubuntu), Windows Server Core 2019
  • - NCache Professional
    • estirar del estibador alachisoft/ncache:último-profesional
    • Sistema operativo: Linux (Debian), Windows Server Core 2019
  • - NCache Open Source
    • estirar del estibador alachisoft/ncache:opensource-servidor-5.0.4

2. Archivo Docker para imágenes Docker personalizadas

En la mayoría de las situaciones, está bien simplemente usando la imagen estándar de Docker de NCache de DockerHub. Pero, en algunos casos, es posible que desee crear una imagen de Docker personalizada que incluya su propio software u otras variaciones incluso del software estándar del sistema operativo.

Un ejemplo de esto es el sabor de Linux. NCache Docker Image en Docker Hub usa Debian Linux, pero es posible que desee otra versión de Linux para su NCache servidores; NCache funciona bien en múltiples sabores de Linux. O bien, es posible que desee crear una imagen de Docker personalizada para su servidor de aplicaciones (NCache Cliente) que contiene no sólo su propia aplicación, sino también NCache software del cliente.

En todos esos casos, Alachisoft le proporciona varios Dockerfiles que puede editar y personalizar para satisfacer sus necesidades.

Dockerfiles para NCache
Estos son algunos ejemplos de estos Dockerfiles que puede editar para crear una imagen de Docker personalizada.

Ejemplo de archivos Docker
Así es como funciona un Dockerfile típico "NCache Enterprise Servidor para Windows Server Core".

# Setting base image for NCache.
FROM microsoft/dotnet-framework:4.7.2-runtime

# Setting work directory to copy setups and resources for configuring NCache.
WORKDIR /app

# Make sure that the 2 folders ("resources" and "setup") exist in the same directory as the Dockerfile.
# Make sure that "IPBinding.ps1" script resides in the "resources" folder.
# Make sure that Microsoft Visual C++ 2010 x64 Redistributable setup is placed in the "setup" folder. It can be downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=14632.
# Make sure that NCache setup resides in the "setup" folder. It can be downloaded from http://www.alachisoft.com/download-ncache.html.
# Copying resources and setups into the work directory of the container.
COPY resources .
COPY setup .

# Exposing ports used by NCache for communication.
# Exposing the port at which NCache service will listen for incoming client connection requests.
EXPOSE 9800
# Exposing the port at which NCache service will listen for incoming management connection requests (NCache Manager, Monitor and Tools).
EXPOSE 8250
# Exposing the port at which Bridge service will listen for incoming connection requests from cache processes.
EXPOSE 9900
# Exposing the port at which Bridge service will listen for incoming Management connection requests (NCache Manager and Tools).
EXPOSE 8260

# Installing Microsoft Visual C++ 2010 x64 Redistributable (Prerequisite of NCache).
RUN vcredist_x64.exe /norestart /q

# Installing NCache setup.
# The parameter "INSTALLMODE" represents the NCache installation mode and has the following values:
# Rename this parameter to "EDITION" if you are building image for NCache version 4.8 or older.
#		Enterprise Server Install mode = "0"
#		Enterprise Remote Client Install mode = "3"
# The parameter "KEY" is the install key and is sent to user through e-mail once they download NCache setup. In case if user does not get a key, contact us at http://www.alachisoft.com/company/contact-us.html.
# The parameter "USERFIRSTNAME" represents the first name of the user.
# The parameter "USERLASTNAME" represents the last name of the user.
# The parameter "COMPANYNAME" represents the company the user works for.
# The parameter "EMAILADDRESS" represents the e-mail address of the user.
# The parameter "INSTALLDIR" represents the installation directory where NCache will be installed.
# the parameter "/qn" specifies that NCache will be installed silently without user interaction and will not prompt the user for anything.
RUN msiexec /i ncache.ent.x64.msi INSTALLMODE="0" KEY="XXXXXXXXXX" USERFIRSTNAME="John" USERLASTNAME="Smith" COMPANYNAME="Alachisoft" EMAILADDRESS="john@alachisoft.com" INSTALLDIR="C:\Program Files\NCache" /qn

# Currently, the IP during NCache installation is stored in the configuration files and it can not be made static at that point.
# However, the IP can be made static once the container is started.
# An IP Binding change task is scheduled to run when the container instance is started. This task replaces the IP with the actual IP assigned to the container.
# Creating one time executing IP Binding task that will change the IP in NCache Configuration files on the first time the container is started.
RUN schtasks /Create /TN IPBinding /SC ONSTART /TR "c:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe C:\app\IPBinding.ps1" /ru SYSTEM

# Entry point for the container, once all the required configurations have been made.
CMD start -Verbose

¿Qué hacer a continuación?

© Copyright Alachisoft 2002 - Todos los derechos reservados. NCache es una marca registrada de Diyatech Corp.