Skip to content
Open
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
6 changes: 4 additions & 2 deletions control-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ OPERATOR_SDK_VERSION ?= unknown
# Image URL to use all building/pushing image targets
TASK_IMG ?= gitlab-registry.cern.ch/aliceo2group/dockerfiles/aliecs/task-manager:latest
ENVIRONMENT_IMG ?= gitlab-registry.cern.ch/aliceo2group/dockerfiles/aliecs/environment-manager:latest
# Name of the image pull secret (in operator-system namespace) used by deployed controllers
PULL_SECRET ?= ghcr-pull
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27.1

Expand Down Expand Up @@ -212,12 +214,12 @@ deploy: deploy-task deploy-environment ## Deploy both controllers to the K8s clu
.PHONY: deploy-task
deploy-task: manifests kustomize ## Deploy task controller to the K8s cluster specified in ~/.kube/config.
cd config/task && $(KUSTOMIZE) edit set image task-manager=${TASK_IMG}
$(KUSTOMIZE) build config/task | $(KUBECTL) apply -f - --server-side
$(KUSTOMIZE) build config/task | sed 's/- name: pull-secret-placeholder$$/- name: $(PULL_SECRET)/' | $(KUBECTL) apply -f - --server-side

.PHONY: deploy-environment
deploy-environment: manifests kustomize ## Deploy environment controller to the K8s cluster specified in ~/.kube/config.
cd config/environment && $(KUSTOMIZE) edit set image environment-manager=${ENVIRONMENT_IMG}
$(KUSTOMIZE) build config/environment | $(KUBECTL) apply -f - --server-side
$(KUSTOMIZE) build config/environment | sed 's/- name: pull-secret-placeholder$$/- name: $(PULL_SECRET)/' | $(KUBECTL) apply -f - --server-side

.PHONY: undeploy
undeploy: undeploy-task undeploy-environment ## Undeploy both controllers from the K8s cluster specified in ~/.kube/config.
Expand Down
4 changes: 2 additions & 2 deletions control-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ kubectl apply -f config/samples/
make docker-build docker-push TASK_IMG=<some-registry>/task-manager:tag ENVIRONMENT_IMG=<some-registry>/environment-manager:tag
```

1. Deploy the controllers to the cluster. Uses the same `TASK_IMG` and `ENVIRONMENT_IMG` defaults, override them if needed:
1. Deploy the controllers to the cluster. Uses the same `TASK_IMG` and `ENVIRONMENT_IMG` defaults, override them if needed. Images are pulled using the secret named by `PULL_SECRET` (default `ghcr-pull`), which must exist in the `operator-system` namespace:

```sh
make deploy TASK_IMG=<some-registry>/task-manager:tag ENVIRONMENT_IMG=<some-registry>/environment-manager:tag
make deploy TASK_IMG=<some-registry>/task-manager:tag ENVIRONMENT_IMG=<some-registry>/environment-manager:tag PULL_SECRET=<secret-name>
```

### Uninstall CRDs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ spec:
labels:
control-plane: environment-manager
spec:
# placeholder, replaced with $(PULL_SECRET) by `make deploy-task` / `make deploy-environment`
imagePullSecrets:
- name: gitlab-registry-secret
- name: pull-secret-placeholder
securityContext:
runAsNonRoot: true
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ spec:
control-plane: task-manager
spec:
hostNetwork: true
# placeholder, replaced with $(PULL_SECRET) by `make deploy-task` / `make deploy-environment`
imagePullSecrets:
- name: gitlab-registry-secret
- name: pull-secret-placeholder
securityContext:
runAsNonRoot: true
containers:
Expand Down
Loading