Skip to content

Latest commit

 

History

History
197 lines (142 loc) · 6.64 KB

File metadata and controls

197 lines (142 loc) · 6.64 KB

Quick Start

This guide is a simple set of steps to install the Coherence Operator and then use that to install a simple Coherence cluster.

Prerequisites

Ensure that the Coherence Operator prerequisites are available.

1. Install the Coherence Operator

If you want the default Coherence Operator installation then the simplest solution is use kubectl to apply the manifests from the Operator release.

kubectl apply -f https://github.com/oracle/coherence-operator/releases/download/v3.5.9/coherence-operator.yaml

This will create a namespace called coherence and install the Operator into it along with all the required ClusterRole and RoleBinding resources. The coherence namespace can be changed by downloading and editing the yaml file.

Note
Because the coherence-operator.yaml manifest also creates the namespace, the corresponding kubectl delete command will remove the namespace and everything deployed to it! If you do not want this behaviour you should edit the coherence-operator.yaml to remove the namespace section from the start of the file.

Alternatively Install Using Helm

Alternatively you can install the Operator using the Helm chart.

Add the Coherence Operator Helm repository

Add the Coherence Operator Helm repo to your local Helm.

helm repo add coherence https://oracle.github.io/coherence-operator/charts

helm repo update
Note
To avoid confusion, the URL https://oracle.github.io/coherence-operator/charts is a Helm repo, it is not a web site you open in a browser. You may think we shouldn’t have to say this, but you’d be surprised.

Install the Coherence Operator Helm chart

helm v3 install command
helm install  \
    --namespace <namespace> \
    <release-name> \
    coherence/coherence-operator

e.g. if the Kubernetes namespace is coherence-test the command would be:

helm v3 install command
helm install --namespace coherence-test  operator coherence/coherence-operator

or with Helm v2

helm install --namespace coherence-test  --name operator coherence/coherence-operator

See the full install guide for more details.

2. Install a Coherence Deployment

Ensure that the Coherence images can be pulled by the Kubernetes cluster, see Obtain Coherence Images. By default, a Coherence resource will use the OSS Coherence CE image from Docker Hub. If a different image is to be used the image name will need to be specified in the Coherence yaml, see Setting the Application Image for documentation on how to specify a different images to use.

2.1 Install a Coherence resource using the minimal required configuration.

The minimal required yaml to create a Coherence resource is shown below.

my-deployment.yaml
apiVersion: coherence.oracle.com/v1
kind: Coherence
metadata:
  name: my-deployment # (1)

The only required field is metadata.name which will be used as the Coherence cluster name, in this case my-deployment

kubectl -n <namespace> apply -f my-deployment.yaml
Note
Use the same namespace that the operator was installed into, e.g. if the namespace is coherence-test the command would be kubectl -n coherence-test create -f my-deployment.yaml

2.2 List the Coherence Resources

After installing the my-deployment.yaml above here should be a single Coherence resource named my-deployment in the Coherence Operator namespace.

kubectl -n <namespace> get coherence

or alternatively using the Coherence CRD a short name of coh

kubectl -n <namespace> get coh

e.g. if the namespace is coherence-test the command would be kubectl -n coherence-test get coherence

NAME                                                  AGE
coherence.coherence.oracle.com/my-deployment   19s

2.3 List all of the Pods for the Coherence resource.

The Coherence Operator applies a coherenceDeployment label to all Pods so this label can be used with the kubectl command to find Pods for a CoherenceCoherence resource.

kubectl -n <namespace> get pod -l coherenceDeployment=my-deployment

e.g. if the namespace is coherence the command would be: kubectl -n coherence get pod -l coherenceDeployment=my-deployment

NAME              READY   STATUS    RESTARTS   AGE
my-deployment-0   1/1     Running   0          2m58s
my-deployment-1   1/1     Running   0          2m58s
my-deployment-2   1/1     Running   0          2m58s

2.3 List all the Pods for the Coherence cluster.

The Coherence Operator applies a coherenceCluster label to all Pods, so this label can be used with the kubectl command to find all Pods for a Coherence cluster, which will be made up of multiple Coherence resources.

kubectl -n <namespace> get pod -l coherenceCluster=my-cluster

e.g. If there is a cluster named my-cluster made up of two Coherence resources in the namespace coherence-test, one named storage and one named front-end then the kubectl command to list all Pods for the cluster would be:

kubectl -n coherence-test get pod -l coherenceCluster=my-cluster

The result of which might look something like this

NAME          READY   STATUS    RESTARTS   AGE
storage-0     1/1     Running   0          2m58s
storage-1     1/1     Running   0          2m58s
storage-2     1/1     Running   0          2m58s
front-end-0   1/1     Running   0          2m58s
front-end-1   1/1     Running   0          2m58s
front-end-2   1/1     Running   0          2m58s

3. Scale the Coherence Cluster

3.1 Use kubectl to Scale Up

Using the kubectl scale command a specific Coherence resource can be scaled up or down.

kubectl -n <namespace> scale coherence/my-deployment --replicas=6

e.g. if the namespace is coherence-test the command would be: kubectl -n coherence scale coherence/my-deployment --replicas=6