Skip to content

Update federation example #715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/installation/04_obtain_coherence_images.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2020, Oracle and/or its affiliates.
Copyright (c) 2020, 2025 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at
http://oss.oracle.com/licenses/upl.

Expand Down Expand Up @@ -39,7 +39,7 @@ Once secrets have been created in the namespace that the `Coherence` resource is
can be specified in the `Coherence` CRD `spec`. It is possible to specify multiple secrets in the case where the different
images being used are pulled from different registries.

For example to use the commercial Coherence 14.1.1.0.0 image from OCR specify the image and image pull secrets in
For example to use the commercial Coherence 14.1.2.0.0 image from OCR specify the image and image pull secrets in
the `Coherence` resource yaml
[source,yaml]
----
Expand All @@ -48,7 +48,7 @@ kind: Coherence
metadata:
name: test-cluster
spec:
image: container-registry.oracle.com/middleware/coherence:14.1.1.0.0
image: container-registry.oracle.com/middleware/coherence:14.1.2.0.0
imagePullSecrets:
- name: coherence-secret # <1>
----
Expand Down
574 changes: 506 additions & 68 deletions examples/100_federation/README.adoc

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/100_federation/images/nsg-ocid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/100_federation/images/subnet-ocid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0'?>

<!--
~ Copyright (c) 2021, Oracle and/or its affiliates.
~ Copyright (c) 2021, 2025 Oracle and/or its affiliates.
~ Licensed under the Universal Permissive License v 1.0 as shown at
~ http://oss.oracle.com/licenses/upl.
-->
Expand All @@ -11,29 +11,29 @@
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">

<caching-scheme-mapping>
<cache-mapping>
<cache-mapping> <!--1-->
<cache-name>*</cache-name>
<scheme-name>server</scheme-name>
</cache-mapping>
</caching-scheme-mapping>

<caching-schemes>
<!-- federated caching scheme for servers -->
<federated-scheme>

<federated-scheme> <!--2-->
<scheme-name>server</scheme-name>
<backing-map-scheme>
<local-scheme/>
</backing-map-scheme>
<autostart>true</autostart>
<address-provider>
<local-address>
<local-address> <!--3-->
<address system-property="coherence.extend.address"/>
<port system-property="coherence.federation.port">40000</port>
</local-address>
</address-provider>
<topologies>
<topology>
<name>Active</name>
<name>Active</name> <!--4-->
</topology>
</topologies>
</federated-scheme>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<!--
~ Copyright (c) 2021, Oracle and/or its affiliates.
~ Copyright (c) 2021, 2025 Oracle and/or its affiliates.
~ Licensed under the Universal Permissive License v 1.0 as shown at
~ http://oss.oracle.com/licenses/upl.
~ https://oss.oracle.com/licenses/upl.
-->

