/** * Generate cluster for a given destination group. * * NOTE: This method assumes that all destinations within a group share the same properties. * */ @Override public BrokerCluster generateCluster(String clusterId, int numReplicas, Address address, AddressPlan addressPlan, StandardInfraConfig standardInfraConfig) throws Exception { KubernetesListBuilder resourcesBuilder = new KubernetesListBuilder(); if (standardInfraConfig != null) { String templateName = getTemplateName(address, addressPlan, standardInfraConfig); KubernetesList newResources = processTemplate(clusterId, numReplicas, address, templateName, standardInfraConfig); resourcesBuilder.addAllToItems(newResources.getItems()); } return new BrokerCluster(clusterId, resourcesBuilder.build()); }
if (currentInfraConfig == null && !kubernetes.existsAddressSpace(addressSpace)) { KubernetesList resourceList = new KubernetesListBuilder() .addAllToItems(infraResourceFactory.createInfraResources(addressSpace, desiredInfraConfig)) .build(); addAppliedInfraConfigAnnotation(resourceList, desiredInfraConfig); .addAllToItems(infraResourceFactory.createInfraResources(addressSpace, desiredInfraConfig)) .build(); addAppliedInfraConfigAnnotation(resourceList, desiredInfraConfig); .addAllToItems(infraResourceFactory.createInfraResources(addressSpace, desiredInfraConfig)) .build(); addAppliedInfraConfigAnnotation(resourceList, desiredInfraConfig);