Skip to content

Commit 8eac093

Browse files
Update federation example (#715)
* Update federation example * Fix copyright tangosol-coherence-override.xml --------- Co-authored-by: Jonathan Knight <jk5766@outlook.com>
1 parent f52ec36 commit 8eac093

File tree

10 files changed

+592
-124
lines changed

10 files changed

+592
-124
lines changed

docs/installation/04_obtain_coherence_images.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///////////////////////////////////////////////////////////////////////////////
22

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

@@ -39,7 +39,7 @@ Once secrets have been created in the namespace that the `Coherence` resource is
3939
can be specified in the `Coherence` CRD `spec`. It is possible to specify multiple secrets in the case where the different
4040
images being used are pulled from different registries.
4141
42-
For example to use the commercial Coherence 14.1.1.0.0 image from OCR specify the image and image pull secrets in
42+
For example to use the commercial Coherence 14.1.2.0.0 image from OCR specify the image and image pull secrets in
4343
the `Coherence` resource yaml
4444
[source,yaml]
4545
----
@@ -48,7 +48,7 @@ kind: Coherence
4848
metadata:
4949
name: test-cluster
5050
spec:
51-
image: container-registry.oracle.com/middleware/coherence:14.1.1.0.0
51+
image: container-registry.oracle.com/middleware/coherence:14.1.2.0.0
5252
imagePullSecrets:
5353
- name: coherence-secret # <1>
5454
----

examples/100_federation/README.adoc

Lines changed: 506 additions & 68 deletions
Large diffs are not rendered by default.
Loading
64.8 KB
Loading
Loading

examples/100_federation/src/main/resources/storage-cache-config.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version='1.0'?>
22

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

1313
<caching-scheme-mapping>
14-
<cache-mapping>
14+
<cache-mapping> <!--1-->
1515
<cache-name>*</cache-name>
1616
<scheme-name>server</scheme-name>
1717
</cache-mapping>
1818
</caching-scheme-mapping>
1919

2020
<caching-schemes>
21-
<!-- federated caching scheme for servers -->
22-
<federated-scheme>
21+
22+
<federated-scheme> <!--2-->
2323
<scheme-name>server</scheme-name>
2424
<backing-map-scheme>
2525
<local-scheme/>
2626
</backing-map-scheme>
2727
<autostart>true</autostart>
2828
<address-provider>
29-
<local-address>
29+
<local-address> <!--3-->
3030
<address system-property="coherence.extend.address"/>
3131
<port system-property="coherence.federation.port">40000</port>
3232
</local-address>
3333
</address-provider>
3434
<topologies>
3535
<topology>
36-
<name>Active</name>
36+
<name>Active</name> <!--4-->
3737
</topology>
3838
</topologies>
3939
</federated-scheme>

examples/100_federation/src/main/resources/tangosol-coherence-override.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<!--
3-
~ Copyright (c) 2021, Oracle and/or its affiliates.
3+
~ Copyright (c) 2021, 2025 Oracle and/or its affiliates.
44
~ Licensed under the Universal Permissive License v 1.0 as shown at
55
~ http://oss.oracle.com/licenses/upl.
66
-->
@@ -23,31 +23,31 @@
2323
<federation-config>
2424
<participants>
2525
<participant>
26-
<name system-property="primary.cluster">PrimaryCluster</name>
26+
<name system-property="primary.cluster"/> <!--1-->
2727
<initial-action>start</initial-action>
2828
<remote-addresses>
2929
<socket-address>
30-
<address system-property="primary.cluster.host">primary-cluster-federation</address>
31-
<port system-property="primary.cluster.port">7574</port>
30+
<address system-property="primary.cluster.address"/>
31+
<port system-property="primary.cluster.port"/>
3232
</socket-address>
3333
</remote-addresses>
3434
</participant>
3535
<participant>
36-
<name system-property="secondary.cluster">SecondaryCluster</name>
36+
<name system-property="secondary.cluster"/> <!--2-->
3737
<initial-action>start</initial-action>
3838
<remote-addresses>
3939
<socket-address>
40-
<address system-property="secondary.cluster.host">secondary-cluster-federation</address>
41-
<port system-property="secondary.cluster.port">7574</port>
40+
<address system-property="secondary.cluster.address"/>
41+
<port system-property="secondary.cluster.port"/>
4242
</socket-address>
4343
</remote-addresses>
4444
</participant>
4545
</participants>
4646
<topology-definitions>
4747
<active-active>
48-
<name>Active</name>
49-
<active system-property="primary.cluster">PrimaryCluster</active>
50-
<active system-property="secondary.cluster">SecondaryCluster</active>
48+
<name>Active</name> <!--3-->
49+
<active system-property="primary.cluster"/>
50+
<active system-property="secondary.cluster"/>
5151
</active-active>
5252
</topology-definitions>
5353
</federation-config>
Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2021, 2023 Oracle and/or its affiliates.
2+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at
44
# http://oss.oracle.com/licenses/upl.
55
#
@@ -8,31 +8,46 @@
88
apiVersion: coherence.oracle.com/v1
99
kind: Coherence
1010
metadata:
11-
name: primary-cluster
11+
name: primary-cluster # <1>
1212
spec:
1313
jvm:
1414
classpath:
1515
- /config
1616
- /u01/oracle/oracle_home/coherence/lib/coherence.jar
17-
args:
18-
- "-Dprimary.cluster=primary-cluster"
19-
- "-Dprimary.cluster.port=40000"
20-
- "-Dprimary.cluster.host=primary-cluster-federation"
21-
- "-Dsecondary.cluster=secondary-cluster"
22-
- "-Dsecondary.cluster.port=40000"
23-
- "-Dsecondary.cluster.host=secondary-cluster-federation"
24-
secretVolumes:
17+
env: # <2>
18+
- name: "PRIMARY_CLUSTER"
19+
value: "primary-cluster"
20+
- name: "PRIMARY_CLUSTER_ADDRESS"
21+
value: ""
22+
- name: "PRIMARY_CLUSTER_PORT"
23+
value: "40000"
24+
- name: "SECONDARY_CLUSTER"
25+
value: "secondary-cluster"
26+
- name: "SECONDARY_CLUSTER_ADDRESS"
27+
value: ""
28+
- name: "SECONDARY_CLUSTER_PORT"
29+
value: "40000"
30+
secretVolumes: # <3>
2531
- mountPath: /config
2632
name: storage-config
2733
ports:
28-
- name: federation
34+
- name: "federation" # <4>
2935
port: 40000
36+
protocol: TCP
37+
service:
38+
port: 40000
39+
type: LoadBalancer
40+
annotations: # <5>
41+
oci.oraclecloud.com/load-balancer-type: "nlb"
42+
oci-network-load-balancer.oraclecloud.com/internal: "true"
43+
oci-network-load-balancer.oraclecloud.com/subnet: "(Internal subnet OCID - REPLACE ME)"
44+
oci-network-load-balancer.oraclecloud.com/oci-network-security-groups: "(OCID of the NSG - REPLACE ME)"
3045
- name: management
31-
coherence:
32-
cacheConfig: storage-cache-config.xml
33-
overrideConfig: tangosol-coherence-override.xml
46+
coherence: # <6>
47+
cacheConfig: /config/storage-cache-config.xml
48+
overrideConfig: /config/tangosol-coherence-override.xml
3449
logLevel: 9
35-
image: container-registry.oracle.com/middleware/coherence:14.1.1.0.0
50+
image: container-registry.oracle.com/middleware/coherence:14.1.2.0.0 # <7>
3651
imagePullSecrets:
3752
- name: ocr-pull-secret
38-
replicas: 2
53+
replicas: 3
Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2021, 2023 Oracle and/or its affiliates.
2+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at
44
# http://oss.oracle.com/licenses/upl.
55
#
@@ -14,25 +14,40 @@ spec:
1414
classpath:
1515
- /config
1616
- /u01/oracle/oracle_home/coherence/lib/coherence.jar
17-
args:
18-
- "-Dprimary.cluster=primary-cluster"
19-
- "-Dprimary.cluster.port=40000"
20-
- "-Dprimary.cluster.host=primary-cluster-federation"
21-
- "-Dsecondary.cluster=secondary-cluster"
22-
- "-Dsecondary.cluster.port=40000"
23-
- "-Dsecondary.cluster.host=secondary-cluster-federation"
17+
env:
18+
- name: "PRIMARY_CLUSTER"
19+
value: "primary-cluster"
20+
- name: "PRIMARY_CLUSTER_ADDRESS"
21+
value: ""
22+
- name: "PRIMARY_CLUSTER_PORT"
23+
value: "40000"
24+
- name: "SECONDARY_CLUSTER"
25+
value: "secondary-cluster"
26+
- name: "SECONDARY_CLUSTER_ADDRESS"
27+
value: ""
28+
- name: "SECONDARY_CLUSTER_PORT"
29+
value: "40000"
2430
secretVolumes:
2531
- mountPath: /config
2632
name: storage-config
2733
ports:
28-
- name: federation
34+
- name: "federation"
2935
port: 40000
36+
protocol: TCP
37+
service:
38+
port: 40000
39+
type: LoadBalancer
40+
annotations:
41+
oci.oraclecloud.com/load-balancer-type: "nlb"
42+
oci-network-load-balancer.oraclecloud.com/internal: "true"
43+
oci-network-load-balancer.oraclecloud.com/subnet: "(Internal subnet OCID - REPLACE ME)"
44+
oci-network-load-balancer.oraclecloud.com/oci-network-security-groups: "(OCID of the NSG - REPLACE ME)"
3045
- name: management
3146
coherence:
32-
cacheConfig: storage-cache-config.xml
33-
overrideConfig: tangosol-coherence-override.xml
47+
cacheConfig: /config/storage-cache-config.xml
48+
overrideConfig: /config/tangosol-coherence-override.xml
3449
logLevel: 9
35-
image: container-registry.oracle.com/middleware/coherence:14.1.1.0.0
50+
image: container-registry.oracle.com/middleware/coherence:14.1.2.0.0
3651
imagePullSecrets:
3752
- name: ocr-pull-secret
38-
replicas: 2
53+
replicas: 3

examples/README.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///////////////////////////////////////////////////////////////////////////////
22

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

@@ -38,17 +38,17 @@ Building a simple Coherence image with a Dockerfile, that works out of the box w
3838
--
3939
Deploying the most basic Coherence cluster using the Operator.
4040
--
41-
====
4241
43-
[PILLARS]
44-
====
4542
[CARD]
4643
.Coherence*Extend Clients
4744
[link=examples/025_extend_client/README.adoc]
4845
--
4946
An example demonstrating various ways to configure and use Coherence*Extend with Kubernetes.
5047
--
48+
====
5149
50+
[PILLARS]
51+
====
5252
[CARD]
5353
.Deployment
5454
[link=examples/020_deployment/README.adoc]
@@ -74,9 +74,12 @@ An example covering the use of Kubernetes `NetworkPolicy` rules with the Operato
7474
.Federation
7575
[link=examples/100_federation/README.adoc]
7676
--
77-
This is a simple Coherence federation example. The federation feature requires Coherence Grid Edition.
77+
This example shows configuring federation using Oracle Cloud. (OCI) The federation feature requires Coherence Grid Edition.
7878
--
79+
====
7980
81+
[PILLARS]
82+
====
8083
[CARD]
8184
.Autoscaling
8285
[link=examples/200_autoscaler/README.adoc]
@@ -97,10 +100,7 @@ Manage Coherence resources using Helm.
97100
--
98101
Istio Support
99102
--
100-
====
101103
102-
[PILLARS]
103-
====
104104
[CARD]
105105
.Coherence Demo App
106106
[link=examples/900_demo/README.adoc]

0 commit comments

Comments
 (0)