This repository was archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds debug make target to rukpak. The debug target is essentially the same as the run target except that, once finished, it exposes a local port to allow for remote debugging in the rukpak core container. Signed-off-by: dtfranz <[email protected]>
- Loading branch information
Showing
7 changed files
with
150 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
kind: Cluster | ||
nodes: | ||
- role: control-plane | ||
extraPortMappings: | ||
- containerPort: 31111 | ||
hostPort: 40000 | ||
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0" | ||
protocol: tcp # Optional, defaults to tcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resources: | ||
- ../../../manifests/ | ||
- ./resources/service.yaml | ||
|
||
patchesJson6902: | ||
- target: | ||
group: apps | ||
version: v1 | ||
kind: Deployment | ||
name: core | ||
path: patch/remote_debug_command.yaml | ||
|
||
patchesStrategicMerge: | ||
- patch/install_dlv_init.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: rukpak-system | ||
name: core | ||
spec: | ||
template: | ||
spec: | ||
securityContext: | ||
runAsNonRoot: false | ||
volumes: | ||
- name: gobindir | ||
emptyDir: {} | ||
initContainers: | ||
- name: install-dlv | ||
env: | ||
- name: CGO_ENABLED | ||
value: "0" | ||
image: golang:1.17 | ||
command: | ||
- go | ||
args: | ||
- install | ||
- -ldflags | ||
- "-s -w -extldflags '-static'" | ||
- github.com/go-delve/delve/cmd/dlv@latest | ||
volumeMounts: | ||
- name: gobindir | ||
mountPath: /go/bin/ | ||
containers: | ||
- name: kube-rbac-proxy | ||
- name: manager | ||
volumeMounts: | ||
- name: gobindir | ||
mountPath: /go/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Move the original command to the beginning of the args array | ||
- op: copy | ||
from: /spec/template/spec/containers/1/command/0 | ||
path: /spec/template/spec/containers/1/args/0 | ||
# Set the command to /dlv | ||
- op: add | ||
path: /spec/template/spec/containers/1/command | ||
value: ["/go/bin/dlv"] | ||
# Prepend the args array with the following dlv args | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/0 | ||
value: "--listen=:40000" | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/1 | ||
value: "--continue" | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/2 | ||
value: "--headless=true" | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/3 | ||
value: "--api-version=2" | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/4 | ||
value: "--accept-multiclient" | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/5 | ||
value: "--log" | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/6 | ||
value: "exec" | ||
- op: add | ||
path: /spec/template/spec/containers/1/args/7 | ||
value: "--" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: core-remote-debug | ||
namespace: rukpak-system | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 40000 | ||
targetPort: 40000 | ||
nodePort: 31111 | ||
protocol: TCP | ||
selector: | ||
app: core |