operator-framework / operator-sdk

SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.
https://sdk.operatorframework.io
Apache License 2.0
7.21k stars 1.74k forks source link

Operator SDK installs resources in the same namespace as the operator instead of the CRD namespace. #6718

Closed a-devops-guy closed 5 months ago

a-devops-guy commented 5 months ago

When deploying a Kubernetes operator using the Operator SDK, resources such as services and deployments are installed in the namespace of the operator (system namespace), rather than in the namespace specified for the CRD. This behavior occurs specifically when the CRD is installed via a Kubernetes deployment.

Expected Behavior: Resources created by the operator, such as services and deployments, should be installed in the same namespace as the CRD, as specified during its deployment.

Screenshot 2024-04-08 at 6 07 58 PM Screenshot 2024-04-08 at 6 16 22 PM Screenshot 2024-04-08 at 6 17 36 PM

helm release is deployed in test ns but the resources are getting dpeloyed in system namespace. Technically resources should also be deployed in test namespace as CRD and helm release.

Additional Information:

Type of question

General operator-related help

Environment

Operator type:

golang

Kubernetes cluster type:

docker kubernetes

$ operator-sdk version

operator-sdk version: "v1.34.1", commit: "edaed1e5057db0349568e0b02df3743051b54e68", kubernetes version: "1.28.0", go version: "go1.21.7", GOOS: "darwin", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.22.1 darwin/amd64

$ kubectl version

Client Version: v1.29.1 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.29.1

Any help would be highly appreciated

a-devops-guy commented 5 months ago

closing this ticket it an issue with helm and not operator SDK. https://github.com/helm/helm/issues/12931