2. CONFIDENTIAL Designator
Agenda
2
● Pitfalls when Debugging and Testing for OpenShift
● Options for Application Development on/for OpenShift
● Debugging remote applications using off-the-shelf tools
● Red Hat OpenShift IDE plugins:
○ Eclipse Plugin
○ IntelliJ IDEA Connector
○ Microsoft Visual Studio Code Extension Pack
● Red Hat CodeReady Studio
● Moving Forward
3. CONFIDENTIAL Designator
Classic Host Based Development
3
-Cucumber
-JUnit
-Mockito
Trusted code
repos
-Jira
-Trello
ISSUES
DEV
ENV
UNIT
TEST
Trusted artifact
and image repos
Dev Host
-SonarQube
-Fortify
-AtomicScan
-Blackduck
-Twistlock
-Sysdig
-Dynatrace
CI SYSTEM
CODE
QUAL
SEC
SCAN
INT
TEST
UAT
PROD
OPENSHIFT KUBERNETES PLATFORM
-Arquillian
-JUnit
5. CONFIDENTIAL Designator
Runtime Differences Between Dev Host and Cluster
5
● Monitoring
● Logging
● Certificate management
● Credentials
● Scaling (load based)
● Security
● Network
● Storage
6. CONFIDENTIAL Designator
Where Should Developers Debug and Test?
6
● IDE debug on local host
● IDE debug in Docker container(s) on local host
● IDE debug using Minishift/All-In-One on local host
● IDE debug on OpenShift cluster
● Develop & Debug using Red Hat OpenShift CodeReady Workspaces
7. CONFIDENTIAL Designator
Extending Debugging to Pods
7
-Cucumber
-JUnit
-Mockito
-SonarQube
-Fortify
-AtomicScan
-Blackduck
-Twistlock
Trusted code
repos
-Sysdig
-Dynatrace
-Jira
-Trello
CI SYSTEM
ISSUES
DEV
ENV
UNIT
TEST
CODE
QUAL
SEC
SCAN
INT
TEST
UAT
PROD
Trusted artifact
and image repos
OPENSHIFT KUBERNETES PLATFORM
-Arquillian
-JUnit
Dev Host
9. CONFIDENTIAL Designator
Debugging Java on a Remote Server/Container
9
# Run Java in Debug Mode on the remote server:
$ java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
# Optionally Connect to a Remote Server using Port Forwarding
$ ssh -L 8000:localhost:8000 root@<remoteserver>
# Connect your debugger
$ jdb -attach localhost:8000 -sourcepath ~/dev/remote/src/main/java/
# Port Forwarding to a Pod/Container
# oc/kubectl port-forward <pod> 8000:8000