Class KubernetesJmxConnector

java.lang.Object
org.jolokia.client.jmxadapter.JolokiaJmxConnector
org.jolokia.kubernetes.client.KubernetesJmxConnector
All Implemented Interfaces:
Closeable, AutoCloseable, JMXConnector

public class KubernetesJmxConnector extends org.jolokia.client.jmxadapter.JolokiaJmxConnector
  • Field Details

    • KUBERNETES_CLIENT_CONTEXT

      public static String KUBERNETES_CLIENT_CONTEXT
  • Constructor Details

    • KubernetesJmxConnector

      public KubernetesJmxConnector(JMXServiceURL serviceURL, Map<String,?> environment)
  • Method Details

    • connect

      public void connect(Map<String,?> env) throws IOException
      Specified by:
      connect in interface JMXConnector
      Overrides:
      connect in class org.jolokia.client.jmxadapter.JolokiaJmxConnector
      Throws:
      IOException
    • createAdapter

      protected org.jolokia.client.jmxadapter.RemoteJmxAdapter createAdapter(org.jolokia.client.J4pClient client) throws IOException
      Throws:
      IOException
    • getApiClient

      public static io.fabric8.kubernetes.client.KubernetesClient getApiClient(String context)
      Get a kubernetes client for the specified local context (in ~/.kube/config)
      Parameters:
      context - , specify context, null for current context
      Returns:
      client configured for the specified context - potentially recycled as the setup is expensive (YAML parsing is amazingly slow)
    • resetKubernetesConfig

      public static void resetKubernetesConfig()
      Manually reset any cached config. To be uses in case you have changed your kubeconfig
    • expandAndProbeUrl

      protected org.jolokia.client.J4pClient expandAndProbeUrl(io.fabric8.kubernetes.client.KubernetesClient client, Map<String,Object> env) throws MalformedURLException
      Returns:
      a connection if successful
      Throws:
      MalformedURLException
    • buildProxyPath

      public static StringBuilder buildProxyPath(io.fabric8.kubernetes.api.model.Pod pod, String protocol, String port, String path)
    • probeProxyPath

      public static org.jolokia.client.J4pClient probeProxyPath(Map<String,Object> env, io.fabric8.kubernetes.client.KubernetesClient client, StringBuilder url, HashMap<String,String> headers)
      Probe whether we find Jolokia in given namespace, pod and path