Package io.fabric8.kubernetes.client
Class Config
- java.lang.Object
-
- io.fabric8.kubernetes.client.SundrioConfig
-
- io.fabric8.kubernetes.client.Config
-
public class Config extends SundrioConfig
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfig.ExecCredentialstatic classConfig.ExecCredentialSpecstatic classConfig.ExecCredentialStatus
-
Field Summary
-
Fields inherited from class io.fabric8.kubernetes.client.SundrioConfig
additionalProperties, apiVersion, authProvider, autoConfigure, autoOAuthToken, caCertData, caCertFile, clientCertData, clientCertFile, clientKeyAlgo, clientKeyData, clientKeyFile, clientKeyPassphrase, connectionTimeout, contexts, currentContext, customHeaders, defaultNamespace, disableHostnameVerification, http2Disable, httpProxy, httpsProxy, impersonateExtras, impersonateGroups, impersonateUsername, keyStoreFile, keyStorePassphrase, loggingInterval, masterUrl, maxConcurrentRequests, maxConcurrentRequestsPerHost, namespace, noProxy, oauthToken, oauthTokenProvider, onlyHttpWatches, password, proxyPassword, proxyUsername, requestRetryBackoffInterval, requestRetryBackoffLimit, requestTimeout, scaleTimeout, tlsVersions, trustCerts, trustStoreFile, trustStorePassphrase, uploadRequestTimeout, userAgent, username, watchReconnectInterval, watchReconnectLimit, websocketPingInterval
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedConfig()protectedConfig(boolean autoConfigure)Config(SundrioConfig config)Please useConfigBuilderor static factory methods to create new instances.protectedConfig(SundrioConfig config, Boolean shouldSetDefaultValues)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ConfigautoConfigure(String context)Does auto-detection with some opinionated defaults.static ConfigBuilderbuilder()static voidconfigFromSysPropsOrEnvVars(Config config)protected static booleandisableAutoConfig()static Configempty()Create an emptyConfigclass without any automatic configuration (i.e. reading system properties/environment variables to set values).static ConfigfromKubeconfig(File kubeconfigFile)static ConfigfromKubeconfig(String kubeconfigContents)static ConfigfromKubeconfig(String context, File kubeconfig)static ConfigfromKubeconfig(String context, String kubeconfigContents, String kubeconfigPath)Deprecated, for removal: This API element is subject to removal in a future version.usefromKubeconfig(File)insteadFilegetFile()Returns the path to the file that contains the context from which this configuration was loaded from.FilegetFileWithAuthInfo()Returns the path to the file that contains the user information from which this configuration was loaded from.FilegetFileWithCluster()Returns the path to the file that contains the cluster information from which this configuration was loaded from.protected static StringgetHomeDir(Predicate<String> directoryExists, UnaryOperator<String> getEnvVar)Map<String,List<String>>getImpersonateExtras()String[]getImpersonateGroups()StringgetImpersonateUsername()static StringgetKeyAlgorithm(InputStream inputStream)static StringgetKeyAlgorithm(String clientKeyFile, String clientKeyData)static Collection<String>getKubeconfigFilenames()IntegergetLoggingInterval()ReadinessgetReadiness()RequestConfiggetRequestConfig()IntegergetRequestRetryBackoffInterval()IntegergetRequestRetryBackoffLimit()IntegergetRequestTimeout()LonggetScaleTimeout()IntegergetUploadRequestTimeout()IntegergetWatchReconnectInterval()IntegergetWatchReconnectLimit()booleanisDefaultNamespace()booleanisDisableHostnameVerification()booleanisHttp2Disable()booleanisOnlyHttpWatches()booleanisTrustCerts()Configrefresh()Refresh the config from file / env sources.voidsetDefaultNamespace(boolean defaultNamespace)voidsetDisableHostnameVerification(boolean disableHostnameVerification)voidsetImpersonateExtras(Map<String,List<String>> impersonateExtras)voidsetImpersonateGroups(String... impersonateGroup)voidsetImpersonateUsername(String impersonateUsername)voidsetLoggingInterval(Integer loggingInterval)voidsetMasterUrl(String masterUrl)voidsetOnlyHttpWatches(boolean onlyHttpWatches)voidsetRequestRetryBackoffInterval(Integer requestRetryBackoffInterval)voidsetRequestRetryBackoffLimit(Integer requestRetryBackoffLimit)voidsetRequestTimeout(Integer requestTimeout)voidsetScaleTimeout(Long scaleTimeout)voidsetTrustCerts(boolean trustCerts)voidsetUploadRequestTimeout(Integer requestTimeout)voidsetWatchReconnectInterval(Integer watchReconnectInterval)voidsetWatchReconnectLimit(Integer watchReconnectLimit)-
Methods inherited from class io.fabric8.kubernetes.client.SundrioConfig
getAdditionalProperties, getContexts, getCurrentContext, setAdditionalProperty
-
-
-
-
Field Detail
-
KUBERNETES_DISABLE_AUTO_CONFIG_SYSTEM_PROPERTY
public static final String KUBERNETES_DISABLE_AUTO_CONFIG_SYSTEM_PROPERTY
Disables autoconfiguration based on opinionated defaults in aConfigobject in the all arguments constructor- See Also:
- Constant Field Values
-
KUBERNETES_MASTER_SYSTEM_PROPERTY
public static final String KUBERNETES_MASTER_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_API_VERSION_SYSTEM_PROPERTY
public static final String KUBERNETES_API_VERSION_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_TRUST_CERT_SYSTEM_PROPERTY
public static final String KUBERNETES_TRUST_CERT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_DISABLE_HOSTNAME_VERIFICATION_SYSTEM_PROPERTY
public static final String KUBERNETES_DISABLE_HOSTNAME_VERIFICATION_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CA_CERTIFICATE_FILE_SYSTEM_PROPERTY
public static final String KUBERNETES_CA_CERTIFICATE_FILE_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CA_CERTIFICATE_DATA_SYSTEM_PROPERTY
public static final String KUBERNETES_CA_CERTIFICATE_DATA_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CLIENT_CERTIFICATE_FILE_SYSTEM_PROPERTY
public static final String KUBERNETES_CLIENT_CERTIFICATE_FILE_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CLIENT_CERTIFICATE_DATA_SYSTEM_PROPERTY
public static final String KUBERNETES_CLIENT_CERTIFICATE_DATA_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CLIENT_KEY_FILE_SYSTEM_PROPERTY
public static final String KUBERNETES_CLIENT_KEY_FILE_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CLIENT_KEY_DATA_SYSTEM_PROPERTY
public static final String KUBERNETES_CLIENT_KEY_DATA_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CLIENT_KEY_ALGO_SYSTEM_PROPERTY
public static final String KUBERNETES_CLIENT_KEY_ALGO_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CLIENT_KEY_PASSPHRASE_SYSTEM_PROPERTY
public static final String KUBERNETES_CLIENT_KEY_PASSPHRASE_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_AUTH_BASIC_USERNAME_SYSTEM_PROPERTY
public static final String KUBERNETES_AUTH_BASIC_USERNAME_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_AUTH_BASIC_PASSWORD_SYSTEM_PROPERTY
public static final String KUBERNETES_AUTH_BASIC_PASSWORD_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY
public static final String KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_AUTH_TRYSERVICEACCOUNT_SYSTEM_PROPERTY
public static final String KUBERNETES_AUTH_TRYSERVICEACCOUNT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_AUTH_SERVICEACCOUNT_TOKEN_FILE_SYSTEM_PROPERTY
public static final String KUBERNETES_AUTH_SERVICEACCOUNT_TOKEN_FILE_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_OAUTH_TOKEN_SYSTEM_PROPERTY
public static final String KUBERNETES_OAUTH_TOKEN_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_WATCH_RECONNECT_INTERVAL_SYSTEM_PROPERTY
public static final String KUBERNETES_WATCH_RECONNECT_INTERVAL_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_WATCH_RECONNECT_LIMIT_SYSTEM_PROPERTY
public static final String KUBERNETES_WATCH_RECONNECT_LIMIT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_CONNECTION_TIMEOUT_SYSTEM_PROPERTY
public static final String KUBERNETES_CONNECTION_TIMEOUT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_UPLOAD_REQUEST_TIMEOUT_SYSTEM_PROPERTY
public static final String KUBERNETES_UPLOAD_REQUEST_TIMEOUT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_REQUEST_TIMEOUT_SYSTEM_PROPERTY
public static final String KUBERNETES_REQUEST_TIMEOUT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_REQUEST_RETRY_BACKOFFLIMIT_SYSTEM_PROPERTY
public static final String KUBERNETES_REQUEST_RETRY_BACKOFFLIMIT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_REQUEST_RETRY_BACKOFFINTERVAL_SYSTEM_PROPERTY
public static final String KUBERNETES_REQUEST_RETRY_BACKOFFINTERVAL_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_LOGGING_INTERVAL_SYSTEM_PROPERTY
public static final String KUBERNETES_LOGGING_INTERVAL_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_SCALE_TIMEOUT_SYSTEM_PROPERTY
public static final String KUBERNETES_SCALE_TIMEOUT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_WEBSOCKET_PING_INTERVAL_SYSTEM_PROPERTY
public static final String KUBERNETES_WEBSOCKET_PING_INTERVAL_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_MAX_CONCURRENT_REQUESTS
public static final String KUBERNETES_MAX_CONCURRENT_REQUESTS
- See Also:
- Constant Field Values
-
KUBERNETES_MAX_CONCURRENT_REQUESTS_PER_HOST
public static final String KUBERNETES_MAX_CONCURRENT_REQUESTS_PER_HOST
- See Also:
- Constant Field Values
-
KUBERNETES_IMPERSONATE_USERNAME
public static final String KUBERNETES_IMPERSONATE_USERNAME
- See Also:
- Constant Field Values
-
KUBERNETES_IMPERSONATE_GROUP
public static final String KUBERNETES_IMPERSONATE_GROUP
- See Also:
- Constant Field Values
-
KUBERNETES_TRUSTSTORE_PASSPHRASE_PROPERTY
public static final String KUBERNETES_TRUSTSTORE_PASSPHRASE_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_TRUSTSTORE_FILE_PROPERTY
public static final String KUBERNETES_TRUSTSTORE_FILE_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_KEYSTORE_PASSPHRASE_PROPERTY
public static final String KUBERNETES_KEYSTORE_PASSPHRASE_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_KEYSTORE_FILE_PROPERTY
public static final String KUBERNETES_KEYSTORE_FILE_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_TLS_VERSIONS
public static final String KUBERNETES_TLS_VERSIONS
- See Also:
- Constant Field Values
-
KUBERNETES_TRYNAMESPACE_PATH_SYSTEM_PROPERTY
public static final String KUBERNETES_TRYNAMESPACE_PATH_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_NAMESPACE_PATH
public static final String KUBERNETES_NAMESPACE_PATH
- See Also:
- Constant Field Values
-
KUBERNETES_NAMESPACE_FILE
public static final String KUBERNETES_NAMESPACE_FILE
- See Also:
- Constant Field Values
-
KUBERNETES_NAMESPACE_SYSTEM_PROPERTY
public static final String KUBERNETES_NAMESPACE_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_KUBECONFIG_FILE
public static final String KUBERNETES_KUBECONFIG_FILE
- See Also:
- Constant Field Values
-
KUBERNETES_SERVICE_HOST_PROPERTY
public static final String KUBERNETES_SERVICE_HOST_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_SERVICE_PORT_PROPERTY
public static final String KUBERNETES_SERVICE_PORT_PROPERTY
- See Also:
- Constant Field Values
-
KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH
public static final String KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH
- See Also:
- Constant Field Values
-
KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH
public static final String KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH
- See Also:
- Constant Field Values
-
KUBERNETES_HTTP2_DISABLE
public static final String KUBERNETES_HTTP2_DISABLE
- See Also:
- Constant Field Values
-
KUBERNETES_HTTP_PROXY
public static final String KUBERNETES_HTTP_PROXY
- See Also:
- Constant Field Values
-
KUBERNETES_HTTPS_PROXY
public static final String KUBERNETES_HTTPS_PROXY
- See Also:
- Constant Field Values
-
KUBERNETES_ALL_PROXY
public static final String KUBERNETES_ALL_PROXY
- See Also:
- Constant Field Values
-
KUBERNETES_NO_PROXY
public static final String KUBERNETES_NO_PROXY
- See Also:
- Constant Field Values
-
KUBERNETES_PROXY_USERNAME
public static final String KUBERNETES_PROXY_USERNAME
- See Also:
- Constant Field Values
-
KUBERNETES_PROXY_PASSWORD
public static final String KUBERNETES_PROXY_PASSWORD
- See Also:
- Constant Field Values
-
KUBERNETES_USER_AGENT
public static final String KUBERNETES_USER_AGENT
- See Also:
- Constant Field Values
-
DEFAULT_MASTER_URL
public static final String DEFAULT_MASTER_URL
- See Also:
- Constant Field Values
-
DEFAULT_SCALE_TIMEOUT
public static final Long DEFAULT_SCALE_TIMEOUT
-
DEFAULT_REQUEST_TIMEOUT
public static final int DEFAULT_REQUEST_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_LOGGING_INTERVAL
public static final int DEFAULT_LOGGING_INTERVAL
- See Also:
- Constant Field Values
-
DEFAULT_WEBSOCKET_PING_INTERVAL
public static final Long DEFAULT_WEBSOCKET_PING_INTERVAL
-
DEFAULT_MAX_CONCURRENT_REQUESTS
public static final Integer DEFAULT_MAX_CONCURRENT_REQUESTS
-
DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST
public static final Integer DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST
-
DEFAULT_REQUEST_RETRY_BACKOFFLIMIT
public static final Integer DEFAULT_REQUEST_RETRY_BACKOFFLIMIT
-
DEFAULT_REQUEST_RETRY_BACKOFFINTERVAL
public static final Integer DEFAULT_REQUEST_RETRY_BACKOFFINTERVAL
-
DEFAULT_UPLOAD_REQUEST_TIMEOUT
public static final int DEFAULT_UPLOAD_REQUEST_TIMEOUT
- See Also:
- Constant Field Values
-
HTTP_PROTOCOL_PREFIX
public static final String HTTP_PROTOCOL_PREFIX
- See Also:
- Constant Field Values
-
HTTPS_PROTOCOL_PREFIX
public static final String HTTPS_PROTOCOL_PREFIX
- See Also:
- Constant Field Values
-
SOCKS5_PROTOCOL_PREFIX
public static final String SOCKS5_PROTOCOL_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Config
protected Config(boolean autoConfigure)
-
Config
protected Config()
-
Config
public Config(SundrioConfig config)
Please useConfigBuilderor static factory methods to create new instances.All arguments constructor (only for serialization purposes).
- Parameters:
config- delegate configuration for deserialization.
-
Config
protected Config(SundrioConfig config, Boolean shouldSetDefaultValues)
-
-
Method Detail
-
disableAutoConfig
protected static boolean disableAutoConfig()
-
empty
public static Config empty()
Create an emptyConfigclass without any automatic configuration (i.e. reading system properties/environment variables to set values).The configuration does include the Kubernetes Client default values for timeouts, etc.
You can also reuse this object to build your own
Configobject without any auto configuration like this:Config configFromBuilder = new ConfigBuilder(Config.empty()) // ... .build();- Returns:
- a Config object without any automatic configuration.
-
autoConfigure
public static Config autoConfigure(String context)
Does auto-detection with some opinionated defaults.- Parameters:
context- if null will use current-context- Returns:
- Config object
-
configFromSysPropsOrEnvVars
public static void configFromSysPropsOrEnvVars(Config config)
-
fromKubeconfig
@Deprecated(since="7.0.0", forRemoval=true) public static Config fromKubeconfig(String context, String kubeconfigContents, String kubeconfigPath)
Deprecated, for removal: This API element is subject to removal in a future version.usefromKubeconfig(File)instead
-
refresh
public Config refresh()
Refresh the config from file / env sources. Any values that the user have programmatically set will be lost.- Returns:
- this Config instance with the refreshed values (if applicable)
-
getKubeconfigFilenames
public static Collection<String> getKubeconfigFilenames()
-
getHomeDir
protected static String getHomeDir(Predicate<String> directoryExists, UnaryOperator<String> getEnvVar)
-
getKeyAlgorithm
public static String getKeyAlgorithm(InputStream inputStream) throws IOException
- Throws:
IOException
-
getImpersonateUsername
public String getImpersonateUsername()
-
setImpersonateUsername
public void setImpersonateUsername(String impersonateUsername)
-
getImpersonateGroups
public String[] getImpersonateGroups()
-
setImpersonateGroups
public void setImpersonateGroups(String... impersonateGroup)
- Overrides:
setImpersonateGroupsin classSundrioConfig
-
setMasterUrl
public void setMasterUrl(String masterUrl)
-
isTrustCerts
public boolean isTrustCerts()
-
setTrustCerts
public void setTrustCerts(boolean trustCerts)
-
isDisableHostnameVerification
public boolean isDisableHostnameVerification()
-
setDisableHostnameVerification
public void setDisableHostnameVerification(boolean disableHostnameVerification)
-
getWatchReconnectInterval
public Integer getWatchReconnectInterval()
-
setWatchReconnectInterval
public void setWatchReconnectInterval(Integer watchReconnectInterval)
-
getWatchReconnectLimit
public Integer getWatchReconnectLimit()
-
setWatchReconnectLimit
public void setWatchReconnectLimit(Integer watchReconnectLimit)
-
builder
public static ConfigBuilder builder()
-
getUploadRequestTimeout
public Integer getUploadRequestTimeout()
-
setUploadRequestTimeout
public void setUploadRequestTimeout(Integer requestTimeout)
-
getRequestTimeout
public Integer getRequestTimeout()
-
setRequestTimeout
public void setRequestTimeout(Integer requestTimeout)
-
getRequestRetryBackoffLimit
public Integer getRequestRetryBackoffLimit()
-
setRequestRetryBackoffLimit
public void setRequestRetryBackoffLimit(Integer requestRetryBackoffLimit)
-
getRequestRetryBackoffInterval
public Integer getRequestRetryBackoffInterval()
-
setRequestRetryBackoffInterval
public void setRequestRetryBackoffInterval(Integer requestRetryBackoffInterval)
-
getScaleTimeout
public Long getScaleTimeout()
-
setScaleTimeout
public void setScaleTimeout(Long scaleTimeout)
-
getLoggingInterval
public Integer getLoggingInterval()
-
setLoggingInterval
public void setLoggingInterval(Integer loggingInterval)
-
isHttp2Disable
public boolean isHttp2Disable()
-
isDefaultNamespace
public boolean isDefaultNamespace()
-
setDefaultNamespace
public void setDefaultNamespace(boolean defaultNamespace)
-
getRequestConfig
public RequestConfig getRequestConfig()
-
getFile
public File getFile()
Returns the path to the file that contains the context from which this configuration was loaded from.Returns
nullif no file was used.- Returns:
- the path to the kubeconfig file.
-
getFileWithCluster
public File getFileWithCluster()
Returns the path to the file that contains the cluster information from which this configuration was loaded from.Returns
nullif no file was used.- Returns:
- the path to the kubeconfig file.
-
getFileWithAuthInfo
public File getFileWithAuthInfo()
Returns the path to the file that contains the user information from which this configuration was loaded from.Returns
nullif no file was used.- Returns:
- the path to the kubeconfig file.
-
getReadiness
public Readiness getReadiness()
-
isOnlyHttpWatches
public boolean isOnlyHttpWatches()
-
setOnlyHttpWatches
public void setOnlyHttpWatches(boolean onlyHttpWatches)
-
-