Skip to content

8237: Add support for Jolokia over Kubernetes proxy#576

Draft
skarsaune wants to merge 38 commits intoopenjdk:masterfrom
skarsaune:JMC-8237-kubernetes-proxy
Draft

8237: Add support for Jolokia over Kubernetes proxy#576
skarsaune wants to merge 38 commits intoopenjdk:masterfrom
skarsaune:JMC-8237-kubernetes-proxy

Conversation

@skarsaune
Copy link
Contributor

@skarsaune skarsaune commented Aug 4, 2024

JMC-8273 : Use the jolokia protocol over a kubernetes http proxy.

Testing connectivity:

  • Docker desktop kubernetes
  • Azure AKS
  • Amazon EKS
  • Google GKE

Other things observed:

  • * Option to install agent should be disabled (debug difference with jolokia) - see below*
  • * Warning: NLS missing message: JmcKubernetesPreferenceForm_LogErrorsTooltip in: org.openjdk.jmc.kubernetes.preferences.messages
  • * SLF4J(W): No SLF4J providers were found. OK for now, can investigate more later
    SLF4J(W): Defaulting to no-operation (NOP) logger implementation
    SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
  • Unlocking secrets now appear on startup. Should not be needed unless there are credentials used. (fixed)

Progress

  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JMC-8237: Add support for Jolokia over Kubernetes proxy (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jmc.git pull/576/head:pull/576
$ git checkout pull/576

Update a local copy of the PR:
$ git checkout pull/576
$ git pull https://git.openjdk.org/jmc.git pull/576/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 576

View PR using the GUI difftool:
$ git pr show -t 576

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jmc/pull/576.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 4, 2024

👋 Welcome back skarsaune! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 4, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@skarsaune skarsaune changed the title JMC-8237: Connect with Jolokia protocol over kubernetes HTTP proxy JMC-8237: Connect with Jolokia protocol over kubernetes proxy Aug 9, 2024
@skarsaune skarsaune changed the title JMC-8237: Connect with Jolokia protocol over kubernetes proxy JMC-8237: Add support for Jolokia over Kubernetes proxy Aug 9, 2024
@openjdk openjdk bot changed the title JMC-8237: Add support for Jolokia over Kubernetes proxy 8237: Add support for Jolokia over Kubernetes proxy Aug 9, 2024
@thegreystone thegreystone requested a review from aptmac September 25, 2024 17:10
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 29, 2024

@skarsaune This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@skarsaune
Copy link
Contributor Author

The cause for the log initialization output is calling Utils.getSystemPropertyOrEnvVar . That is only used very briefly for that very particular use. Can look for alternatives.

@skarsaune
Copy link
Contributor Author

The cause for the log initialization output is calling Utils.getSystemPropertyOrEnvVar . That is only used very briefly for that very particular use. Can look for alternatives.

However, other fabric8.io methods need slf4j quite immediately after that. As the log statement states, it will default to a NOOP logger that we believe is sufficient at this point (problems scanning contexts will manifest themselves as exceptions that should be sufficient to troubleshoot).

@skarsaune
Copy link
Contributor Author

Found the "issue" with the JMC agent.

public boolean isLocalJvm() { return connectionHandle.getServerDescriptor().getJvmInfo() != null; }
Will experiment with not providing getJvmInfo for jolokia and kubernetes

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 24, 2024

@skarsaune This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@skarsaune
Copy link
Contributor Author

Finding on the Jolokia side. When probing connection k8s API authorization is missing. This can be fixed by using fabric8 http client instead of using OK Http directly.

@openjdk
Copy link

openjdk bot commented Jan 3, 2025

@skarsaune this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JMC-8237-kubernetes-proxy
git fetch https://git.openjdk.org/jmc.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 9, 2025

@skarsaune This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 8, 2025

@skarsaune This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Dec 8, 2025
JolokiaServiceManager serviceManager = JolokiaServiceManagerFactory.createJolokiaServiceManager(configuration,
new JulLogHandler(PLUGIN_ID), new AllowAllRestrictor(),
() -> new TreeSet<ServerDetector>(Arrays.asList(ServerDetector.FALLBACK)));
logHandleer -> new TreeSet<ServerDetector>(Arrays.asList(ServerDetector.FALLBACK)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, should be "logHandler"

@@ -0,0 +1,3 @@
#Properties file for org.openjdk.jmc.kubernetes
page.name = Kubernetes
Bundle-Name = Kubernetes JMC extensions No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline at the end of the file

@Override
protected J4pResponse unwrapException(J4pException e) throws IOException, InstanceNotFoundException {
// recognize signs of disconnect and signal to the application for better
// handling
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could the comment be one line?

@Override
public boolean scanForInstances() {
// If credentials are locked and credentials are required, the scanner thread
// will get hung
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment could probably be one line less too?

new File(System.getProperty("user.home"), ".kube" + File.separator + "config").toString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
File configPath = new File(path);
if (contexts != null && contextsCached > configPath.lastModified()) {// the YAML parsing is soo incredibly
// sloow, hence cache context names for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comments here could be moved to fit onto a single line?

Copy link
Member

@aptmac aptmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally got around to giving this PR a test, and it's looking good from what I've done so far.

Code-wise it looks good, from a formatting standpoint there's some inconsistency in using new lines with comments, I'll point some out.

I think this is ready for re-testing, the licenses will just need to be updated to be 2026, and potentially the dependencies updated along with rebasing ontop of main.

@aptmac
Copy link
Member

aptmac commented Jan 22, 2026

/open

@openjdk
Copy link

openjdk bot commented Jan 22, 2026

@aptmac Only the pull request author can set the pull request state to "open"

@skarsaune
Copy link
Contributor Author

/open

@openjdk openjdk bot reopened this Jan 22, 2026
@openjdk
Copy link

openjdk bot commented Jan 22, 2026

@skarsaune This pull request is now open

@skarsaune
Copy link
Contributor Author

skarsaune commented Jan 22, 2026

Finally got around to giving this PR a test, and it's looking good from what I've done so far.

Code-wise it looks good, from a formatting standpoint there's some inconsistency in using new lines with comments, I'll point some out.

I think this is ready for re-testing, the licenses will just need to be updated to be 2026, and potentially the dependencies updated along with rebasing ontop of main.

Yeah, it has been stale for a bit. I will fix the formatting. I have to merge/rebase and retest everything once #695 is merged.

@aptmac
Copy link
Member

aptmac commented Jan 22, 2026

Great, I sponsored that and it's integrated now

@aptmac
Copy link
Member

aptmac commented Jan 23, 2026

It's stuck on some formatting, it'll fix once you run mvn spotless:apply

@skarsaune skarsaune marked this pull request as draft January 23, 2026 14:53
@skarsaune
Copy link
Contributor Author

Setting to draft, and resetting test status boxes. Needs retest now.

@openjdk openjdk bot removed the rfr label Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants