Install kubectl plugin on ksniff Mac M1

Kun-Hung Tsai
1 min readSep 9, 2021

Background

When I tried to install ksniff plugin for kubectl on Mac M1, it showed:

plugin "sniff" does not offer installation for this platform

According to the issue here, we could build the M1 version binary from source code:

https://github.com/eldadru/ksniff/issues/117

Steps

Clone latest ksniff source code:

git@github.com:eldadru/ksniff.git

Build binary:

cd ksniff/
GO111MODULE=on GOOS=darwin GOARCH=arm64 go build -o kubectl-sniff-darwin cmd/kubectl-sniff.go

Copy the binary into your .krew/bin path:
(Note. The file name should be kubectl-sniff in .krew/bin path)

cp kubectl-sniff-darwin /Users/${username}/.krew/bin/kubectl-sniff

Now you should be able to use ksniff with kubectl sniff .

Reference

--

--