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

Installing the KubeArmorOperator throws an error when the "kubarmor" namespace is not created in the cluster #1767

Open
roopeshsn opened this issue May 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@roopeshsn
Copy link

Bug Report

When I ran commands make, then make manifests, then make docker-build deploy from pkg/KubeArmorOperator the make docker-build deploy command throws an error,

GOBIN=/home/roopesh/go/bin go install sigs.k8s.io/kustomize/kustomize/[email protected]
/home/roopesh/go/bin/kustomize build config/default | kubectl apply -f -
customresourcedefinition.apiextensions.k8s.io/kubearmorconfigs.operator.kubearmor.com unchanged
clusterrole.rbac.authorization.k8s.io/kubearmor-operator-clusterrole unchanged
clusterrole.rbac.authorization.k8s.io/kubearmor-operator-manage-controller-clusterrole unchanged
clusterrole.rbac.authorization.k8s.io/kubearmor-operator-manage-kubearmor-clusterrole unchanged
clusterrolebinding.rbac.authorization.k8s.io/kubearmor-operator-clusterrole-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/kubearmor-operator-manage-controller-clusterrole-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/kubearmor-operator-manage-kubearmor-clusterrole-binding unchanged
Error from server (NotFound): error when creating "STDIN": namespaces "kubearmor" not found
Error from server (NotFound): error when creating "STDIN": namespaces "kubearmor" not found
make: *** [Makefile:120: deploy] Error 1

When I ran the same command after creating the namespace "kubearmor" in the cluster, the command works fine by creating the resources in that namespace.

GOBIN=/home/roopesh/go/bin go install sigs.k8s.io/kustomize/kustomize/[email protected]
/home/roopesh/go/bin/kustomize build config/default | kubectl apply -f -
customresourcedefinition.apiextensions.k8s.io/kubearmorconfigs.operator.kubearmor.com unchanged
serviceaccount/kubearmor-operator created
clusterrole.rbac.authorization.k8s.io/kubearmor-operator-clusterrole unchanged
clusterrole.rbac.authorization.k8s.io/kubearmor-operator-manage-controller-clusterrole unchanged
clusterrole.rbac.authorization.k8s.io/kubearmor-operator-manage-kubearmor-clusterrole unchanged
clusterrolebinding.rbac.authorization.k8s.io/kubearmor-operator-clusterrole-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/kubearmor-operator-manage-controller-clusterrole-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/kubearmor-operator-manage-kubearmor-clusterrole-binding unchanged
deployment.apps/kubearmor-operator created

I would like to work on this issue if the maintainers want to proceed with it.

@roopeshsn roopeshsn added the bug Something isn't working label May 25, 2024
@kranurag7
Copy link
Member

Hey @roopeshsn, thanks for opening this.

I think you can add a namespace.yaml in config/operator and include the same under resources block of kustomization.yaml

Please also proceed if you think there's a better way to tackle this.

Ping me if you've any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants