I am having trouble while debugging the remote spring-boot application using vscode IDE.( I am not using any docker file in development as i am using the jib-maven plugin with skaffold to deploy on k8s. I assume this should cause any issue )
Below is the snapshot for k8s yaml file ( i have deleted few parts and replaced it with dot)
apiVersion: v1
kind: Service
metadata:
annotations:
.
.
.
.
.
.
.
.
name: ABC-service
spec:
ports:
- name: http
port: 8080
targetPort: 8080
- name: grpc
port: 50051
targetPort: 50051
selector:
app: ABC-service
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ABC-service
spec:
replicas: 1
selector:
matchLabels:
app: ABC-service
template:
metadata:
labels:
app: ABC-service
spec:
containers:
- ports:
- containerPort: 8080
- containerPort: 50051
- containerPort: 50005
env:
- name: SECURESTORE_SVC_HOST
value: securestore-svc
- name: SECURESTORE_SVC_PORT
value: "50051"
- name: IAM_SVC_HOST
value: iam-service-svc
- name: IAM_SVC_PORT
value: "50051"
name: ABC-service
imagePullPolicy: Always
image: ABC/ABC-service
imagePullSecrets:
- name: ABC-dev
Once my service is deployed , I perform below steps to debug
kubectl port-forward ABC-service-c59667c89-z5pzp 8080:8080
{
"type": "java",
"name": "Debug (Attach)",
"projectName": "MyApplication",
"request": "attach",
"hostName": "localhost",
"port": 8080
}
here debugger keeps waiting to connect but never gets attached and eventually times out. I followed many tutorials but not sure what I am messing up.
In launch.json, add
"console": "internalConsole",
Try this and see if question goes away.