monzo / egress-operator

A Kubernetes operator to produce egress gateway Envoy pods and control access to them with network policies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing to install with error - cgo: exec /missing-cc: fork/exec /missing-cc

rajks24 opened this issue · comments

I have got the softwares installed in bootstrap VM

  1. kubectl
  2. go
  3. kustomize
  4. kubebuilder

Have access to running kubernetes cluster build with kubeadm

while install, getting the below error

[user1@bstrap-tkg121 egress-operator]$ make run
which: no controller-gen in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/user1/.local/bin:/home/user1/bin:/home/user1/.local/bin:/home/user1/bin:/usr/local/go/bin:/home/user1/.local/bin:/home/user1/bin:/usr/local/go/bin:/usr/local/kubebuilder/bin)
go: creating new go.mod: module tmp
go: found sigs.k8s.io/controller-tools/cmd/controller-gen in sigs.k8s.io/controller-tools v0.2.4
/home/user1/go/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
-: # runtime/cgo
cgo: exec /missing-cc: fork/exec /missing-cc: no such file or directory
Error: not all generators ran successfully
run `controller-gen object:headerFile=./hack/boilerplate.go.txt paths=./... -w` to see all available markers, or `controller-gen object:headerFile=./hack/boilerplate.go.txt paths=./... -h` for usage
make: *** [generate] Error 1

Hi @rajeshsingh624,
I've recently pushed a fix which unlinks libc: #18
Any chance this helps your case?

@boffbowsh @dovys : In my case make run giving below error:

# 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="./..."
go fmt ./...
go vet ./...
/root/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
go run ./main.go
2021-07-08T15:27:41.887+0530    INFO    controller-runtime.metrics      metrics server is starting to listen    {"addr": ":8080"}
2021-07-08T15:27:41.887+0530    INFO    setup   starting manager
2021-07-08T15:27:41.887+0530    INFO    controller-runtime.manager      starting metrics server {"path": "/metrics"}
2021-07-08T15:27:41.988+0530    INFO    controller-runtime.controller   Starting EventSource    {"controller": "externalservice", "source": "kind source: /, Kind="}
2021-07-08T15:27:44.136+0530    ERROR   controller-runtime.source       if kind is a CRD, it should be installed before calling Start   {"kind": "ExternalService.egress.monzo.com", "error": "no matches for kind \"ExternalService\" in version \"egress.monzo.com/v1\""}
github.com/go-logr/zapr.(*zapLogger).Error
        /root/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/source/source.go:88
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:165
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:198
sigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).startLeaderElectionRunnables.func1
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/manager/internal.go:477
2021-07-08T15:27:44.137+0530    DEBUG   controller-runtime.manager      leader-election runnable finished       {"runnable type": "*controller.Controller"}
2021-07-08T15:27:44.137+0530    ERROR   setup   problem running manager {"error": "no matches for kind \"ExternalService\" in version \"egress.monzo.com/v1\""}
github.com/go-logr/zapr.(*zapLogger).Error
        /root/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
main.main
        /root/egress-operator/main.go:89
runtime.main
        /usr/local/go/src/runtime/proc.go:225
exit status 1
Makefile:25: recipe for target 'run' failed
make: *** [run] Error 1

Any idea why ? also do we need to install gcc separately on ubuntu 18 ?

@boffbowsh @dovys : In my case make run giving below error:

# 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="./..."
go fmt ./...
go vet ./...
/root/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
go run ./main.go
2021-07-08T15:27:41.887+0530    INFO    controller-runtime.metrics      metrics server is starting to listen    {"addr": ":8080"}
2021-07-08T15:27:41.887+0530    INFO    setup   starting manager
2021-07-08T15:27:41.887+0530    INFO    controller-runtime.manager      starting metrics server {"path": "/metrics"}
2021-07-08T15:27:41.988+0530    INFO    controller-runtime.controller   Starting EventSource    {"controller": "externalservice", "source": "kind source: /, Kind="}
2021-07-08T15:27:44.136+0530    ERROR   controller-runtime.source       if kind is a CRD, it should be installed before calling Start   {"kind": "ExternalService.egress.monzo.com", "error": "no matches for kind \"ExternalService\" in version \"egress.monzo.com/v1\""}
github.com/go-logr/zapr.(*zapLogger).Error
        /root/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/source/source.go:88
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:165
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:198
sigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).startLeaderElectionRunnables.func1
        /root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/manager/internal.go:477
2021-07-08T15:27:44.137+0530    DEBUG   controller-runtime.manager      leader-election runnable finished       {"runnable type": "*controller.Controller"}
2021-07-08T15:27:44.137+0530    ERROR   setup   problem running manager {"error": "no matches for kind \"ExternalService\" in version \"egress.monzo.com/v1\""}
github.com/go-logr/zapr.(*zapLogger).Error
        /root/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
main.main
        /root/egress-operator/main.go:89
runtime.main
        /usr/local/go/src/runtime/proc.go:225
exit status 1
Makefile:25: recipe for target 'run' failed
make: *** [run] Error 1

Any idea why ? also do we need to install gcc separately on ubuntu 18 ?

Please use below commands just after the git clone to resolve this:

  1. Get repository to push images as mentioned in readme
  2. Install Kubebuilder for code generation as mentioned in readme
  3. Get CoreDns (default with k3s) pod running as mentioned in readme
  4. Install Golang as mentioned in readme
  5. To install Kustomize for building the Kubernetes manifests :
    • curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
    • sudo install -o root -g root -m 0755 kustomize /usr/local/bin/kustomize
  6. apt-get install build-essential (for installing gcc)
  7. apt-get install make
  8. make install
  9. make run (after cd egress-operator)