From 8c0a87b710084e51c52bea3e32f8869e543cf2bc Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 9 May 2021 12:34:44 +0200 Subject: [PATCH] outposts: improve logging for outpost controller Signed-off-by: Jens Langhammer --- authentik/outposts/controllers/k8s/base.py | 3 +-- authentik/providers/proxy/controllers/k8s/ingress.py | 1 + authentik/providers/proxy/controllers/k8s/traefik.py | 2 ++ authentik/providers/proxy/controllers/kubernetes.py | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/authentik/outposts/controllers/k8s/base.py b/authentik/outposts/controllers/k8s/base.py index 55c9fe7ad..7b75654e2 100644 --- a/authentik/outposts/controllers/k8s/base.py +++ b/authentik/outposts/controllers/k8s/base.py @@ -71,7 +71,6 @@ class KubernetesObjectReconciler(Generic[T]): self.logger.debug("Other unhandled error", exc=exc) raise exc else: - self.logger.debug("Got current, running reconcile") self.reconcile(current, reference) except NeedsRecreate: self.logger.debug("Recreate requested") @@ -86,7 +85,7 @@ class KubernetesObjectReconciler(Generic[T]): self.logger.debug("Updating") self.update(current, reference) else: - self.logger.debug("Nothing to do...") + self.logger.debug("Object is up-to-date.") def down(self): """Delete object if found""" diff --git a/authentik/providers/proxy/controllers/k8s/ingress.py b/authentik/providers/proxy/controllers/k8s/ingress.py index 09eb56d65..ead62326b 100644 --- a/authentik/providers/proxy/controllers/k8s/ingress.py +++ b/authentik/providers/proxy/controllers/k8s/ingress.py @@ -123,6 +123,7 @@ class IngressReconciler(KubernetesObjectReconciler[NetworkingV1beta1Ingress]): ) rules.append(rule) if not rules: + self.logger.debug("No providers use proxying, no ingress needed") raise Disabled() tls_config = None if tls_hosts: diff --git a/authentik/providers/proxy/controllers/k8s/traefik.py b/authentik/providers/proxy/controllers/k8s/traefik.py index 681ee7b01..1b3e15949 100644 --- a/authentik/providers/proxy/controllers/k8s/traefik.py +++ b/authentik/providers/proxy/controllers/k8s/traefik.py @@ -91,8 +91,10 @@ class TraefikMiddlewareReconciler(KubernetesObjectReconciler[TraefikMiddleware]) outpost__in=[self.controller.outpost], forward_auth_mode=True, ).exists(): + self.logger.debug("No providers with forward auth enabled.") raise Disabled() if not self._crd_exists(): + self.logger.debug("CRD doesn't exist") raise Disabled() return TraefikMiddleware( apiVersion=f"{CRD_GROUP}/{CRD_VERSION}", diff --git a/authentik/providers/proxy/controllers/kubernetes.py b/authentik/providers/proxy/controllers/kubernetes.py index 0d4986a4b..048d81f14 100644 --- a/authentik/providers/proxy/controllers/kubernetes.py +++ b/authentik/providers/proxy/controllers/kubernetes.py @@ -18,6 +18,6 @@ class ProxyKubernetesController(KubernetesController): DeploymentPort(4443, "https", "tcp"), ] self.reconcilers["ingress"] = IngressReconciler - self.reconcilers["traefik_middleware"] = TraefikMiddlewareReconciler + self.reconcilers["traefik middleware"] = TraefikMiddlewareReconciler self.reconcile_order.append("ingress") - self.reconcile_order.append("traefik_middleware") + self.reconcile_order.append("traefik middleware")