public class ClientBuilder extends Object
ApiClient
s in a fluent fashion.Constructor and Description |
---|
ClientBuilder() |
Modifier and Type | Method and Description |
---|---|
io.kubernetes.client.openapi.ApiClient |
build() |
static ClientBuilder |
cluster()
Creates a builder which is pre-configured from the cluster configuration.
|
static io.kubernetes.client.openapi.ApiClient |
defaultClient()
|
static io.kubernetes.client.openapi.ApiClient |
fromCertificateSigningRequest(io.kubernetes.client.openapi.ApiClient bootstrapApiClient,
PrivateKey privateKey,
io.kubernetes.client.openapi.models.V1CertificateSigningRequest csr)
Returns a new ApiClient instance reading from CertificateSigningRequest.
|
static io.kubernetes.client.openapi.ApiClient |
fromCertificateSigningRequest(KubeConfig bootstrapKubeConfig,
PrivateKey privateKey,
io.kubernetes.client.openapi.models.V1CertificateSigningRequest csr)
Returns a new ApiClient instance reading from CertificateSigningRequest.
|
Authentication |
getAuthentication() |
String |
getBasePath() |
String |
getKeyStorePassphrase() |
Duration |
getPingInterval() |
List<okhttp3.Protocol> |
getProtocols() |
Duration |
getReadTimeout() |
boolean |
isVerifyingSsl() |
static ClientBuilder |
kubeconfig(KubeConfig config)
Creates a builder which is pre-configured from a
KubeConfig . |
static ClientBuilder |
oldCluster()
[DEPRECATED] Creates a builder which is pre-configured from the cluster configuration.
|
ClientBuilder |
setAuthentication(Authentication authentication) |
ClientBuilder |
setBasePath(String basePath) |
protected ClientBuilder |
setBasePath(String host,
String port) |
ClientBuilder |
setCertificateAuthority(byte[] caCertBytes) |
ClientBuilder |
setKeyStorePassphrase(String keyStorePassphrase) |
ClientBuilder |
setPingInterval(Duration pingInterval) |
ClientBuilder |
setProtocols(List<okhttp3.Protocol> protocols) |
ClientBuilder |
setReadTimeout(Duration readTimeout) |
ClientBuilder |
setVerifyingSsl(boolean verifyingSsl) |
static ClientBuilder |
standard()
Creates a builder which is pre-configured in the following way
If $KUBECONFIG is defined, use that config file.
|
static ClientBuilder |
standard(boolean persistConfig) |
public static io.kubernetes.client.openapi.ApiClient defaultClient() throws IOException
standard()
.IOException
- if the configuration file or a file specified in a configuration file
cannot be read.public static ClientBuilder standard() throws IOException
IOException
- if the configuration file or a file specified in a configuration file
cannot be read.public static ClientBuilder standard(boolean persistConfig) throws IOException
IOException
public static ClientBuilder oldCluster() throws IOException
IOException
- if the Service Account Token Path or CA Path is not readable.public static ClientBuilder cluster() throws IOException
IOException
- if the Service Account Token Path or CA Path is not readable.protected ClientBuilder setBasePath(String host, String port)
public static ClientBuilder kubeconfig(KubeConfig config) throws IOException
KubeConfig
.
To load a KubeConfig, see KubeConfig.loadKubeConfig(Reader)
.
config
- The KubeConfig
to configure the builder from.IOException
- if the files specified in the provided KubeConfig are not readablepublic static io.kubernetes.client.openapi.ApiClient fromCertificateSigningRequest(KubeConfig bootstrapKubeConfig, PrivateKey privateKey, io.kubernetes.client.openapi.models.V1CertificateSigningRequest csr) throws IOException, CSRNotApprovedException, io.kubernetes.client.openapi.ApiException
It will create a CertificateSigningRequest object to the cluster if it doesn't exist, and waits until the request is approved.
bootstrapKubeConfig
- the bootstrap kube configprivateKey
- the private keycsr
- the csrIOException
- the io exceptionCSRNotApprovedException
- the csr not approved exceptionio.kubernetes.client.openapi.ApiException
- the api exceptionpublic static io.kubernetes.client.openapi.ApiClient fromCertificateSigningRequest(io.kubernetes.client.openapi.ApiClient bootstrapApiClient, PrivateKey privateKey, io.kubernetes.client.openapi.models.V1CertificateSigningRequest csr) throws IOException, CSRNotApprovedException, io.kubernetes.client.openapi.ApiException
It will create a CertificateSigningRequest object to the cluster if it doesn't exist, and waits until the request is approved.
bootstrapApiClient
- the bootstrap api clientprivateKey
- the private keycsr
- the csrIOException
- the io exceptionCSRNotApprovedException
- the csr not approved exceptionio.kubernetes.client.openapi.ApiException
- the api exceptionpublic String getBasePath()
public ClientBuilder setBasePath(String basePath)
public Authentication getAuthentication()
public ClientBuilder setAuthentication(Authentication authentication)
public ClientBuilder setCertificateAuthority(byte[] caCertBytes)
public boolean isVerifyingSsl()
public ClientBuilder setVerifyingSsl(boolean verifyingSsl)
public ClientBuilder setProtocols(List<okhttp3.Protocol> protocols)
public List<okhttp3.Protocol> getProtocols()
public ClientBuilder setReadTimeout(Duration readTimeout)
public Duration getReadTimeout()
public ClientBuilder setPingInterval(Duration pingInterval)
public Duration getPingInterval()
public String getKeyStorePassphrase()
public ClientBuilder setKeyStorePassphrase(String keyStorePassphrase)
public io.kubernetes.client.openapi.ApiClient build()
Copyright © 2021. All rights reserved.