use of io.fabric8.openclustermanagement.client.DefaultOpenClusterManagementClient in project kubernetes-client by fabric8io.
the class ManagedClusterList method main.
public static void main(String[] args) {
try (OpenClusterManagementClient ocmClient = new DefaultOpenClusterManagementClient()) {
logger.info("Listing all ManagedClusters: ");
ocmClient.clusters().managedClusters().list().getItems().stream().map(ManagedCluster::getMetadata).map(ObjectMeta::getName).forEach(logger::info);
}
}
use of io.fabric8.openclustermanagement.client.DefaultOpenClusterManagementClient in project kubernetes-client by fabric8io.
the class ManagedClusterSetCreate method main.
public static void main(String[] args) {
try (OpenClusterManagementClient ocmClient = new DefaultOpenClusterManagementClient()) {
ManagedClusterSet managedClusterSet = new ManagedClusterSetBuilder().withNewMetadata().withName("managedclusterset1").endMetadata().withNewSpec().endSpec().build();
logger.info("Creating ManagedClusterSet {}", managedClusterSet.getMetadata().getName());
ocmClient.clusters().managedClusterSets().create(managedClusterSet);
}
}
use of io.fabric8.openclustermanagement.client.DefaultOpenClusterManagementClient in project kubernetes-client by fabric8io.
the class PlacementRuleCreate method main.
public static void main(String[] args) {
try (OpenClusterManagementClient ocmClient = new DefaultOpenClusterManagementClient()) {
PlacementRule placementRule = new PlacementRuleBuilder().withNewMetadata().withName("towhichcluster").endMetadata().withNewSpec().addNewClusterCondition().withType("ManagedClusterConditionAvailable").withStatus("True").endClusterCondition().endSpec().build();
logger.info("Creating PlacementRule {}", placementRule.getMetadata().getName());
ocmClient.apps().placementRules().inNamespace("default").create(placementRule);
logger.info("Success.");
}
}
Aggregations