tfk8s icon indicating copy to clipboard operation
tfk8s copied to clipboard

How to Install

Open chrisaddams opened this issue 4 years ago • 9 comments

Hi, It doesn't seem clear how to install this. I've cloned the repo and run Make Install, but I can't get passed that. Is there a step I'm missing before I'm able to use tfk8s as a command?

chrisaddams avatar Jun 08 '20 23:06 chrisaddams

Hey @chrisaddams thanks for opening this. Can you show me the output you get when you run make install? At the moment this just runs go install, so the binary will be built and land wherever go is configured to install binaries on your system (for me it's $(go env GOPATH)/bin)

I'm hoping to set up binary releases for this soon so you don't have to build it yourself.

jrhouston avatar Jun 09 '20 19:06 jrhouston

➜ tfk8s git:(master) go install tfk8s.go:11:2: cannot find package "github.com/hashicorp/terraform/repl" in any of: /usr/lib/go-1.10/src/github.com/hashicorp/terraform/repl (from $GOROOT) /home/errogaht/go/src/github.com/hashicorp/terraform/repl (from $GOPATH) tfk8s.go:14:2: cannot find package "github.com/spf13/pflag" in any of: /usr/lib/go-1.10/src/github.com/spf13/pflag (from $GOROOT) /home/errogaht/go/src/github.com/spf13/pflag (from $GOPATH) tfk8s.go:12:2: cannot find package "gopkg.in/yaml.v2" in any of: /usr/lib/go-1.10/src/gopkg.in/yaml.v2 (from $GOROOT) /home/errogaht/go/src/gopkg.in/yaml.v2 (from $GOPATH)

errogaht avatar Jun 16 '20 15:06 errogaht

@errogaht It looks like you're on go 1.10 from looking at the paths in your output. This project uses go modules so you'll need a newer version of go to build it.

jrhouston avatar Jun 18 '20 23:06 jrhouston

I found using go get will quickly install it.

go get -u github.com/jrhouston/tfk8s

I'm using go 1.14, thanks for the handy tool btw.

YoninL avatar Nov 09 '20 01:11 YoninL

For Homebrew users, I have added tfk8s to my own tap, so you can now install it by running brew install tenzer/tap/tfk8s. There are bottles available for macOS x86 and ARM64 plus Linux x86.

Tenzer avatar May 27 '21 21:05 Tenzer

Trying to install this, but it fails with: github.com/jrhouston/tfk8s imports github.com/hashicorp/terraform/repl: cannot find module providing package github.com/hashicorp/terraform/repl

go version go1.16.5 linux/amd64

hameno avatar Jun 04 '21 14:06 hameno

Ah looks like https://github.com/hashicorp/terraform/commit/36d0a50427309875e9f7e8084936072db055e124 made the repl package internal, so it's breaking go get even though I have the version pinned in go.mod.

go install github.com/jrhouston/tfk8s@latest

still works for me on go1.16.5.

jrhouston avatar Jun 09 '21 18:06 jrhouston

go install github.com/jrhouston/tfk8s@latest (worked for me) go version go1.18.2 windows/amd64 On windows 10 Git Bash

CarloSacchi avatar May 11 '22 12:05 CarloSacchi

This command have generated a Windows/amd64 executable in the Linux environment, and then I have moved the compiled file to the Windows place.

env GOOS=windows GOARCH=amd64 go install github.com/jrhouston/tfk8s@latest

I did this in a Docker context. See the dockerfile below.

FROM golang:alpine
RUN apk --update add --no-cache git 
RUN go install github.com/googlecloudplatform/gcsfuse@master

The compiled file will be find in path /go/bin/windows_amd64

fkfouri avatar Jul 05 '23 13:07 fkfouri