Codota Logo
Config.setNamespace
Code IndexAdd Codota to your IDE (free)

How to use
setNamespace
method
in
io.fabric8.kubernetes.client.Config

Best Java code snippets using io.fabric8.kubernetes.client.Config.setNamespace (Showing top 8 results out of 315)

  • Common ways to obtain Config
private void myMethod () {
Config c =
  • Codota IconString str;new ConfigBuilder().withMasterUrl(str).build()
  • Codota Iconnew Config()
  • Codota Iconnew ConfigBuilder().build()
  • Smart code suggestions by Codota
}
origin: fabric8io/kubernetes-client

private static boolean tryNamespaceFromPath(Config config) {
 LOGGER.debug("Trying to configure client namespace from Kubernetes service account namespace path...");
 if (Utils.getSystemPropertyOrEnvVar(KUBERNETES_TRYNAMESPACE_PATH_SYSTEM_PROPERTY, true)) {
  String serviceAccountNamespace = Utils.getSystemPropertyOrEnvVar(KUBERNETES_NAMESPACE_FILE, KUBERNETES_NAMESPACE_PATH);
  boolean serviceAccountNamespaceExists = Files.isRegularFile(new File(serviceAccountNamespace).toPath());
  if (serviceAccountNamespaceExists) {
   LOGGER.debug("Found service account namespace at: [" + serviceAccountNamespace + "].");
   try {
    String namespace = new String(Files.readAllBytes(new File(serviceAccountNamespace).toPath()));
    config.setNamespace(namespace.replace(System.lineSeparator(), ""));
    return true;
   } catch (IOException e) {
    LOGGER.error("Error reading service account namespace from: [" + serviceAccountNamespace + "].", e);
   }
  } else {
   LOGGER.debug("Did not find service account namespace at: [" + serviceAccountNamespace + "]. Ignoring.");
  }
 }
 return false;
}
origin: fabric8io/kubernetes-client

