Thanks to visit codestin.com
Credit goes to github.com

Skip to content

make deploy failing as ServiceAccount is created in default namespace and RoleBinding is missing the namespace. #96

Open
@laxmikantbpandhare

Description

@laxmikantbpandhare

target/kubernetes/kubernetes.yml file got generated from the quarkus extension. The ServiceAccount created does not have any namespace that's why it gets created in the default namespace. As RoleBinding does not have the namespace mentioned throws the below error if you try to apply the above file.

Error from server (Invalid): error when creating "target/kubernetes/kubernetes.yml": ClusterRoleBinding.rbac.authorization.k8s.io "memcachedreconciler-cluster-role-binding" is invalid: subjects[0].namespace: Required value

Error from server (Invalid): error when creating "target/kubernetes/kubernetes.yml": ClusterRoleBinding.rbac.authorization.k8s.io "memcachedreconciler-crd-validating-role-binding" is invalid: subjects[0].namespace: Required value

What did you do?

Create docker image of operator and tries to run using make deploy.

What did you expect to see?

The operator will run without any error.

What did you see instead? Under which circumstances?

Got below errors

Error from server (Invalid): error when creating "target/kubernetes/kubernetes.yml": ClusterRoleBinding.rbac.authorization.k8s.io "memcachedreconciler-cluster-role-binding" is invalid: subjects[0].namespace: Required value

Error from server (Invalid): error when creating "target/kubernetes/kubernetes.yml": ClusterRoleBinding.rbac.authorization.k8s.io "memcachedreconciler-crd-validating-role-binding" is invalid: subjects[0].namespace: Required value

Environment

Operator type:

quarkus-memached-operator

Kubernetes cluster type:

kind

$ operator-sdk version

operator-sdk version: "v1.22.0-23-g6084e6cf-dirty", commit: "6084e6cf1eb393c38d9ebce8f9acee5628b3a5c3", kubernetes version: "v1.24.1", go version: "go1.18.3", GOOS: "darwin", GOARCH: "amd64"

$ java -version (if language is Java)

openjdk version "16.0.2" 2021-07-20
OpenJDK Runtime Environment (build 16.0.2+7-67)
OpenJDK 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.0", GitCommit:"2c6062082e8dbbf36936b35dcc27c6882d3a2f67", GitTreeState:"clean", BuildDate:"2022-01-11T19:37:02Z", GoVersion:"go1.15.14", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-21T23:01:33Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}

Possible Solution

Need to discuss this with the Quarkus team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions