Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A lot of changes to make 'agentless' and 'port-forward' the mainstream options, now works with containerd. Re-worked README #154

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
d141c58
Bump github.com/containerd/containerd from 1.3.3 to 1.4.12
dependabot[bot] Nov 18, 2021
ce2cd10
Merge pull request #1 from JamesTGrant/dependabot/go_modules/github.c…
JamesTGrant Nov 29, 2021
2f5bd34
1st update to readme
JamesTGrant Nov 29, 2021
46d9327
updating readme
JamesTGrant Nov 29, 2021
779fbe6
go report card
JamesTGrant Nov 29, 2021
584e2a2
line feeds in readme
JamesTGrant Nov 29, 2021
fb57fdf
Readme formatting
JamesTGrant Nov 29, 2021
d8090d2
more readme updates
JamesTGrant Nov 29, 2021
784315d
more readme changes
JamesTGrant Nov 30, 2021
b322996
more readme changes
JamesTGrant Nov 30, 2021
a0526ba
readme typo
JamesTGrant Nov 30, 2021
d0c6586
readme indentation
JamesTGrant Nov 30, 2021
eb07117
moved readme toc
JamesTGrant Nov 30, 2021
1aef9f3
readme layout improvements
JamesTGrant Nov 30, 2021
de98cfb
minor readme typos
JamesTGrant Nov 30, 2021
f459b70
added a bit about required privelidge
JamesTGrant Nov 30, 2021
75ccb4e
typo
JamesTGrant Nov 30, 2021
69ee442
Readme.md changes
JamesTGrant Nov 30, 2021
b48cb9b
more readme.md changes
JamesTGrant Nov 30, 2021
811fc33
readme tidy up
JamesTGrant Nov 30, 2021
6801eba
fix examples.md
JamesTGrant Nov 30, 2021
4da64cf
Readme changes
JamesTGrant Nov 30, 2021
23e25e5
readme spaces
JamesTGrant Nov 30, 2021
fbcee56
dedup readme
JamesTGrant Nov 30, 2021
0aea019
Readme oc update
JamesTGrant Nov 30, 2021
5eea41a
updated design doc to reflect current implementation
JamesTGrant Nov 30, 2021
865cf9b
deisgn.md change
JamesTGrant Nov 30, 2021
83b454e
more design.md changes
JamesTGrant Nov 30, 2021
cbc89ab
more design typo fixes
JamesTGrant Nov 30, 2021
0ea046a
typo
JamesTGrant Nov 30, 2021
5077ecb
remove obsolete docs and folders
JamesTGrant Nov 30, 2021
00bb77a
update gorealeaser and bump alpine version
JamesTGrant Nov 30, 2021
cde3f86
getting ready for surgery
JamesTGrant Nov 30, 2021
15fdf49
changes in cmd
JamesTGrant Dec 1, 2021
19b7e99
tidy up main.go
JamesTGrant Dec 1, 2021
2844e7f
main.go tidy up
JamesTGrant Dec 1, 2021
a365565
tidyup config.go
JamesTGrant Dec 1, 2021
6971a50
tidy up and changes
JamesTGrant Dec 1, 2021
9bd0de6
openAPIv2 not in later gnositic versions
JamesTGrant Dec 1, 2021
885c324
gnostic 0.4.0
JamesTGrant Dec 1, 2021
32aadac
gnositc further back
JamesTGrant Dec 1, 2021
4590671
gnostic version mod
JamesTGrant Dec 1, 2021
9238974
test
JamesTGrant Dec 1, 2021
79fb0d8
go version
JamesTGrant Dec 1, 2021
d75108e
go.mod and go.sum revert
JamesTGrant Dec 1, 2021
0144bbd
go.mod and go.sum revert
JamesTGrant Dec 1, 2021
71b5028
fat fingered const typos
JamesTGrant Dec 1, 2021
b7ac35b
remove home directory and user reference
JamesTGrant Dec 1, 2021
53f686e
remove import of os/user
JamesTGrant Dec 1, 2021
67a0647
renamed folders and packages to reflect thier current purposes
JamesTGrant Dec 2, 2021
46f3c0f
fixed a typo in a couple of paths
JamesTGrant Dec 2, 2021
243c275
refactoring agentless
JamesTGrant Dec 2, 2021
dcd02f7
cmd and readme modifications
JamesTGrant Dec 2, 2021
83a8fa4
remove hyphen from package name
JamesTGrant Dec 2, 2021
4598296
fix typos
JamesTGrant Dec 2, 2021
961c1ce
typo
JamesTGrant Dec 2, 2021
1b81b86
package typo
JamesTGrant Dec 2, 2021
c287420
package name typo
JamesTGrant Dec 2, 2021
b0d129f
typo
JamesTGrant Dec 2, 2021
2a31983
repo change for debug-agent container image
JamesTGrant Dec 2, 2021
e520fda
debugging pod clean up
JamesTGrant Dec 2, 2021
ab54042
adding much needed carrage returns to debug messages
JamesTGrant Dec 2, 2021
49e63b3
Added new line returns to bug lines
JamesTGrant Dec 2, 2021
41bec9b
adding more debug
JamesTGrant Dec 2, 2021
2cea77c
more debug
JamesTGrant Dec 2, 2021
a62b477
set the wrong default debug-container image
JamesTGrant Dec 2, 2021
76c5254
remove hardcoded cfg values are depricated config param
JamesTGrant Dec 2, 2021
6508625
committed to testing
JamesTGrant Dec 2, 2021
5967e2e
last commit of the day
JamesTGrant Dec 2, 2021
1d7cfc3
updating README and removing examples.md
JamesTGrant Dec 3, 2021
19aa374
more README improvements and examples
JamesTGrant Dec 3, 2021
4462a41
More README finessing
JamesTGrant Dec 3, 2021
b9fdffc
more Readme layout improvements
JamesTGrant Dec 3, 2021
4a7cf2d
README layout changes
JamesTGrant Dec 3, 2021
422fcf3
remove travis yaml
JamesTGrant Dec 3, 2021
43051a4
Did release, updated README
JamesTGrant Dec 3, 2021
7c4f84a
slight typo improvement
JamesTGrant Dec 7, 2021
7922e30
Update README.md
JamesTGrant Jan 31, 2022
f805266
Updated following chat with Aylei
JamesTGrant Jan 31, 2022
1568e69
Update README.md
JamesTGrant Jan 31, 2022
09d5f51
Update README.md
JamesTGrant Jan 31, 2022
b87963b
Update README.md
JamesTGrant Jan 31, 2022
58d5208
debug message tweak and readme tweak
JamesTGrant Jan 31, 2022
21f6f90
Merge branch 'master' of https://github.com/JamesTGrant/kubectl-debug
JamesTGrant Jan 31, 2022
61cb2c9
Update README.md
JamesTGrant Mar 17, 2022
bfdcc8c
fix(pkg/kubectl-debug/cmd): fix incorrect code
bestgopher Jun 1, 2022
a6e6ca2
Merge pull request #2 from bestgopher/master
JamesTGrant Jun 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ builds:
- CGO_ENABLED=0
- GO111MODULE=on
binary: kubectl-debug
main: ./cmd/plugin/main.go
main: ./cmd/kubectl-debug/main.go
goos:
- freebsd
- windows
Expand All @@ -21,7 +21,7 @@ builds:
- goos: darwin
goarch: 386
ldflags:
- -s -w -X 'github.com/aylei/kubectl-debug/version.gitVersion={{.Version}}'
- -s -w -X 'github.com/jamestgrant/kubectl-debug/version.gitVersion={{.Version}}'
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -34,12 +34,12 @@ changelog:
- '^test:'
brew:
github:
owner: aylei
owner: jamestgrant
name: homebrew-tap
commit_author:
name: aylei
email: rayingecho@gmail.com
name: jamestgrant
email: jamesrgrant@mediakind.com
install: |
bin.install "kubectl-debug"
homepage: "https://www.github.com/aylei/kubectl-debug"
description: "Debug your pod by a new container with every troubleshooting tools pre-installed"
homepage: "https://www.github.com/jamestgrant/kubectl-debug"
description: "Debug a troublesome container using a dubug container which contains all your favorite troubleshooting tools pre-installed and runs in the same cgroup/ipc/network namespace as your troublesome container"
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.11.5 as build
FROM alpine:3.15.0 as build

