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

fix: sets env vars in the manager deployment #89

Merged
merged 1 commit into from
Jan 27, 2022
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
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ export MANAGER_ENV_VARS

update-mgr-env: ## Feed env variables to the manager configmap
@echo "$$MANAGER_ENV_VARS" > config/manager/manager.env
cp config/default/manager_custom_env.yaml.in config/default/manager_custom_env.yaml
sed 's|TOPOLVM_CSI_IMAGE_VAL|$(TOPOLVM_CSI_IMAGE)|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_LIVENESSPROBE_IMAGE_VAL|$(CSI_LIVENESSPROBE_IMAGE)|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_PROVISIONER_IMAGE_VAL|$(CSI_PROVISIONER_IMAGE)|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_RESIZER_IMAGE_VAL|$(CSI_RESIZER_IMAGE)|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_REGISTRAR_IMAGE_VAL|$(CSI_REGISTRAR_IMAGE)|g' --in-place config/default/manager_custom_env.yaml


##@ Build
Expand Down Expand Up @@ -155,7 +161,7 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl delete -f -

deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
deploy: update-mgr-env manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
cd config/default && $(KUSTOMIZE) edit set image rbac-proxy=$(RBAC_PROXY_IMG)
$(KUSTOMIZE) build config/default | kubectl apply -f -
Expand Down
3 changes: 2 additions & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Adds namespace to all resources.
namespace: lvm-operator-system
namespace: openshift-storage

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
Expand All @@ -23,6 +23,7 @@ namespace: lvm-operator-system
# endpoint w/o any authn/z, please comment the following line.
patchesStrategicMerge:
- manager_auth_proxy_patch.yaml
- manager_custom_env.yaml

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
Expand Down
21 changes: 21 additions & 0 deletions config/default/manager_custom_env.yaml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
env:
- name: TOPOLVM_CSI_IMAGE
value: TOPOLVM_CSI_IMAGE_VAL
- name: CSI_LIVENESSPROBE_IMAGE
value: CSI_LIVENESSPROBE_IMAGE_VAL
- name: CSI_PROVISIONER_IMAGE
value: CSI_PROVISIONER_IMAGE_VAL
- name: CSI_REGISTRAR_IMAGE
value: CSI_REGISTRAR_IMAGE_VAL
- name: CSI_RESIZER_IMAGE
value: CSI_RESIZER_IMAGE_VAL
7 changes: 0 additions & 7 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,3 @@ resources:

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- envs:
- manager.env
files:
- controller_manager_config.yaml
name: lvm-operator-manager-config
3 changes: 0 additions & 3 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
envFrom:
- configMapRef:
name: lvm-operator-manager-config
- command:
- /metricsexporter
image: controller:latest
Expand Down