operator-framework / operator-framework/ansible-operator-plugins

Unknown flag --metrics-require-rbac in ansible-operator command

Open Beginner friendly
#212 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

language/ansible
Dominant language
Go
Stars
12
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Bug Report

What did you do?

reated a new Ansible-based operator using Operator SDK:

$ operator-sdk init --domain myorg.io --plugins ansible

Created a new API for kind "MyKind":

$ operator-sdk create api --version v1alpha1 --kind MyKind --generate-role

And then manually fixed the issue reported here.

Built and pushed the image on Quay:

IMG=quay.io/myorg/myoperator:v0.0.1 make docker-build docker-push
...

And finally deployed everything on my Kubernetes:

IMG=quay.io/myorg/myoperator:v0.0.1 make deploy
...
What did you expect to see?

The Controller manager Pod of my operator coming up correctly.

What did you see instead? Under which circumstances?

I get this error:

$ kubectl --namespace myoperator-system get all
NAME                                             READY   STATUS             RESTARTS      AGE
pod/myoperator-controller-manager-78948b9df7-lg9vf   0/1     CrashLoopBackOff   6 (88s ago)   7m18s

And the reason is:

$ kubectl --namespace kiraop-system logs pod/kiraop-controller-manager-78948b9df7-lg9vf
Error: unknown flag: --metrics-require-rbac
Usage:
  ansible-operator run [flags]

Flags:
 ...
 ...

2026/03/24 10:50:12 unknown flag: --metrics-require-rbac
Environment

Operator type:

/language ansible

Kubernetes cluster type:

Vanilla.

$ operator-sdk version

operator-sdk version: "v1.42.0", commit: "ab5563df5499cafa4ea9d40d4b36b51899a4718e", kubernetes version: "1.33.1", go version: "go1.24.6", GOOS: "linux", GOARCH: "amd64"

$ kubectl version

Client Version: v1.30.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.14
Possible Solution

The solution should be to remove that patch from the config/default/manager_metrics_patch.yaml file:

$ sed -i '/# This patch adds the args to allow RBAC-based authn\/authz the metrics endpoint/,/^$/d' config/default/manager_metrics_patch.yaml

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with config/default/manager_metrics_patch.yaml and inspect the generated manager deployment arguments. Reproduce the ansible-operator startup with the current generated manifests, then verify that the unsupported --metrics-require-rbac flag is no longer passed and the controller manager Pod starts successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, go, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.