stakater / Reloader

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!
https://docs.stakater.com/reloader/
Apache License 2.0
7.45k stars 493 forks source link

Improve Reloader controller logs #504

Open SachithKasthuriarachchi opened 1 year ago

SachithKasthuriarachchi commented 1 year ago

In my AKS cluster with kubernetes version v1.25.6 the reloader seems to be stuck in the starting controller state.

time="2023-07-31T15:18:54Z" level=info msg="Environment: Kubernetes"
time="2023-07-31T15:18:54Z" level=info msg="Starting Reloader"
time="2023-07-31T15:18:54Z" level=warning msg="KUBERNETES_NAMESPACE is unset, will detect changes in all namespaces."
time="2023-07-31T15:18:54Z" level=info msg="created controller for: configMaps"
time="2023-07-31T15:18:54Z" level=info msg="Starting Controller to watch resource type: configMaps"
time="2023-07-31T15:18:54Z" level=info msg="created controller for: secrets"
time="2023-07-31T15:18:54Z" level=info msg="Starting Controller to watch resource type: secrets"

However, the version v0.0.58 works fine

Helm Values

fullnameOverride: reloader
reloader:
  deployment:
    annotations:
      checkov.io/skip2: CKV_K8S_38=Managed by reloader
    replicas: 1
    securityContext:
      runAsNonRoot: true
      runAsUser: 65534
      seccompProfile:
        type: RuntimeDefault
    image:
      name: ghcr.io/stakater/reloader
      tag: v1.0.32
      pullPolicy: Always
    containerSecurityContext:
      capabilities:
        drop:
          - ALL
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
    resources:
      limits:
        cpu: "100m"
        memory: "512Mi"
      requests:
        cpu: "10m"
        memory: "128Mi"
  readOnlyRootFileSystem: true
SachithKasthuriarachchi commented 1 year ago

https://github.com/stakater/Reloader/issues/63

SachithKasthuriarachchi commented 1 year ago

it seems reloader does not work at all in kubernetes v1.24.9

SachithKasthuriarachchi commented 1 year ago

@stakater-user do you have an idea about this? the latest 1.0.34 also does not work

SachithKasthuriarachchi commented 1 year ago

Apologies for this issue. The reloader works fine. I was confused since the log was stopped at the above.

time="2023-07-31T15:18:54Z" level=info msg="Starting Controller to watch resource type: secrets"

Can we improve this log message to say that the controller is started and it is watching the resources?

bnallapeta commented 1 year ago

@SachithKasthuriarachchi We try to follow standard logging that is generally used across k8s products. But feel free to raise a PR to add another log line after the one we already have:

time="2023-07-31T15:18:54Z" level=info msg="Starting Controller to watch resource type: secrets"
time="2023-07-31T15:18:54Z" level=info msg="Started Controller to watch resource type: secrets"