use of io.strimzi.systemtest.resources.ResourceItem in project strimzi by strimzi.
the class TracingST method deployJaegerInstance.
/**
* Install of Jaeger instance
*/
void deployJaegerInstance(ExtensionContext extensionContext, String namespaceName) {
LOGGER.info("=== Applying jaeger instance install file ===");
String instanceYamlContent = TestUtils.getContent(new File(jaegerInstancePath), TestUtils::toYamlString);
cmdKubeClient(namespaceName).applyContent(instanceYamlContent.replaceAll("image: 'jaegertracing/all-in-one:*'", "image: 'jaegertracing/all-in-one:" + JAEGER_VERSION.substring(0, 4) + "'"));
ResourceManager.STORED_RESOURCES.computeIfAbsent(extensionContext.getDisplayName(), k -> new Stack<>());
ResourceManager.STORED_RESOURCES.get(extensionContext.getDisplayName()).push(new ResourceItem(() -> cmdKubeClient(namespaceName).deleteContent(instanceYamlContent)));
DeploymentUtils.waitForDeploymentAndPodsReady(namespaceName, JAEGER_INSTANCE_NAME, 1);
}
use of io.strimzi.systemtest.resources.ResourceItem in project strimzi by strimzi.
the class TracingST method deployJaegerOperator.
private void deployJaegerOperator(ExtensionContext extensionContext) throws IOException, FileNotFoundException {
LOGGER.info("=== Applying jaeger operator install files ===");
deployJaegerContent(extensionContext);
ResourceManager.STORED_RESOURCES.computeIfAbsent(extensionContext.getDisplayName(), k -> new Stack<>());
ResourceManager.STORED_RESOURCES.get(extensionContext.getDisplayName()).push(new ResourceItem(() -> this.deleteJaeger()));
DeploymentUtils.waitForDeploymentAndPodsReady(namespace, JAEGER_OPERATOR_DEPLOYMENT_NAME, 1);
NetworkPolicy networkPolicy = new NetworkPolicyBuilder().withApiVersion("networking.k8s.io/v1").withKind(Constants.NETWORK_POLICY).withNewMetadata().withName("jaeger-allow").withNamespace(namespace).endMetadata().withNewSpec().addNewIngress().endIngress().withNewPodSelector().addToMatchLabels("app", "jaeger").endPodSelector().withPolicyTypes("Ingress").endSpec().build();
LOGGER.debug("Creating NetworkPolicy: {}", networkPolicy.toString());
resourceManager.createResource(extensionContext, networkPolicy);
LOGGER.info("Network policy for jaeger successfully created");
}
use of io.strimzi.systemtest.resources.ResourceItem in project strimzi-kafka-operator by strimzi.
the class TracingST method deployJaegerInstance.
/**
* Install of Jaeger instance
*/
void deployJaegerInstance(ExtensionContext extensionContext, String namespaceName) {
LOGGER.info("=== Applying jaeger instance install file ===");
String instanceYamlContent = TestUtils.getContent(new File(jaegerInstancePath), TestUtils::toYamlString);
cmdKubeClient(namespaceName).applyContent(instanceYamlContent.replaceAll("image: 'jaegertracing/all-in-one:*'", "image: 'jaegertracing/all-in-one:" + JAEGER_VERSION.substring(0, 4) + "'"));
ResourceManager.STORED_RESOURCES.computeIfAbsent(extensionContext.getDisplayName(), k -> new Stack<>());
ResourceManager.STORED_RESOURCES.get(extensionContext.getDisplayName()).push(new ResourceItem(() -> cmdKubeClient(namespaceName).deleteContent(instanceYamlContent)));
DeploymentUtils.waitForDeploymentAndPodsReady(namespaceName, JAEGER_INSTANCE_NAME, 1);
}
use of io.strimzi.systemtest.resources.ResourceItem in project strimzi-kafka-operator by strimzi.
the class TracingST method deployJaegerOperator.
private void deployJaegerOperator(ExtensionContext extensionContext) throws IOException, FileNotFoundException {
LOGGER.info("=== Applying jaeger operator install files ===");
deployJaegerContent(extensionContext);
ResourceManager.STORED_RESOURCES.computeIfAbsent(extensionContext.getDisplayName(), k -> new Stack<>());
ResourceManager.STORED_RESOURCES.get(extensionContext.getDisplayName()).push(new ResourceItem(() -> this.deleteJaeger()));
DeploymentUtils.waitForDeploymentAndPodsReady(namespace, JAEGER_OPERATOR_DEPLOYMENT_NAME, 1);
NetworkPolicy networkPolicy = new NetworkPolicyBuilder().withApiVersion("networking.k8s.io/v1").withKind(Constants.NETWORK_POLICY).withNewMetadata().withName("jaeger-allow").withNamespace(namespace).endMetadata().withNewSpec().addNewIngress().endIngress().withNewPodSelector().addToMatchLabels("app", "jaeger").endPodSelector().withPolicyTypes("Ingress").endSpec().build();
LOGGER.debug("Creating NetworkPolicy: {}", networkPolicy.toString());
resourceManager.createResource(extensionContext, networkPolicy);
LOGGER.info("Network policy for jaeger successfully created");
}
use of io.strimzi.systemtest.resources.ResourceItem in project strimzi by strimzi.
the class HelmResource method create.
public void create(ExtensionContext extensionContext, long operationTimeout, long reconciliationInterval) {
ResourceManager.STORED_RESOURCES.computeIfAbsent(extensionContext.getDisplayName(), k -> new Stack<>());
ResourceManager.STORED_RESOURCES.get(extensionContext.getDisplayName()).push(new ResourceItem(this::delete));
this.clusterOperator(operationTimeout, reconciliationInterval);
}
Aggregations