Class Config


  • public class Config
    extends Object
    • 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 a Config object in the all arguments constructor
        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_PER_HOST

        public static final String KUBERNETES_MAX_CONCURRENT_REQUESTS_PER_HOST
        See Also:
        Constant Field Values
      • KUBERNETES_TRUSTSTORE_PASSPHRASE_PROPERTY

        public static final String KUBERNETES_TRUSTSTORE_PASSPHRASE_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_KEYSTORE_PASSPHRASE_PROPERTY

        public static final String KUBERNETES_KEYSTORE_PASSPHRASE_PROPERTY
        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_SYSTEM_PROPERTY

        public static final String KUBERNETES_NAMESPACE_SYSTEM_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
      • 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
      • additionalProperties

        protected Map<String,​Object> additionalProperties
    • Method Detail

      • disableAutoConfig

        protected static boolean disableAutoConfig()
      • empty

        public static Config empty()
        Create an empty Config class 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 Config object 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

        public static Config fromKubeconfig​(String kubeconfigContents)
      • fromKubeconfig

        public static Config fromKubeconfig​(File kubeconfigFile)
      • fromKubeconfig

        public static Config fromKubeconfig​(String context,
                                            File kubeconfig)
      • 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()
      • getKeyAlgorithm

        public static String getKeyAlgorithm​(String clientKeyFile,
                                             String clientKeyData)
      • getOauthToken

        public String getOauthToken()
      • setOauthToken

        public void setOauthToken​(String oauthToken)
      • getPassword

        public String getPassword()
      • setPassword

        public void setPassword​(String password)
      • getUsername

        public String getUsername()
      • setUsername

        public void setUsername​(String username)
      • getImpersonateUsername

        public String getImpersonateUsername()
      • setImpersonateUsername

        public void setImpersonateUsername​(String impersonateUsername)
      • getImpersonateGroups

        public String[] getImpersonateGroups()
      • setImpersonateGroups

        public void setImpersonateGroups​(String... impersonateGroup)
      • setImpersonateExtras

        public void setImpersonateExtras​(Map<String,​List<String>> impersonateExtras)
      • getClientKeyPassphrase

        public String getClientKeyPassphrase()
      • setClientKeyPassphrase

        public void setClientKeyPassphrase​(String clientKeyPassphrase)
      • getClientKeyAlgo

        public String getClientKeyAlgo()
      • setClientKeyAlgo

        public void setClientKeyAlgo​(String clientKeyAlgo)
      • getClientKeyData

        public String getClientKeyData()
      • setClientKeyData

        public void setClientKeyData​(String clientKeyData)
      • getClientKeyFile

        public String getClientKeyFile()
      • setClientKeyFile

        public void setClientKeyFile​(String clientKeyFile)
      • getClientCertData

        public String getClientCertData()
      • setClientCertData

        public void setClientCertData​(String clientCertData)
      • getClientCertFile

        public String getClientCertFile()
      • setClientCertFile

        public void setClientCertFile​(String clientCertFile)
      • getCaCertData

        public String getCaCertData()
      • setCaCertData

        public void setCaCertData​(String caCertData)
      • getCaCertFile

        public String getCaCertFile()
      • setCaCertFile

        public void setCaCertFile​(String caCertFile)
      • getApiVersion

        public String getApiVersion()
      • setApiVersion

        public void setApiVersion​(String apiVersion)
      • getMasterUrl

        public String getMasterUrl()
      • 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 io.fabric8.kubernetes.api.model.ConfigBuilder builder()
      • getConnectionTimeout

        public Integer getConnectionTimeout()
      • setConnectionTimeout

        public void setConnectionTimeout​(Integer connectionTimeout)
      • 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()
      • setHttp2Disable

        public void setHttp2Disable​(Boolean http2Disable)
      • setHttpProxy

        public void setHttpProxy​(String httpProxy)
      • getHttpProxy

        public String getHttpProxy()
      • setHttpsProxy

        public void setHttpsProxy​(String httpsProxy)
      • getHttpsProxy

        public String getHttpsProxy()
      • setNoProxy

        public void setNoProxy​(String[] noProxy)
      • getNoProxy

        public String[] getNoProxy()
      • getNamespace

        public String getNamespace()
      • setNamespace

        public void setNamespace​(String namespace)
      • isDefaultNamespace

        public boolean isDefaultNamespace()
      • setDefaultNamespace

        public void setDefaultNamespace​(boolean defaultNamespace)
      • getUserAgent

        public String getUserAgent()
      • setUserAgent

        public void setUserAgent​(String userAgent)
      • getTlsVersions

        public TlsVersion[] getTlsVersions()
      • setTlsVersions

        public void setTlsVersions​(TlsVersion[] tlsVersions)
      • getWebsocketPingInterval

        public Long getWebsocketPingInterval()
      • setWebsocketPingInterval

        public void setWebsocketPingInterval​(Long websocketPingInterval)
      • getMaxConcurrentRequests

        public Integer getMaxConcurrentRequests()
      • setMaxConcurrentRequests

        public void setMaxConcurrentRequests​(Integer maxConcurrentRequests)
      • getMaxConcurrentRequestsPerHost

        public Integer getMaxConcurrentRequestsPerHost()
      • setMaxConcurrentRequestsPerHost

        public void setMaxConcurrentRequestsPerHost​(Integer maxConcurrentRequestsPerHost)
      • getProxyUsername

        public String getProxyUsername()
      • setProxyUsername

        public void setProxyUsername​(String proxyUsername)
      • getProxyPassword

        public String getProxyPassword()
      • setProxyPassword

        public void setProxyPassword​(String proxyPassword)
      • setTrustStorePassphrase

        public void setTrustStorePassphrase​(String trustStorePassphrase)
      • getTrustStorePassphrase

        public String getTrustStorePassphrase()
      • setKeyStorePassphrase

        public void setKeyStorePassphrase​(String keyStorePassphrase)
      • getKeyStorePassphrase

        public String getKeyStorePassphrase()
      • setTrustStoreFile

        public void setTrustStoreFile​(String trustStoreFile)
      • getTrustStoreFile

        public String getTrustStoreFile()
      • setKeyStoreFile

        public void setKeyStoreFile​(String keyStoreFile)
      • getKeyStoreFile

        public String getKeyStoreFile()
      • setOauthTokenProvider

        public void setOauthTokenProvider​(OAuthTokenProvider oauthTokenProvider)
      • setCustomHeaders

        public void setCustomHeaders​(Map<String,​String> customHeaders)
      • getAutoConfigure

        public Boolean getAutoConfigure()
      • getContexts

        public List<io.fabric8.kubernetes.api.model.NamedContext> getContexts()
        Returns all the NamedContexts that exist in the kube config
        Returns:
        all the contexts
        See Also:
        NamedContext
      • setContexts

        public void setContexts​(List<io.fabric8.kubernetes.api.model.NamedContext> contexts)
      • getCurrentContext

        public io.fabric8.kubernetes.api.model.NamedContext getCurrentContext()
        Returns the current context that's defined in the kube config. Returns null if there's none
        Returns:
        the current context
        See Also:
        NamedContext
      • setCurrentContext

        public void setCurrentContext​(io.fabric8.kubernetes.api.model.NamedContext context)
      • getFile

        public File getFile()
        Returns the path to the file that contains the context from which this configuration was loaded from.

        Returns null if 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 null if 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 null if no file was used.

        Returns:
        the path to the kubeconfig file.
      • getReadiness

        public Readiness getReadiness()
      • setAuthProvider

        public void setAuthProvider​(io.fabric8.kubernetes.api.model.AuthProviderConfig authProvider)
      • getAuthProvider

        public io.fabric8.kubernetes.api.model.AuthProviderConfig getAuthProvider()
      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
      • setAdditionalProperty

        public void setAdditionalProperty​(String name,
                                          Object value)
      • getAutoOAuthToken

        public String getAutoOAuthToken()
      • setAutoOAuthToken

        public void setAutoOAuthToken​(String autoOAuthToken)
      • isOnlyHttpWatches

        public boolean isOnlyHttpWatches()
      • setOnlyHttpWatches

        public void setOnlyHttpWatches​(boolean onlyHttpWatches)