Create Cache Deployment in Openshift
Kubernetes cluster is formed and the next step is to create NCache deployment in your Kubernetes cluster. This lets you perform operations on your cache cluster inside Kubernetes.
Create Deployment File in OpenShift
NCache deployment file is a YAML file which contains all the necessary configurations and the application's components. Given below is a YAML file called ncache.yaml containing sample configurations to demonstrate the deployment file.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: ncache
labels:
app: ncache
spec:
replicas: 2
template:
metadata:
labels:
app: ncache
spec:
containers:
- name: ncache
image: docker.io/alachisoft/ncache:enterprise-server-linux-5.0.2
ports:
- name: management-tcp
containerPort: 8250
- name: management-http
containerPort: 8251
- name: client-port
containerPort: 9800
Deploy the Deployment File
After creating the ncache.yaml file, it needs to be deployed using either the web portal or the command line tool.
Using Web Portal
Go to the project ncacheproject from the Projects.
Click on YAML from the options on the top.
Paste the NCache deployment file (ncache.yaml) in the YAML section. Click on the + button on the top right corner of the page to create the deployment. You can also create deployment by going to Workloads --> Deployments --> Create Deployment and drag and drop the YAML file in the empty deployment box.
Using Command Line Tool
Run the following command to create NCache deployment:
Important
Make sure to provide the complete path of the YAML files.
oc create -f ncache.yaml
You can also check the existing deployments by running the following command:
oc get deployments
You can also get the status of the pods after creating the NCache deployment. Following command is used to get the status of the pods.
oc get pods -o wide
The output window contains the information of the pods along with their IP addresses as shown below:
After creating NCache deployment, the next step is to create cache discovery service, explained in the next chapter.
See Also
Create New Project in Openshift
Create Cache Discovery Service in Openshift
Create Management Gateway in Openshift