diff --git a/.krew.yaml b/.krew.yaml new file mode 100644 index 0000000..dc1269b --- /dev/null +++ b/.krew.yaml @@ -0,0 +1,51 @@ +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: sniff +spec: + version: {{ .TagName }} + homepage: https://github.com/eldadru/ksniff + platforms: + - {{ addURIAndSha "https://github.com/eldadru/ksniff/releases/download/{{ .TagName }}/ksniff.zip" .TagName }} + bin: kubectl-sniff + files: + - from: ./kubectl-sniff-darwin + to: kubectl-sniff + - from: ./static-tcpdump + to: static-tcpdump + selector: + matchLabels: + os: darwin + arch: amd64 + - {{ addURIAndSha "https://github.com/eldadru/ksniff/releases/download/{{ .TagName }}/ksniff.zip" .TagName }} + bin: kubectl-sniff + files: + - from: ./kubectl-sniff + to: kubectl-sniff + - from: ./static-tcpdump + to: static-tcpdump + selector: + matchLabels: + os: linux + arch: amd64 + - {{ addURIAndSha "https://github.com/eldadru/ksniff/releases/download/{{ .TagName }}/ksniff.zip" .TagName }} + bin: kubectl-sniff.exe + files: + - from: ./kubectl-sniff-windows + to: kubectl-sniff.exe + - from: ./static-tcpdump + to: static-tcpdump + selector: + matchLabels: + os: windows + arch: amd64 + shortDescription: Start a remote packet capture on pods using tcpdump and wireshark + caveats: | + This plugin needs the following programs: + * wireshark (optional, used for live capture) + description: | + When working with micro-services, many times it's very helpful to get a capture of the network + activity between your micro-service and it's dependencies. + + ksniff use kubectl to upload a statically compiled tcpdump binary to your pod and redirecting it's + output to your local Wireshark for smooth network debugging experience. diff --git a/.travis.yml b/.travis.yml index 8fdd559..f461464 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,20 +11,24 @@ before_install: - sudo apt-get install -y libpcap-dev gcc script: - - make verify_version - make all - make static-tcpdump before_deploy: - make package - - git tag "$(cat VERSION)" deploy: - provider: releases - api_key: $GITHUB_OAUTH_TOKEN - file: - - ksniff.zip - skip_cleanup: true - on: - tag: true - branch: master \ No newline at end of file + - provider: releases + api_key: $GITHUB_OAUTH_TOKEN + file: + - ksniff.zip + skip_cleanup: true + on: + tags: true + branch: master + - provider: script + script: + - env GITHUB_TOKEN=${GITHUB_OAUTH_TOKEN} bash scripts/update-krew-index.sh + on: + tags: true + branch: master \ No newline at end of file diff --git a/VERSION b/VERSION deleted file mode 100644 index 2f93383..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -v1.3.4 \ No newline at end of file diff --git a/scripts/update-krew-index.sh b/scripts/update-krew-index.sh new file mode 100644 index 0000000..64cf29b --- /dev/null +++ b/scripts/update-krew-index.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +export KREW_RELEASE_BOT_VERSION=v0.0.36 + +curl -LO https://github.com/rajatjindal/krew-release-bot/releases/download/${KREW_RELEASE_BOT_VERSION}/krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz +tar -xvf krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz +./krew-release-bot action \ No newline at end of file diff --git a/scripts/verify_version.sh b/scripts/verify_version.sh deleted file mode 100755 index 4359618..0000000 --- a/scripts/verify_version.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -THIS_BRANCH_VERSION=$(cat VERSION) -if [[ $(git tag -l "$THIS_BRANCH_VERSION") ]]; then - echo "[-] Version $THIS_BRANCH_VERSION is already tagged, please increase plugin version" - exit 1 -else - echo "[-] Version $THIS_BRANCH_VERSION is not tagged yet." - exit 0 -fi \ No newline at end of file