You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KubernetesAutoConfiguration depends on the injected KubernetesClientProperties but it seems that none of the properties are picked up and defaults are used. Thus the KubernetesClient is always created with default properties.
The workaround I'm doing right now is as follows but this is flies in the face of auto configuration.
@SpringBootApplication
@EnableConfigServer
@RestController
public class ConfigServerApp {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApp.class, args);
}
@Autowired
KubernetesClientProperties k8sClientProperties;
@Autowired
Config k8sClientConfig;
@RequestMapping(path = "/pods", produces = APPLICATION_JSON_UTF8_VALUE)
public Collection<Pod> pods() {
Config config = new Config();
config.configFromSysPropsOrEnvVars(k8sClientConfig);
config.setMasterUrl(k8sClientProperties.getMasterUrl());
config.setNamespace(k8sClientProperties.getNamespace());
KubernetesClient k8sClient = new DefaultKubernetesClient(config);
return k8sClient.pods().list().getItems();
}
}
Same issue here, as @phoenix2x indicates, KubernetesClientProperties is getting instantiated after KubernetesAutoConfiguration, which prevents DefaultKubernetesClient from getting configured.
KubernetesAutoConfiguration
depends on the injectedKubernetesClientProperties
but it seems that none of the properties are picked up and defaults are used. Thus theKubernetesClient
is always created with default properties.The workaround I'm doing right now is as follows but this is flies in the face of auto configuration.
In the
application.yml
:The text was updated successfully, but these errors were encountered: