> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/web-application-and-api-protection-waap/installation/platform-agent/kubernetes/jvm.md).

# JVM

You can install Traceable Java Agent in a Kubernetes environment. When you run the commands mentioned below, they automatically instrument any application in the namespace running in the JVM. Following is the compatibility matrix to make sure that you choose the right option.

### Supported frameworks

| **Library/Framework**                                                                                                          | **Versions** |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------ |
| [Apache HttpAsyncClient](https://hc.apache.org/index.html)                                                                     | 4.1+         |
| [Apache HttpClient](https://hc.apache.org/index.html)                                                                          | 4.0+         |
| [gRPC](https://github.com/grpc/grpc-java)                                                                                      | 1.6+         |
| [JAX-RS Client](https://javaee.github.io/javaee-spec/javadocs/javax/ws/rs/client/package-summary.html)                         | 2.0+         |
| [Micronaut](https://micronaut.io/) (basic support via Netty)                                                                   | 1.0+         |
| [Netty](https://github.com/netty/netty)                                                                                        | 4.0+         |
| [OkHttp](https://github.com/square/okhttp/)                                                                                    | 3.0+         |
| [Servlet](https://javaee.github.io/javaee-spec/javadocs/javax/servlet/package-summary.html)                                    | 2.3+         |
| [Spark Web Framework](https://github.com/perwendel/spark)                                                                      | 2.3+         |
| [Spring Webflux](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/reactive/package-summary.html) | 5.0+         |
| [Vert.x](https://vertx.io/)                                                                                                    | 3.0+         |
| [Struts](https://struts.apache.org/)                                                                                           | 2.3+         |

***

## Install Java agent

Complete the following steps to install the Java agent. Make sure that you have identified the namespace in which you would like to auto inject the agent.

1. Enter the following command to **label the namespace**

   ```actionscript
   kubectl label namespace $NAMESPACE traceableai-inject-java=enabled
   ```
2. Enter the following command to **annotate the Java deployment**

   ```actionscript
   kubectl patch deployment.apps/<JAVA_DEPLOYMENT> -p '{"spec": {"template": {"metadata": {"annotations": {"java.traceable.ai/inject": "true"}}}}}' -n <NAMESPACE>
   ```
3. Restart the deployments in that namespace so that the Traceable platform agent can inject the Java agent into your deployment:ActionScript

   ```actionscript
   kubectl rollout restart deployment -n <NAMESPACE>
   ```

***

## **Verify**

Check that the pods in the namespace have been injected with the Java agent by running the following command and verifying there is a `traceable-javaagent-init` initContainer.

```actionscript
kubectl describe pod <POD> -n <NAMESPACE>
...
Init Containers:
  traceable-javaagent-init:
    Container ID:  docker://a71000bd5bc2eab1f03c76c3156f6c8105c64b5baaa2c3ef1fce9434cd62aed5
    Image:         traceableai/javaagent:1.0.0
...
```
