Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible operator error in openshift and local docker run as well #6473

Closed
kpbasu opened this issue Jun 22, 2023 · 4 comments
Closed

ansible operator error in openshift and local docker run as well #6473

kpbasu opened this issue Jun 22, 2023 · 4 comments
Assignees
Labels
triage/needs-information Indicates an issue needs more information in order to work on it.
Milestone

Comments

@kpbasu
Copy link

kpbasu commented Jun 22, 2023

Error during docker run the operator image and in OpenShift as well. Last week, Operator and CR was successfully installed which is running fine on that OpenShift cluster(4.10.54). What could be the issue in new same version of OpenShift cluster(4.10.54) and local docker run?

 podman run -it localhost/controller:latest
{"level":"info","ts":1687455343.9304368,"logger":"cmd","msg":"Version","Go Version":"go1.15.5","GOOS":"linux","GOARCH":"amd64","ansible-operator":"v1.3.0","commit":"1abf57985b43bf6a59dcd18147b3c574fa57d3f6"}
{"level":"error","ts":1687455343.9306693,"logger":"cmd","msg":"Failed to get config.","error":"invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable","errorCauses":[{"error":"no configuration has been provided, try setting KUBERNETES_MASTER environment variable"}],"stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/travis/gopath/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132\ngithub.com/operator-framework/operator-sdk/internal/cmd/ansible-operator/run.run\n\toperator-sdk/internal/cmd/ansible-operator/run/cmd.go:89\ngithub.com/operator-framework/operator-sdk/internal/cmd/ansible-operator/run.NewCmd.func1\n\toperator-sdk/internal/cmd/ansible-operator/run/cmd.go:74\ngithub.com/spf13/cobra.(*Command).execute\n\t/home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:887\nmain.main\n\toperator-sdk/cmd/ansible-operator/main.go:40\nruntime.main\n\t/home/travis/.gimme/versions/go1.15.5.linux.amd64/src/runtime/proc.go:204"}

General operator-related help

Question

What did you do?

podman run -it icr.io/odi-utility-tool/osdu-pre-req-operator:v0.12.1

What did you expect to see?

image should running and we can get shell on container. In last month, we had able to login.

What did you see instead? Under which circumstances?

  • Operator error in openshift cluster. It was fine to install this operator in last week as well.
{"level":"error","ts":1687286328.5908897,"logger":"controller-runtime.manager.controller","error":"event runner on failed","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/travis/gopath/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:267\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:235\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:198\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\t/home/tr

Environment

Operator type:

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.8.0-ocp", commit: "bf96b7604eadb82f173df1c60e6999c2d17695fb", kubernetes version: "v1.20.2", go version: "go1.16.6", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.19.9 linux/amd64

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v0.23.0", GitCommit:"f93da179fe606775f8249fed96e0b9903d9188ed", GitTreeState:"clean", BuildDate:"2022-02-16T06:04:08Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

Additional context

@kpbasu
Copy link
Author

kpbasu commented Jun 22, 2023

HI @everettraven ,
Please check it

@everettraven
Copy link
Contributor

@kpbasu Thanks for raising this issue! Taking a look at the provided error:

{"level":"error","ts":1687455343.9306693,"logger":"cmd","msg":"Failed to get config.","error":"invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable","errorCauses":[{"error":"no configuration has been provided, try setting KUBERNETES_MASTER environment variable"}],"stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/travis/gopath/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132\ngithub.com/operator-framework/operator-sdk/internal/cmd/ansible-operator/run.run\n\toperator-sdk/internal/cmd/ansible-operator/run/cmd.go:89\ngithub.com/operator-framework/operator-sdk/internal/cmd/ansible-operator/run.NewCmd.func1\n\toperator-sdk/internal/cmd/ansible-operator/run/cmd.go:74\ngithub.com/spf13/cobra.(*Command).execute\n\t/home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:887\nmain.main\n\toperator-sdk/cmd/ansible-operator/main.go:40\nruntime.main\n\t/home/travis/.gimme/versions/go1.15.5.linux.amd64/src/runtime/proc.go:204"}

It looks like it can't find a configuration that allows it to connect to a Kubernetes cluster. I suspect running it via podman or docker directly you aren't mounting a volume that includes a .kube/config file or aren't specifying the KUBERNETES_MASTER environment variable in the container leading it to not have a configuration for connecting to a cluster. Operators require a connection to a Kubernetes cluster to function properly as they are Kubernetes extensions.

As for the on cluster error:

{"level":"error","ts":1687286328.5908897,"logger":"controller-runtime.manager.controller","error":"event runner on failed","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/travis/gopath/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:267\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:235\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:198\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\t/home/tr

This error appears to be returned and logged when the Ansible playbook has an unsuccessful run. Are there any other logs that indicate a failure during the running of your playbook?

@kensipe kensipe added the triage/needs-information Indicates an issue needs more information in order to work on it. label Jun 26, 2023
@kensipe kensipe added this to the Backlog milestone Jun 26, 2023
@everettraven
Copy link
Contributor

@kpbasu Did my last comment help to resolve this issue?

@everettraven
Copy link
Contributor

Closing this issue as there has been no response from the issue author. Please feel free to reopen this issue if you feel it was closed in error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

3 participants