Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kubernetes process namespacing sharing for JDK appps
# Test pod to demonstrate process namespace sharing between tomcat (using the JRE) and
# OpenJDK tools (jmap, jstack, etc.)
# See https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/
# Deploy using: kubectl create -f process-test.yaml
# Exec into the jdk container: kubectl exec tomcat -c jdk -it bash
# Use some debug commands: jps, jmap, jstack, etc.
apiVersion: v1
kind: Pod
metadata:
name: tomcat
spec:
shareProcessNamespace: true
containers:
- name: tomcat
image: tomcat:9-jre11-slim
- name: jdk
image: openjdk:11-jdk-stretch
securityContext:
capabilities:
add:
- SYS_PTRACE
stdin: true
tty: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.