<!--
Expand All @@ -23,31 +23,31 @@
<federation-config>
<participants>
<participant>
<name system-property="primary.cluster">PrimaryCluster</name>
<name system-property="primary.cluster"/> <!--1-->
<initial-action>start</initial-action>
<remote-addresses>
<socket-address>
<address system-property="primary.cluster.host">primary-cluster-federation</address>
<port system-property="primary.cluster.port">7574</port>
<address system-property="primary.cluster.address"/>
<port system-property="primary.cluster.port"/>
</socket-address>
</remote-addresses>
</participant>
<participant>
<name system-property="secondary.cluster">SecondaryCluster</name>
<name system-property="secondary.cluster"/> <!--2-->
<initial-action>start</initial-action>
<remote-addresses>
<socket-address>
<address system-property="secondary.cluster.host">secondary-cluster-federation</address>
<port system-property="secondary.cluster.port">7574</port>
<address system-property="secondary.cluster.address"/>
<port system-property="secondary.cluster.port"/>
</socket-address>
</remote-addresses>
</participant>
</participants>
<topology-definitions>
<active-active>
<name>Active</name>
<active system-property="primary.cluster">PrimaryCluster</active>
<active system-property="secondary.cluster">SecondaryCluster</active>
<name>Active</name> <!--3-->
<active system-property="primary.cluster"/>
<active system-property="secondary.cluster"/>
</active-active>
</topology-definitions>
</federation-config>
Expand Down
47 changes: 31 additions & 16 deletions examples/100_federation/src/main/yaml/primary-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, 2023 Oracle and/or its affiliates.
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
Expand All @@ -8,31 +8,46 @@
apiVersion: coherence.oracle.com/v1
kind: Coherence
metadata:
name: primary-cluster
name: primary-cluster # <1>
spec:
jvm:
classpath:
- /config
- /u01/oracle/oracle_home/coherence/lib/coherence.jar
args:
- "-Dprimary.cluster=primary-cluster"
- "-Dprimary.cluster.port=40000"
- "-Dprimary.cluster.host=primary-cluster-federation"
- "-Dsecondary.cluster=secondary-cluster"
- "-Dsecondary.cluster.port=40000"
- "-Dsecondary.cluster.host=secondary-cluster-federation"
secretVolumes:
env: # <2>
- name: "PRIMARY_CLUSTER"
value: "primary-cluster"
- name: "PRIMARY_CLUSTER_ADDRESS"
value: ""
- name: "PRIMARY_CLUSTER_PORT"
value: "40000"
- name: "SECONDARY_CLUSTER"
value: "secondary-cluster"
- name: "SECONDARY_CLUSTER_ADDRESS"
value: ""
- name: "SECONDARY_CLUSTER_PORT"
value: "40000"
secretVolumes: # <3>
- mountPath: /config
name: storage-config
ports:
- name: federation
- name: "federation" # <4>
port: 40000
protocol: TCP
service:
port: 40000
type: LoadBalancer
annotations: # <5>
oci.oraclecloud.com/load-balancer-type: "nlb"
oci-network-load-balancer.oraclecloud.com/internal: "true"
oci-network-load-balancer.oraclecloud.com/subnet: "(Internal subnet OCID - REPLACE ME)"
oci-network-load-balancer.oraclecloud.com/oci-network-security-groups: "(OCID of the NSG - REPLACE ME)"
- name: management
coherence:
cacheConfig: storage-cache-config.xml
overrideConfig: tangosol-coherence-override.xml
coherence: # <6>
cacheConfig: /config/storage-cache-config.xml
overrideConfig: /config/tangosol-coherence-override.xml
logLevel: 9
image: container-registry.oracle.com/middleware/coherence:14.1.1.0.0
image: container-registry.oracle.com/middleware/coherence:14.1.2.0.0 # <7>
imagePullSecrets:
- name: ocr-pull-secret
replicas: 2
replicas: 3
41 changes: 28 additions & 13 deletions examples/100_federation/src/main/yaml/secondary-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, 2023 Oracle and/or its affiliates.
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
Expand All @@ -14,25 +14,40 @@ spec:
classpath:
- /config
- /u01/oracle/oracle_home/coherence/lib/coherence.jar
args:
- "-Dprimary.cluster=primary-cluster"
- "-Dprimary.cluster.port=40000"
- "-Dprimary.cluster.host=primary-cluster-federation"
- "-Dsecondary.cluster=secondary-cluster"
- "-Dsecondary.cluster.port=40000"
- "-Dsecondary.cluster.host=secondary-cluster-federation"
env:
- name: "PRIMARY_CLUSTER"
value: "primary-cluster"
- name: "PRIMARY_CLUSTER_ADDRESS"
value: ""
- name: "PRIMARY_CLUSTER_PORT"
value: "40000"
- name: "SECONDARY_CLUSTER"
value: "secondary-cluster"
- name: "SECONDARY_CLUSTER_ADDRESS"
value: ""
- name: "SECONDARY_CLUSTER_PORT"
value: "40000"
secretVolumes:
- mountPath: /config
name: storage-config
ports:
- name: federation
- name: "federation"
port: 40000
protocol: TCP
service:
port: 40000
type: LoadBalancer
annotations:
oci.oraclecloud.com/load-balancer-type: "nlb"
oci-network-load-balancer.oraclecloud.com/internal: "true"
oci-network-load-balancer.oraclecloud.com/subnet: "(Internal subnet OCID - REPLACE ME)"
oci-network-load-balancer.oraclecloud.com/oci-network-security-groups: "(OCID of the NSG - REPLACE ME)"
- name: management
coherence:
cacheConfig: storage-cache-config.xml
overrideConfig: tangosol-coherence-override.xml
cacheConfig: /config/storage-cache-config.xml
overrideConfig: /config/tangosol-coherence-override.xml
logLevel: 9
image: container-registry.oracle.com/middleware/coherence:14.1.1.0.0
image: container-registry.oracle.com/middleware/coherence:14.1.2.0.0
imagePullSecrets:
- name: ocr-pull-secret
replicas: 2
replicas: 3
16 changes: 8 additions & 8 deletions examples/README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2021, Oracle and/or its affiliates.
Copyright (c) 2021, 2025 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at
http://oss.oracle.com/licenses/upl.

Expand Down Expand Up @@ -38,17 +38,17 @@ Building a simple Coherence image with a Dockerfile, that works out of the box w
--
Deploying the most basic Coherence cluster using the Operator.
--
====

[PILLARS]
====
[CARD]
.Coherence*Extend Clients
[link=examples/025_extend_client/README.adoc]
--
An example demonstrating various ways to configure and use Coherence*Extend with Kubernetes.
--
====

[PILLARS]
====
[CARD]
.Deployment
[link=examples/020_deployment/README.adoc]
Expand All @@ -74,9 +74,12 @@ An example covering the use of Kubernetes `NetworkPolicy` rules with the Operato
.Federation
[link=examples/100_federation/README.adoc]
--
This is a simple Coherence federation example. The federation feature requires Coherence Grid Edition.
This example shows configuring federation using Oracle Cloud. (OCI) The federation feature requires Coherence Grid Edition.
--
====

[PILLARS]
====
[CARD]
.Autoscaling
[link=examples/200_autoscaler/README.adoc]
Expand All @@ -97,10 +100,7 @@ Manage Coherence resources using Helm.
--
Istio Support
--
====

[PILLARS]
====
[CARD]
.Coherence Demo App
[link=examples/900_demo/README.adoc]
Expand Down
Loading