Search in sources :

Example 6 with NodeInstance

use of com.epam.pipeline.entity.cluster.NodeInstance in project cloud-pipeline by epam.

the class CAdvisorMonitoringManagerTest method getNodeInstance.

private NodeInstance getNodeInstance(String address, String type, String nodeName) {
    NodeAddress nodeAddress = new NodeAddress(address, type);
    NodeInstanceAddress nodeInstanceAddress = new NodeInstanceAddress(nodeAddress);
    NodeInstance nodeWithIP = new NodeInstance();
    nodeWithIP.setName(nodeName);
    nodeWithIP.setAddresses(Collections.singletonList(nodeInstanceAddress));
    return nodeWithIP;
}
Also used : NodeInstanceAddress(com.epam.pipeline.entity.cluster.NodeInstanceAddress) NodeAddress(io.fabric8.kubernetes.api.model.NodeAddress) NodeInstance(com.epam.pipeline.entity.cluster.NodeInstance)

Example 7 with NodeInstance

use of com.epam.pipeline.entity.cluster.NodeInstance in project cloud-pipeline by epam.

the class CAdvisorMonitoringManagerTest method configureMocksForGetStatsForNodeWithIp.

private void configureMocksForGetStatsForNodeWithIp() {
    NodeInstance nodeWithIP = getNodeInstance(INTERNALIP_ADDRESS, INTERNALIP_TYPE, NODE_WITH_INTERNALIP_ADRESS);
    when(nodesManager.getNode(NODE_WITH_INTERNALIP_ADRESS)).thenReturn(nodeWithIP);
    when(messageHelper.getMessage(anyString(), anyObject())).thenReturn(TEST_MESSAGE);
    Whitebox.setInternalState(cAdvisorMonitoringManager, "cAdvisorPort", (wireMockRule.port()));
    stubFor(get("/api/v1.3/containers/").willReturn(aResponse().withBodyFile("cadvisor.json").withStatus(OK_STATUS)));
}
Also used : NodeInstance(com.epam.pipeline.entity.cluster.NodeInstance)

Aggregations

NodeInstance (com.epam.pipeline.entity.cluster.NodeInstance)7 DefaultKubernetesClient (io.fabric8.kubernetes.client.DefaultKubernetesClient)4 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)4 NodeInstanceAddress (com.epam.pipeline.entity.cluster.NodeInstanceAddress)3 DoneableNode (io.fabric8.kubernetes.api.model.DoneableNode)3 Node (io.fabric8.kubernetes.api.model.Node)3 Config (io.fabric8.kubernetes.client.Config)3 StringUtils (com.amazonaws.util.StringUtils)2 MessageConstants (com.epam.pipeline.common.MessageConstants)2 MessageHelper (com.epam.pipeline.common.MessageHelper)2 FilterNodesVO (com.epam.pipeline.controller.vo.FilterNodesVO)2 ClusterDao (com.epam.pipeline.dao.cluster.ClusterDao)2 FilterPodsRequest (com.epam.pipeline.entity.cluster.FilterPodsRequest)2 PodInstance (com.epam.pipeline.entity.cluster.PodInstance)2 PipelineRun (com.epam.pipeline.entity.pipeline.PipelineRun)2 TaskStatus (com.epam.pipeline.entity.pipeline.TaskStatus)2 CmdExecutor (com.epam.pipeline.manager.CmdExecutor)2 PipelineRunManager (com.epam.pipeline.manager.pipeline.PipelineRunManager)2 Resource (io.fabric8.kubernetes.client.dsl.Resource)2 ArrayList (java.util.ArrayList)2