<p>I have a SpringBoot application with a class that has scheduled functions.
I have another class 'ConditionalScheduler', that is supposed to manage the schedulers based on some properties in my application config.</p>
<p>Code snippets:</p>
<pre><code>@Configuration
@EnableScheduling
public class ConditionalScheduler {

    @Bean
    @ConditionalOnProperty(value = &quot;custom-property.custom-sub-property.enabled&quot;, havingValue = &quot;true&quot;, matchIfMissing = false)
    public Scheduler scheduler() {
        return new Scheduler();
    }
}
</code></pre>
<pre><code>
@Slf4j
public class Scheduler {

    @Scheduled(initialDelay = 0, fixedDelay = 1, timeUnit = TimeUnit.DAYS)
    public void run() {
        .....
    }

}
</code></pre>
<p>This works well when I run it locally.
But when I deploy it on a k8s cluster it does not create the scheduler bean.
Even when I set the matchIfMissing property to 'true' it does not start anything.
I checked all places for typos and there is nothing.</p>
<p>Does anyone have an idea why this might happen?
I am happy to provide more information if needed.</p>
<p>Thanks in advance
Paul</p>

P D
<p>please check whether your configuration file is loaded correctly in Kubernetes. I suggest you to write a simple function to retrieve property value from configuration file to see if it works.</p>
