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

Enable configuring the controller namespace #173

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ REGISTRY ?= quay.io/open-cluster-management
TAG ?= latest
IMAGE_NAME_AND_VERSION ?= $(REGISTRY)/$(IMG)

# Fix sed issues on mac by using GSED
SED="sed"
ifeq ($(GOOS), darwin)
SED="gsed"
endif

include build/common/Makefile.common.mk

############################################################
Expand Down Expand Up @@ -86,8 +92,10 @@ build-images:

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
.PHONY: deploy
deploy: generate-operator-yaml
deploy: generate-operator-yaml create-ns
$(SED) -i 's/\(namespace: \)open-cluster-management-agent-addon/\1$(CONTROLLER_NAMESPACE)/' -i deploy/operator.yaml
kubectl apply -f deploy/operator.yaml -n $(CONTROLLER_NAMESPACE)
$(SED) -i 's/\(namespace: \)$(CONTROLLER_NAMESPACE)/\1open-cluster-management-agent-addon/' -i deploy/operator.yaml
kubectl apply -f deploy/crds/policy.open-cluster-management.io_configurationpolicies.yaml -n $(CONTROLLER_NAMESPACE)
kubectl set env deployment/$(IMG) -n $(CONTROLLER_NAMESPACE) WATCH_NAMESPACE=$(WATCH_NAMESPACE)

Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ to learn how to get involved.

### Steps for deployment

- Build container image
- (optional) Build container image
```bash
make build-images
```
Expand All @@ -136,19 +136,16 @@ to learn how to get involved.

The controller is deployed to a namespace defined in `CONTROLLER_NAMESPACE` and monitors the namepace defined in `WATCH_NAMESPACE` for `ConfigurationPolicy` resources.

1. Create the deployment namespaces
1. Deploy the controller and related resources
```bash
make create-ns
make deploy
```

The deployment namespaces are configurable with:
```bash
export CONTROLLER_NAMESPACE='' # (defaults to 'open-cluster-management-agent-addon')
export WATCH_NAMESPACE='' # (defaults to 'managed')
```
2. Deploy the controller and related resources
```bash
make deploy
```
**NOTE:** Please be aware of the community's [deployment images](https://github.com/open-cluster-management-io/community#deployment-images) special note.


Expand Down