egress-operator
egress-operator copied to clipboard
Failing to install with error - cgo: exec /missing-cc: fork/exec /missing-cc
I have got the softwares installed in bootstrap VM
- kubectl
- go
- kustomize
- 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: https://github.com/monzo/egress-operator/pull/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/[email protected]/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start
/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/source/source.go:88
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:165
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start
/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:198
sigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).startLeaderElectionRunnables.func1
/root/go/pkg/mod/sigs.k8s.io/[email protected]/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/[email protected]/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/[email protected]/zapr.go:128 sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start /root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/source/source.go:88 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1 /root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:165 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start /root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:198 sigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).startLeaderElectionRunnables.func1 /root/go/pkg/mod/sigs.k8s.io/[email protected]/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/[email protected]/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:
- Get repository to push images as mentioned in readme
- Install Kubebuilder for code generation as mentioned in readme
- Get CoreDns (default with k3s) pod running as mentioned in readme
- Install Golang as mentioned in readme
- 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
-
-
apt-get install build-essential
(for installing gcc) -
apt-get install make
-
make install
-
make run
(after cd egress-operator)