Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wstrange
Created January 3, 2019 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wstrange/9b84199654e0de8616140b614d4dd7cc to your computer and use it in GitHub Desktop.
Save wstrange/9b84199654e0de8616140b614d4dd7cc to your computer and use it in GitHub Desktop.
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