-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Configure JPA L2 cache coordination between instances on Openshift® / Kubernetes #8982
Conversation
thread_pool.keep_alive_time="30000" /> | ||
|
||
<kubernetes.KUBE_PING | ||
namespace="${OPENSHIFT_KUBE_PING_NAMESPACE:eclipse-che}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand it is used for Kubernetes and OpenShift infrastructures. So let's rename env var to KUBERNETES_KUBE_PING_NAMESPACE
, or maybe even CHE_INFRA_KUBERNETES_KUBE__PING__NAMESPACE
to make it clear that it is infrastructure specific configuration property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove it here at all. But we still should pass it to container as is:
See
https://github.com/jgroups-extras/jgroups-kubernetes/blob/0.9.3/kube/src/main/java/org/jgroups/ping/kube/KubePing.java#L96
+
https://github.com/jgroups-extras/jgroups-kubernetes/blob/0.9.3/kube/src/main/java/org/jgroups/ping/kube/KubePing.java#L131
I will try to remove it from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you, but I'd define our own documented property into che.properties and che.env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it seems we can't use own prop-s here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe why we can't? Is not it just name of environment property that should be respected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the jgroups code. We can use custom system property. But env.variable should be named as in the links above.
@@ -64,6 +68,8 @@ items: | |||
name: http | |||
- containerPort: 8000 | |||
name: http-debug | |||
- containerPort: 8888 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it default value? Is it a different property from TCP_PORT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thats different one needed for KUBE_PING.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshaposhnik can you elaborate on how it is used? It is not clear for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I read the docs. But I mean kubernetes service. Without it there is no access to a port of a pod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is access if you know IP for a container. I think Kubernetes JGroups discovers pods/containers IPs itself.
If you access by service, actually you don't know which pod are you request if replication is more than 1. So, it's impossible to use service at all.
Maybe I'm wrong somewhere, but I imagine it in this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, agree about service.
But how the lib accesses k8s/OS API? which token or SA is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can set it into ENV or default will be used from here:
https://github.com/jgroups-extras/jgroups-kubernetes/blob/0.9.3/kube/src/main/java/org/jgroups/ping/kube/KubePing.java#L88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we need to be sure that this approach works in both kubernetes and openshift before the merge.
@@ -48,6 +48,10 @@ items: | |||
spec: | |||
containers: | |||
- env: | |||
- name: OPENSHIFT_KUBE_PING_NAMESPACE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be added the same changes to https://github.com/eclipse/che/blob/master/dockerfiles/init/modules/kubernetes/files/che-kubernetes.yaml?
Also maybe kubernetes helm plugin should be updated accordingly.
@garagatyi @l0rd I assume it may affect minishift addon, should it be updated or the corresponding issue created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find where this env var is used. @mshaposhnik @sleshchenko can you guys point me to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
private void configureMultiUserMode() { | ||
private void configureMultiUserMode( | ||
Map<String, String> persistenceProperties, String infrastructure) { | ||
if (OpenShiftInfrastructure.NAME.equals(infrastructure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hardcoding of infrastructure names makes Che less extensibility friendly. I would recommend using another approach where Che deployment can specify environment variable to configure JGROUPS. @mshaposhnik @skabashnyuk @sleshchenko WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of ohter places where it is configured in a such way. It is not easy to refactor them all. Probably it's another big issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@garagatyi how do you propose to implement in another way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skabashnyuk having an environment variable that enables what now is enabled by the name of the active infrastructure.
--> | ||
<config xmlns="urn:org:jgroups" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.1.xsd"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on whether there is a way to tweak this configuration in case service delivery team need to change something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably move filename into property. Then, changing conf will be as simple as put new xml conf file under classpath and change that property. That's a good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or no... that's already module. Need to find out way. Maybe discuss with @riuvshin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thank you.
@@ -48,6 +48,10 @@ items: | |||
spec: | |||
containers: | |||
- env: | |||
- name: OPENSHIFT_KUBE_PING_NAMESPACE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find where this env var is used. @mshaposhnik @sleshchenko can you guys point me to it?
@@ -64,6 +68,8 @@ items: | |||
name: http | |||
- containerPort: 8000 | |||
name: http-debug | |||
- containerPort: 8888 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshaposhnik can you elaborate on how it is used? It is not clear for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshaposhnik Is this already tested on a real cluster of it is just a POC?
@@ -64,6 +68,8 @@ items: | |||
name: http | |||
- containerPort: 8000 | |||
name: http-debug | |||
- containerPort: 8888 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshaposhnik If there is no service for this port how this port can be accessed from other pods?
@@ -48,6 +48,10 @@ items: | |||
spec: | |||
containers: | |||
- env: | |||
- name: OPENSHIFT_KUBE_PING_NAMESPACE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
--> | ||
<config xmlns="urn:org:jgroups" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.1.xsd"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thank you.
private void configureMultiUserMode() { | ||
private void configureMultiUserMode( | ||
Map<String, String> persistenceProperties, String infrastructure) { | ||
if (OpenShiftInfrastructure.NAME.equals(infrastructure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skabashnyuk having an environment variable that enables what now is enabled by the name of the active infrastructure.
Checked it works on K8S:
|
@mshaposhnik Can you also check on Openshift? |
It was developed on Openshift, because it is a primary goal of the issue. Kubernetes is just like an free bonus :) |
@mshaposhnik thank you for the clarification! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It would be better to name environment configuration as Infrastructure specific property, but I'm OK to merge it as it is because looks like there is no a way to define custom env variable name for kubernetes-jgroups
library.
<MFC max_credits="2M" | ||
min_threshold="0.4"/> | ||
<FRAG2 frag_size="60K"/> | ||
<!--RSVP resend_interval="2000" timeout="10000"/--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this commented configuration line?
@mshaposhnik I'm sorry but I've merged PR that moves deployment files to another folder. This has affected your PR. I think that the easiest way to adapt your PR is to rebase it against master and then move files that would be left from |
ci-test |
ci-test build report: |
What does this PR do?
Adds JGroups based coordination for EclipseLink L2 caches for multiple master instances on openshift or K8S infra.
What issues does this PR fix or reference?
#8922
Release Notes
Added JGroups based coordination for EclipseLink L2 caches for multiple master instances on openshift or K8S infra.
Docs PR
N/A