io.fabric8.kubernetes.api.model.Node.getStatus()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(313)

本文整理了Java中io.fabric8.kubernetes.api.model.Node.getStatus()方法的一些代码示例,展示了Node.getStatus()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getStatus()方法的具体详情如下:
包路径:io.fabric8.kubernetes.api.model.Node
类名称:Node
方法名:getStatus

Node.getStatus介绍

暂无

代码示例

代码示例来源:origin: fabric8io/kubernetes-client

  1. /**
  2. * Returns the ready condition of the node.
  3. *
  4. * @param node The target node.
  5. * @return The {@link NodeCondition} or null if not found.
  6. */
  7. private static NodeCondition getNodeReadyCondition(Node node) {
  8. Utils.checkNotNull(node, "Node can't be null.");
  9. if (node.getStatus() == null || node.getStatus().getConditions() == null) {
  10. return null;
  11. }
  12. for (NodeCondition condition : node.getStatus().getConditions()) {
  13. if (NODE_READY.equals(condition.getType())) {
  14. return condition;
  15. }
  16. }
  17. return null;
  18. }
  19. }

代码示例来源:origin: fabric8io/kubernetes-client

  1. public String getURL(Service service, String portName, String namespace, KubernetesClient client) {
  2. ServicePort port = URLFromServiceUtil.getServicePortByName(service, portName);
  3. String serviceProto = port.getProtocol();
  4. NodePortUrlComponents urlComponents = null;
  5. Integer nodePort = port.getNodePort();
  6. if(nodePort != null) {
  7. try {
  8. NodeList nodeList = client.nodes().list();
  9. if(nodeList != null && nodeList.getItems() != null) {
  10. for(Node item : nodeList.getItems()) {
  11. urlComponents = getUrlComponentsFromNodeList(item.getStatus(), nodePort);
  12. if(urlComponents != null) {
  13. break;
  14. }
  15. }
  16. }
  17. } catch (KubernetesClientException exception) {
  18. logger.warn("Could not find a node! " + exception);
  19. }
  20. }
  21. return urlComponents != null ? (serviceProto + "://" + urlComponents.getClusterIP() + ":" + urlComponents.getPortNumber()).toLowerCase() : null;
  22. }

代码示例来源:origin: strimzi/strimzi-kafka-operator

  1. /**
  2. * Write the external address of this node
  3. *
  4. * @return if the operation was executed successfully
  5. */
  6. public boolean writeExternalAddress() {
  7. List<NodeAddress> addresses = client.nodes().withName(config.getNodeName()).get().getStatus().getAddresses();
  8. log.info("NodeLabels = {}", addresses);
  9. String externalAddress = findAddress(addresses);
  10. if (externalAddress == null) {
  11. log.error("External address nto found");
  12. return false;
  13. } else {
  14. log.info("External address found {}", externalAddress);
  15. }
  16. return write(FILE_EXTERNAL_ADDRESS, externalAddress);
  17. }

代码示例来源:origin: LendingClub/mercator

  1. public void scanNode(Node node) {
  2. ObjectNode n = mapper.createObjectNode();
  3. ObjectMeta meta = node.getMetadata();
  4. n.put("nodeUid", meta.getUid());
  5. n.put("resourceVersion", meta.getResourceVersion());
  6. n.put("name", meta.getName());
  7. n.put("namespace", meta.getNamespace());
  8. n.put("clusterName", meta.getClusterName());
  9. n.put("generateName", meta.getGenerateName());
  10. n.put("creationTimestamp", meta.getCreationTimestamp());
  11. n.put("deletionTimestamp", meta.getDeletionTimestamp());
  12. n.put("deletionGracePeriod", meta.getDeletionGracePeriodSeconds());
  13. n.put("selfLink", meta.getSelfLink());
  14. NodeStatus ns = node.getStatus();
  15. NodeSpec nodeSpec = node.getSpec();
  16. n.put("externalId", nodeSpec.getExternalID());
  17. n.put("unschedulable", nodeSpec.getUnschedulable());
  18. n.put("podCIDR", nodeSpec.getPodCIDR());
  19. n.put("providerId", nodeSpec.getProviderID());
  20. n.put("clusterId", clusterId);
  21. getNeoRxClient().execCypher("merge (n:KubeNode {nodeUid:{nodeUid}}) set n.clusterId={clusterId}, n+={props}",
  22. "nodeUid", meta.getUid(), "props", n, "clusterId", clusterId);
  23. }

代码示例来源:origin: org.domeos/kubernetes-model

  1. public NodeFluentImpl(Node instance){
  2. this.withApiVersion(instance.getApiVersion());
  3. this.withKind(instance.getKind());
  4. this.withMetadata(instance.getMetadata());
  5. this.withSpec(instance.getSpec());
  6. this.withStatus(instance.getStatus());
  7. }

代码示例来源:origin: org.domeos/kubernetes-model

  1. public NodeBuilder(NodeFluent<?> fluent,Node instance,Boolean validationEnabled){
  2. this.fluent = fluent;
  3. fluent.withApiVersion(instance.getApiVersion());
  4. fluent.withKind(instance.getKind());
  5. fluent.withMetadata(instance.getMetadata());
  6. fluent.withSpec(instance.getSpec());
  7. fluent.withStatus(instance.getStatus());
  8. this.validationEnabled = validationEnabled;
  9. }
  10. public NodeBuilder(Node instance){

代码示例来源:origin: org.domeos/kubernetes-model

  1. public NodeBuilder(Node instance,Boolean validationEnabled){
  2. this.fluent = this;
  3. this.withApiVersion(instance.getApiVersion());
  4. this.withKind(instance.getKind());
  5. this.withMetadata(instance.getMetadata());
  6. this.withSpec(instance.getSpec());
  7. this.withStatus(instance.getStatus());
  8. this.validationEnabled = validationEnabled;
  9. }

代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model

  1. public NodeBuilder( NodeFluent<?> fluent , Node instance ){
  2. this.fluent = fluent; fluent.withApiVersion(instance.getApiVersion()); fluent.withKind(instance.getKind()); fluent.withMetadata(instance.getMetadata()); fluent.withSpec(instance.getSpec()); fluent.withStatus(instance.getStatus());
  3. }
  4. public NodeBuilder( Node instance ){

代码示例来源:origin: org.apache.stratos/kubernetes-model

  1. public NodeBuilder( NodeFluent<?> fluent , Node instance ){
  2. this.fluent = fluent; fluent.withApiVersion(instance.getApiVersion()); fluent.withKind(instance.getKind()); fluent.withMetadata(instance.getMetadata()); fluent.withSpec(instance.getSpec()); fluent.withStatus(instance.getStatus());
  3. }
  4. public NodeBuilder( Node instance ){

代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model

  1. public NodeBuilder( Node instance ){
  2. this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.withSpec(instance.getSpec()); this.withStatus(instance.getStatus());
  3. }

代码示例来源:origin: org.apache.stratos/kubernetes-model

  1. public NodeBuilder( Node instance ){
  2. this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.withSpec(instance.getSpec()); this.withStatus(instance.getStatus());
  3. }

代码示例来源:origin: fabric8io/fabric8-maven-plugin

  1. if (items != null) {
  2. for (Node item : items) {
  3. NodeStatus status = item.getStatus();
  4. if (!found && status != null) {
  5. List<NodeAddress> addresses = status.getAddresses();

相关文章