Summary: This article explains common reasons the Dynatrace Kubernetes Operator fails to start. It guides users through checking logs, validating configuration, and correcting cluster prerequisites.
Hi!
I’ve tried to follow the quickstart guide for Kubernetes, and I’m stuck after the first part. I can’t get the operator to start successfully. I’m on exoscale managed Kubernetes running on v1.25.14. I’ve downloaded the generated `dynakube.yaml` file, and I’ve executed the suggested script of kubectl commands. My operator keeps failing and restarting with the following log message.
{"error":"Timeout: failed waiting for *v1.Secret Informer to sync","level":"error","logger":"main.controller-runtime.source","msg":"failed to get informer from cache","stacktrace":"github.com/Dynatrace/dynatrace-operator/src/logger.logSink.Error
github.com/Dynatrace/dynatrace-operator/src/logger/logger.go:40
sigs.k8s.io/controller-runtime/pkg/log.(*DelegatingLogSink).Error
sigs.k8s.io/controller-runtime@v0.14.6/pkg/log/deleg.go:138
github.com/go-logr/logr.Logger.Error
github.com/go-logr/logr@v1.2.4/logr.go:299
sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start.func1.1
sigs.k8s.io/controller-runtime@v0.14.6/pkg/source/source.go:148
k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext
k8s.io/apimachinery@v0.26.3/pkg/util/wait/wait.go:235
k8s.io/apimachinery/pkg/util/wait.poll
k8s.io/apimachinery@v0.26.3/pkg/util/wait/wait.go:582
k8s.io/apimachinery/pkg/util/wait.PollImmediateUntilWithContext
k8s.io/apimachinery@v0.26.3/pkg/util/wait/wait.go:547
sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start.func1
sigs.k8s.io/controller-runtime@v0.14.6/pkg/source/source.go:136","ts":"2023-10-06T08:21:10.515Z"}{"error":"Timeout: failed waiting for *v1.Deployment Informer to sync","level":"error","logger":"main.controller-runtime.source","msg":"failed to get informer from cache","stacktrace":"github.com/Dynatrace/dynatrace-operator/src/logger.logSink.Error
github.com/Dynatrace/dynatrace-operator/src/logger/logger.go:40
sigs.k8s.io/controller-runtime/pkg/log.(*DelegatingLogSink).Error
sigs.k8s.io/controller-runtime@v0.14.6/pkg/log/deleg.go:138
github.com/go-logr/logr.Logger.Error
github.com/go-logr/logr@v1.2.4/logr.go:299
sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start.func1.1
sigs.k8s.io/controller-runtime@v0.14.6/pkg/source/source.go:148
k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext
k8s.io/apimachinery@v0.26.3/pkg/util/wait/wait.go:235
k8s.io/apimachinery/pkg/util/wait.poll
k8s.io/apimachinery@v0.26.3/pkg/util/wait/wait.go:582
k8s.io/apimachinery/pkg/util/wait.PollImmediateUntilWithContext
k8s.io/apimachinery@v0.26.3/pkg/util/wait/wait.go:547
sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start.func1
sigs.k8s.io/controller-runtime@v0.14.6/pkg/source/source.go:136","ts":"2023-10-06T08:21:10.515Z"}
making an assumption on your configurations using proxy.
In operator 13.x, the operator introduces an Active Gate service on port 443 (not that it’s documented), it used to be ignored to a certain extent until newer operators.
I’ve got similar errors this due to changes in the way that proxies are handled in the newer operators (14.x +), there was a ‘fix’ that Dynatrace put in place (I’ve requested documentation to be updated as part of our case, since it’s not currently - Dynatrace Operator release notes version 0.14.2 - Dynatrace Docs).
To fix this, you need to apply the ‘feature.dynatrace.com/no-proxy’ and possibly the ‘feature.dynatrace.com/oneagent-no-proxy’ flags to allow for internal routing to occur to this service. Otherwise, what we found was that the pod connections would try to route through the proxy (which does not know about local services).