Skip to content

Commit 5d09c35

Browse files
authored
[System Tests] fixed scale system tests (kroxylicious#2320)
* fixed scale system tests Signed-off-by: Francisco Vila <fvila@redhat.com> * remove unused constant Signed-off-by: Francisco Vila <fvila@redhat.com> --------- Signed-off-by: Francisco Vila <fvila@redhat.com>
1 parent 75bb25a commit 5d09c35

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/Constants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ private Constants() {
2121
*/
2222
public static final String KROXYLICIOUS_OPERATOR_DEPLOYMENT_NAME = "kroxylicious-operator";
2323
public static final String KROXYLICIOUS_OPERATOR_NAMESPACE = "kroxylicious-operator";
24-
public static final String KROXYLICIOUS_DEPLOYMENT_NAME = "kroxylicious-proxy";
2524
public static final String KROXYLICIOUS_PROXY_SIMPLE_NAME = "simple";
2625
public static final String KROXYLICIOUS_INGRESS_CLUSTER_IP = "cluster-ip";
2726
public static final String KROXYLICIOUS_ENCRYPTION_FILTER_NAME = "encryption";

kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/installation/kroxylicious/Kroxylicious.java

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ public void deployPortIdentifiesNodeWithTlsAndNoFilters(String clusterName) {
103103
clusterName, Constants.KROXYLICIOUS_INGRESS_CLUSTER_IP));
104104
}
105105

106+
/**
107+
* Deploy port identifies node with downstream tls and no filters.
108+
*
109+
* @param clusterName the cluster name
110+
* @param tls the tls
111+
*/
106112
public void deployPortIdentifiesNodeWithDownstreamTlsAndNoFilters(String clusterName, Tls tls) {
107113
resourceManager.createResourceFromBuilder(
108114
KroxyliciousKafkaProxyTemplates.defaultKafkaProxyCR(deploymentNamespace, Constants.KROXYLICIOUS_PROXY_SIMPLE_NAME, 1),
@@ -114,6 +120,12 @@ public void deployPortIdentifiesNodeWithDownstreamTlsAndNoFilters(String cluster
114120
clusterName, Constants.KROXYLICIOUS_INGRESS_CLUSTER_IP, tls));
115121
}
116122

123+
/**
124+
* Create certificate config map from listener.
125+
*
126+
* @param namespace the namespace
127+
* @return the tls
128+
*/
117129
public Tls createCertificateConfigMapFromListener(String namespace) {
118130
// wait for listeners to contain data
119131
var tlsListenerStatus = KafkaUtils.getKafkaListenerStatus("tls");
@@ -145,6 +157,12 @@ private static TrustAnchorRef buildTrustAnchorRef() {
145157
// formatter:on
146158
}
147159

160+
/**
161+
* Tls config from cert.
162+
*
163+
* @param certNane the cert nane
164+
* @return the tls
165+
*/
148166
public Tls tlsConfigFromCert(String certNane) {
149167
TlsBuilder tlsBuilder = new TlsBuilder();
150168
if (certNane != null) {
@@ -218,7 +236,7 @@ public String getBootstrap(String clusterName) {
218236
*/
219237
public int getNumberOfReplicas() {
220238
LOGGER.info("Getting number of replicas..");
221-
return kubeClient().getDeployment(deploymentNamespace, Constants.KROXYLICIOUS_DEPLOYMENT_NAME).getStatus().getReplicas();
239+
return kubeClient().getDeployment(deploymentNamespace, Constants.KROXYLICIOUS_PROXY_SIMPLE_NAME).getStatus().getReplicas();
222240
}
223241

224242
/**
@@ -229,11 +247,17 @@ public int getNumberOfReplicas() {
229247
*/
230248
public void scaleReplicasTo(int scaledTo, Duration timeout) {
231249
LOGGER.info("Scaling number of replicas to {}..", scaledTo);
232-
kubeClient().getClient().resources(KafkaProxy.class).inNamespace(deploymentNamespace).withName(Constants.KROXYLICIOUS_DEPLOYMENT_NAME).scale(scaledTo);
250+
kubeClient().getClient().resources(KafkaProxy.class).inNamespace(deploymentNamespace).withName(Constants.KROXYLICIOUS_PROXY_SIMPLE_NAME).scale(scaledTo);
233251
await().atMost(timeout).pollInterval(Duration.ofSeconds(1))
234-
.until(() -> getNumberOfReplicas() == scaledTo && kubeClient().isDeploymentReady(deploymentNamespace, Constants.KROXYLICIOUS_DEPLOYMENT_NAME));
252+
.until(() -> getNumberOfReplicas() == scaledTo && kubeClient().isDeploymentReady(deploymentNamespace, Constants.KROXYLICIOUS_PROXY_SIMPLE_NAME));
235253
}
236254

255+
/**
256+
* Deploy port identifies node with no filters.
257+
*
258+
* @param clusterName the cluster name
259+
* @param proxyPods the proxy pods
260+
*/
237261
public void deployPortIdentifiesNodeWithNoFilters(String clusterName, int proxyPods) {
238262
resourceManager.createResourceFromBuilder(
239263
KroxyliciousKafkaProxyTemplates.defaultKafkaProxyCR(deploymentNamespace, Constants.KROXYLICIOUS_PROXY_SIMPLE_NAME, proxyPods),

kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/templates/kroxylicious/KroxyliciousKafkaProxyTemplates.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private KroxyliciousKafkaProxyTemplates() {
1818
*
1919
* @param namespaceName the namespace name
2020
* @param name the name
21-
* @param replicas the number porxy pods to deploy
21+
* @param replicas the number proxy pods to deploy
2222
* @return the kafka proxy builder
2323
*/
2424
public static KafkaProxyBuilder defaultKafkaProxyCR(String namespaceName, String name, int replicas) {
@@ -29,7 +29,7 @@ public static KafkaProxyBuilder defaultKafkaProxyCR(String namespaceName, String
2929
.withNamespace(namespaceName)
3030
.endMetadata()
3131
.withNewSpec()
32-
.withReplicas(replicas)
32+
.withReplicas(replicas)
3333
.endSpec();
3434
// @formatter:on
3535
}

kroxylicious-systemtests/src/test/java/io/kroxylicious/systemtests/KroxyliciousST.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void setupBefore() {
248248
else {
249249
LOGGER.atInfo().setMessage("Deploying Kafka in {} namespace").addArgument(Constants.KAFKA_DEFAULT_NAMESPACE).log();
250250

251-
int numberOfBrokers = 1;
251+
int numberOfBrokers = 3;
252252
KafkaBuilder kafka = KafkaTemplates.kafkaPersistentWithKRaftAnnotations(Constants.KAFKA_DEFAULT_NAMESPACE, clusterName, numberOfBrokers);
253253

254254
resourceManager.createResourceFromBuilderWithWait(

0 commit comments

Comments
 (0)