Skip to content

SDK generated components named controller-manager should be named controller or operator  #4823

@bwoolf1

Description

@bwoolf1

Bug Report

The SDK generates a Deployment named "controller-manager". This name is misleading. The controller manager is a component in the control plane that runs controllers. That's not what's being deployed.

The image for this Deployment is called "operator." That would be a better name for this Deployment. Or "controller" would be better than "controller-manager".

What did you do?

Generated a Go operator and deployed it.

What did you expect to see?

Since the image is named <my_service>-operator, I expect its deployment to have the same name.

What did you see instead? Under which circumstances?

The deployment is named <my_service>-operator-controller-manager. The pods have the same name, plus the UID. The control-plane label is literally controller-manager (no prefix). Interestingly, the container doesn't have this name, it's just <my_service>-operator.

Environment

Operator type:

/language go

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.6.1", commit: "e6981d812a759442a583d8ee2fae269507c408d4", kubernetes version: "v1.19.4", go version: "go1.16.3", GOOS: "darwin", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.15.8 darwin/amd64

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.0", GitCommit:"18d7461aca47e77cefb355339252a8d4c149188f", GitTreeState:"clean", BuildDate:"2021-01-30T16:44:37Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64"}

Possible Solution

The names in the /config/manager/manager.yaml template should be "operator", not "controller-manager". The kustomize code should add the "<my_service>-" prefix to "operator" or simply replace "operator" with "<my_service>-operator". Likewise, the filename shouldn't be manager, nor should the directory name; they should be operator, same as the deployment in the template.

Additional context

Metadata

Metadata

Assignees

Labels

language/goIssue is related to a Go operator projectlifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.triage/supportIndicates an issue that is a support question.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions