【发布时间】:2021-09-18 17:33:51
【问题描述】:
我正在尝试Egress Operator 来限制基于域的出口呼叫。我正在使用Ubuntu 18 Hyper-V VM,我拥有所有prerequisites:
- 用于推送图像的 Azure 存储库
-
Kubebuilder用于代码生成 -
Kustomize用于构建 Kubernetes 清单 -
CoreDns(默认使用 k3s)pod 正在运行 -
Golang:go version go1.16.5 linux/amd64
但是虽然Testing locally make run 给出以下错误:
root@Ubuntu18-Virtual-Machine:~/egress-operator# make run
go: creating new go.mod: module tmp
go get: added sigs.k8s.io/controller-tools v0.2.4
/root/go/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
Error: go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags ignore_autogenerated -- ./...]: exit status 2: # runtime/cgo
cgo: exec gcc: exec: "gcc": executable file not found in $PATH
同样在 ConfigMap 中编辑 coredns 部署和 coredns Corefile 后,如coredns plugin setup 中所述,我在执行make deploy 命令时看到了打击错误:
root@Ubuntu18-Virtual-Machine:~/egress-operator# make deploy IMG=MY_REPO/egress-operator:v0.1
go: creating new go.mod: module tmp
go get: added sigs.k8s.io/controller-tools v0.2.4
/root/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Error: go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags ignore_autogenerated -- ./...]: exit status 2: # runtime/cgo
cgo: exec gcc: exec: "gcc": executable file not found in $PATH
谁能告诉我如何解决这个问题?
【问题讨论】:
标签: go kubernetes gcc cgo coredns