public class KubernetesClientWrapper extends Object
| Constructor and Description |
|---|
KubernetesClientWrapper(String kubeConfigFilePath) |
KubernetesClientWrapper(String server,
String certificateAuthorityData,
String clientCertificateData,
String clientKeyData) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(hudson.FilePath[] configFiles)
Apply Kubernetes configurations through the given Kubernetes client.
|
void |
createOrReplaceSecrets(String kubernetesNamespace,
String secretName,
List<ResolvedDockerRegistryEndpoint> credentials)
Construct the dockercfg with all the provided credentials, and create a new Secret resource for the Kubernetes
cluster.
|
io.fabric8.kubernetes.client.KubernetesClient |
getClient() |
PrintStream |
getLogger() |
ResourceUpdateMonitor |
getResourceUpdateMonitor() |
hudson.util.VariableResolver<String> |
getVariableResolver() |
static io.fabric8.kubernetes.client.Config |
kubeConfigFromFile(String filePath)
Build config from the kubeconfig file.
|
static String |
prepareSecretName(String nameCfg,
String defaultName,
hudson.EnvVars envVars) |
KubernetesClientWrapper |
withLogger(PrintStream log) |
KubernetesClientWrapper |
withResourceUpdateMonitor(ResourceUpdateMonitor monitor) |
KubernetesClientWrapper |
withVariableResolver(hudson.util.VariableResolver<String> resolver) |
public KubernetesClientWrapper(String kubeConfigFilePath)
public io.fabric8.kubernetes.client.KubernetesClient getClient()
public PrintStream getLogger()
public KubernetesClientWrapper withLogger(PrintStream log)
public hudson.util.VariableResolver<String> getVariableResolver()
public KubernetesClientWrapper withVariableResolver(hudson.util.VariableResolver<String> resolver)
public ResourceUpdateMonitor getResourceUpdateMonitor()
public KubernetesClientWrapper withResourceUpdateMonitor(ResourceUpdateMonitor monitor)
public void apply(hudson.FilePath[] configFiles)
throws IOException,
InterruptedException
configFiles - The configuration files to be deployedIOException - exception on IOInterruptedException - interruption happened during blocking IO operationspublic void createOrReplaceSecrets(String kubernetesNamespace, String secretName, List<ResolvedDockerRegistryEndpoint> credentials) throws IOException
This can be used by the Pods later to pull images from the private container registry.
kubernetesNamespace - The namespace in which the Secret should be created / updatedsecretName - The name of the Secretcredentials - All the configured credentialsIOException - exception on IOpublic static io.fabric8.kubernetes.client.Config kubeConfigFromFile(String filePath)
This requires to update the system property. In order to avoid changing the system property at the same time from multiple running jobs, the method is marked as synchronized.
filePath - the kubeconfig file pathKubernetesClientCopyright © 2016–2017. All rights reserved.