Theia Spring Boot Extension on K8s
Remote Debug Boot LS Running in K8s
Spring Boot LS Java application may need to be debugged while running in K8s pod environment. In order to facilitate remote debugging of Spring Boot LS process the following setup is required:
- Add or uncomment Boot LS launch JVM arguments enabling remote debugging. Open
theia-spring-boot/spring-boot/node/spring-boot-ls-contribution.tsfile, findjvmArgumentsproperty which is an array ofstringJVM arguments. Add-Xdebugand-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=7999arguments. - Build
theia-spring-bootdocker image using scripts ink8s-app/docker-boot-devfolder (i.e. buildtheia-spring-bootNPM package TGZ file then create docker image usingDockefilein the folder) - Deploy the created docker image on K8s using
k8s-app/deploy.ymlfile ork8s-app/deploy_theia_k8s.shscript. Ensure thatk8s-app/deploy.ymlhas the following in Service blockports:
ports:
- name: theia
port: 80
targetPort: 3000
- name: debug
nodePort: 30031
port: 7999
protocol: TCP
targetPort: 7999
Also it may need a containerPort under theia-spring-boot container:
ports:
- containerPort: 3000
- containerPort: 7999
Note that K8s container will have remote debugging connection available at port 7999 which will be exposed to the outside world on the 30031 port. Therefore, when attempting to attch remote debugger from local IDE port 30031 should be used.