From 1168e543096794156df80993e0d154bb407d9ba7 Mon Sep 17 00:00:00 2001 From: Eguzki Astiz Lezaun Date: Wed, 12 Jun 2024 17:28:31 +0200 Subject: [PATCH] make deploy keeps the log level defaults. make local-deploy patches the deployment to have debug log level and development log mode. --- config/deploy/kustomization.yaml | 5 ----- config/deploy/manager_debug_mode.yaml | 18 ------------------ make/development-environments.mk | 3 ++- utils/kuadrant-operator-debug-mode.sh | 15 +++++++++++++++ 4 files changed, 17 insertions(+), 24 deletions(-) delete mode 100644 config/deploy/manager_debug_mode.yaml create mode 100755 utils/kuadrant-operator-debug-mode.sh diff --git a/config/deploy/kustomization.yaml b/config/deploy/kustomization.yaml index c7bc3e15a..26f469419 100644 --- a/config/deploy/kustomization.yaml +++ b/config/deploy/kustomization.yaml @@ -1,9 +1,4 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization namespace: kuadrant-system resources: - ../default - ../dependencies -patchesStrategicMerge: -- manager_debug_mode.yaml diff --git a/config/deploy/manager_debug_mode.yaml b/config/deploy/manager_debug_mode.yaml deleted file mode 100644 index 136c25eb6..000000000 --- a/config/deploy/manager_debug_mode.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: kuadrant - control-plane: controller-manager - name: kuadrant-operator-controller-manager - namespace: kuadrant-system -spec: - template: - spec: - containers: - - name: manager - env: - - name: LOG_LEVEL - value: debug - - name: LOG_MODE - value: development diff --git a/make/development-environments.mk b/make/development-environments.mk index 11ed736b5..68c883fe3 100644 --- a/make/development-environments.mk +++ b/make/development-environments.mk @@ -50,9 +50,10 @@ namespace: ## Creates a namespace where to deploy Kuadrant Operator local-deploy: ## Deploy Kuadrant Operator from the current code $(MAKE) docker-build IMG=$(IMAGE_TAG_BASE):dev $(MAKE) kind-load-image IMG=$(IMAGE_TAG_BASE):dev - $(MAKE) deploy IMG=$(IMAGE_TAG_BASE):dev kubectl -n $(KUADRANT_NAMESPACE) wait --timeout=300s --for=condition=Available deployments --all + ./utils/kuadrant-operator-debug-mode.sh + kubectl -n $(KUADRANT_NAMESPACE) wait --timeout=300s --for=condition=Available deployments --all .PHONY: env-setup env-setup: ## Install deploy kuadrant dependencies and configured gatewayapi provider diff --git a/utils/kuadrant-operator-debug-mode.sh b/utils/kuadrant-operator-debug-mode.sh new file mode 100755 index 000000000..a7ab7a2d5 --- /dev/null +++ b/utils/kuadrant-operator-debug-mode.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +kubectl patch deployment kuadrant-operator-controller-manager -n kuadrant-system --patch-file=/dev/stdin <<-EOF +--- +spec: + template: + spec: + containers: + - name: manager + env: + - name: LOG_LEVEL + value: debug + - name: LOG_MODE + value: development +EOF