RUN apk add lxcfs containerd

FROM alpine:3.11.5
FROM alpine:3.15.0

COPY --from=build /usr/bin/lxcfs /usr/bin/lxcfs
COPY --from=build /usr/lib/*fuse* /usr/lib/
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
.PHONY: build plugin agent check
.PHONY: build kubectl-debug-binary debug-agent-binary debug-agent-docker-image check

LDFLAGS = $(shell ./version.sh)
GOENV := GO15VENDOREXPERIMENT="1" GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64
GO := $(GOENV) go

default: build

build: plugin agent-docker
build: kubectl-debug-binary debug-agent-docker-image

plugin:
GO111MODULE=on CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o kubectl-debug cmd/plugin/main.go
kubectl-debug-binary:
GO111MODULE=on CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o kubectl-debug cmd/kubectl-debug/main.go

agent-docker: agent
docker build . -t aylei/debug-agent:latest
debug-agent-docker-image: debug-agent-binary
docker build . -t jamesgrantmediakind/debug-agent:latest

agent:
$(GO) build -ldflags '$(LDFLAGS)' -o debug-agent cmd/agent/main.go
debug-agent-binary:
$(GO) build -ldflags '$(LDFLAGS)' -o debug-agent cmd/debug-agent/main.go

check:
find . -iname '*.go' -type f | grep -v /vendor/ | xargs gofmt -l
Expand Down
515 changes: 341 additions & 174 deletions README.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions cmd/agent/main.go → cmd/debug-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package main

import (
"flag"
"github.com/jamestgrant/kubectl-debug/pkg/debug-agent"
"log"

"github.com/aylei/kubectl-debug/pkg/agent"
)

func main() {
Expand All @@ -13,12 +12,12 @@ func main() {
flag.StringVar(&configFile, "config.file", "", "Config file location.")
flag.Parse()

config, err := agent.LoadFile(configFile)
config, err := debugagent.LoadFile(configFile)
if err != nil {
log.Fatalf("error reading config %v", err)
}

server, err := agent.NewServer(config)
server, err := debugagent.NewServer(config)
if err != nil {
log.Fatal(err)
}
Expand All @@ -27,5 +26,5 @@ func main() {
log.Fatal(err)
}

log.Println("sever stopped, see you next time!")
log.Println("server stopped, see you next time!")
}
19 changes: 19 additions & 0 deletions cmd/kubectl-debug/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"github.com/jamestgrant/kubectl-debug/pkg/kubectl-debug"
"github.com/spf13/pflag"
"k8s.io/cli-runtime/pkg/genericclioptions"
"os"
)

func main() {
flags := pflag.NewFlagSet("kubectldebug", pflag.ExitOnError)
pflag.CommandLine = flags

// bypass to DebugCmd
cmd := kubectldebug.NewDebugCmd(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr})
if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}
20 changes: 0 additions & 20 deletions cmd/plugin/main.go

This file was deleted.

5 changes: 0 additions & 5 deletions contrib/helm/kubectl-debug/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions contrib/helm/kubectl-debug/.helmignore

This file was deleted.

19 changes: 0 additions & 19 deletions contrib/helm/kubectl-debug/Chart.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions contrib/helm/kubectl-debug/OWNERS

This file was deleted.

58 changes: 0 additions & 58 deletions contrib/helm/kubectl-debug/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions contrib/helm/kubectl-debug/templates/NOTES.txt

This file was deleted.

16 changes: 0 additions & 16 deletions contrib/helm/kubectl-debug/templates/_helpers.tpl

This file was deleted.

72 changes: 0 additions & 72 deletions contrib/helm/kubectl-debug/templates/agent-ds.yaml

This file was deleted.

Loading