if (currentCluster != null) {
 config.setMasterUrl(currentCluster.getServer());
 config.setNamespace(currentContext.getNamespace());
 config.setTrustCerts(currentCluster.getInsecureSkipTlsVerify() != null && currentCluster.getInsecureSkipTlsVerify());
 config.setDisableHostnameVerification(currentCluster.getInsecureSkipTlsVerify() != null && currentCluster.getInsecureSkipTlsVerify());
origin: fabric8io/kubernetes-client

config.setMasterUrl(Utils.getSystemPropertyOrEnvVar(KUBERNETES_MASTER_SYSTEM_PROPERTY, config.getMasterUrl()));
config.setApiVersion(Utils.getSystemPropertyOrEnvVar(KUBERNETES_API_VERSION_SYSTEM_PROPERTY, config.getApiVersion()));
config.setNamespace(Utils.getSystemPropertyOrEnvVar(KUBERNETES_NAMESPACE_SYSTEM_PROPERTY, config.getNamespace()));
config.setCaCertFile(Utils.getSystemPropertyOrEnvVar(KUBERNETES_CA_CERTIFICATE_FILE_SYSTEM_PROPERTY, config.getCaCertFile()));
config.setCaCertData(Utils.getSystemPropertyOrEnvVar(KUBERNETES_CA_CERTIFICATE_DATA_SYSTEM_PROPERTY, config.getCaCertData()));
origin: org.domeos/kubernetes-client

private boolean tryNamespaceFromPath(Config config) {
 LOGGER.debug("Trying to configure client namespace from Kubernetes service account namespace path...");
 if (Utils.getSystemPropertyOrEnvVar(KUBERNETES_TRYNAMESPACE_PATH_SYSTEM_PROPERTY, true)) {
  String serviceAccountNamespace = Utils.getSystemPropertyOrEnvVar(KUBERNETES_NAMESPACE_FILE, KUBERNETES_NAMESPACE_PATH);
  boolean serviceAccountNamespaceExists = Files.isRegularFile(new File(serviceAccountNamespace).toPath());
  if (serviceAccountNamespaceExists) {
   LOGGER.debug("Found service account namespace at: [" + serviceAccountNamespace + "].");
   try {
    String namespace = new String(Files.readAllBytes(new File(serviceAccountNamespace).toPath()));
    config.setNamespace(namespace.replace(System.lineSeparator(), ""));
    return true;
   } catch (IOException e) {
    LOGGER.error("Error reading service account namespace from: [" + serviceAccountNamespace + "].", e);
   }
  } else {
   LOGGER.debug("Did not find service account namespace at: [" + serviceAccountNamespace + "]. Ignoring.");
  }
 }
 return false;
}
origin: spring-cloud/spring-cloud-deployer-kubernetes

public static KubernetesClient getKubernetesClient(KubernetesDeployerProperties kubernetesDeployerProperties) {
  Config config = kubernetesDeployerProperties.getFabric8();
  // Since namespace is used as a deployer as well as a client property, merging it from the deployer if it is not
  // already set in the client properties.
  if (config.getNamespace() == null) {
    config.setNamespace(kubernetesDeployerProperties.getNamespace());
  }
  return new DefaultKubernetesClient(config);
}
origin: org.domeos/kubernetes-client

if (currentCluster != null) {
 config.setMasterUrl(currentCluster.getServer());
 config.setNamespace(currentContext.getNamespace());
 config.setTrustCerts(currentCluster.getInsecureSkipTlsVerify() != null && currentCluster.getInsecureSkipTlsVerify());
 config.setCaCertFile(absolutify(kubeConfigFile, currentCluster.getCertificateAuthority()));
origin: org.domeos/kubernetes-client

config.setMasterUrl(Utils.getSystemPropertyOrEnvVar(KUBERNETES_MASTER_SYSTEM_PROPERTY, config.getMasterUrl()));
config.setApiVersion(Utils.getSystemPropertyOrEnvVar(KUBERNETES_API_VERSION_SYSTEM_PROPERTY, config.getApiVersion()));
config.setNamespace(Utils.getSystemPropertyOrEnvVar(KUBERNETES_NAMESPACE_SYSTEM_PROPERTY, config.getNamespace()));
config.setCaCertFile(Utils.getSystemPropertyOrEnvVar(KUBERNETES_CA_CERTIFICATE_FILE_SYSTEM_PROPERTY, config.getCaCertFile()));
config.setCaCertData(Utils.getSystemPropertyOrEnvVar(KUBERNETES_CA_CERTIFICATE_DATA_SYSTEM_PROPERTY, config.getCaCertData()));
origin: amoAHCP/vxms

 private void updateKubeConfig(Config kubeConfig, JsonObject config, K8SDiscovery annotation) {
  final String user = ConfigurationUtil.getStringConfiguration(config, USER, annotation.user());
  final String password =
    ConfigurationUtil.getStringConfiguration(config, PASSWORD, annotation.password());
  final String api_token =
    ConfigurationUtil.getStringConfiguration(config, API_TOKEN, annotation.api_token());
  final String master_url =
    ConfigurationUtil.getStringConfiguration(config, MASTER_URL, annotation.master_url());
  final String namespace =
    ConfigurationUtil.getStringConfiguration(config, NAMESPACE, annotation.namespace());
  if (StringUtil.isNullOrEmpty(kubeConfig.getUsername())) kubeConfig.setUsername(user);
  if (StringUtil.isNullOrEmpty(kubeConfig.getPassword())) kubeConfig.setPassword(password);
  if (StringUtil.isNullOrEmpty(kubeConfig.getOauthToken())) kubeConfig.setOauthToken(api_token);
  if (StringUtil.isNullOrEmpty(kubeConfig.getMasterUrl())) kubeConfig.setMasterUrl(master_url);
  if (StringUtil.isNullOrEmpty(kubeConfig.getNamespace())) kubeConfig.setNamespace(namespace);
  // check oauthToken
  if (StringUtil.isNullOrEmpty(kubeConfig.getOauthToken()))
   kubeConfig.setOauthToken(TokenUtil.getAccountToken());
 }
}
io.fabric8.kubernetes.clientConfigsetNamespace

Popular methods of Config

  • getMasterUrl
  • getOauthToken
  • getNamespace
  • getPassword
  • getUsername
  • getCaCertData
  • getClientCertData
  • getClientKeyData
  • getClientKeyPassphrase
  • getCaCertFile
  • getClientCertFile
  • getClientKeyAlgo
  • getClientCertFile,
  • getClientKeyAlgo,
  • getClientKeyFile,
  • getRequestTimeout,
  • isTrustCerts,
  • autoConfigure,
  • getApiVersion,
  • getConnectionTimeout,
  • getRollingTimeout,
  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now