Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka auth support #5955

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f0a6808
Add basic testing infrastructure for auth support
carlesarnal Jan 28, 2025
5733cbf
Add initial support for authentication
carlesarnal Jan 29, 2025
5792da3
Modify install file for authentication
carlesarnal Jan 29, 2025
73b45fc
Improve auth structure
carlesarnal Jan 29, 2025
9d3d332
Merge branch 'main' into add-keycloak-support
carlesarnal Jan 29, 2025
a8d5f62
Fix test resource
carlesarnal Jan 29, 2025
fafba79
Improve auth configuration and test example
carlesarnal Jan 30, 2025
88918f3
Make the backend use the keycloak service as the route for authentica…
carlesarnal Jan 30, 2025
893dcc8
Add tls verification configuration
carlesarnal Jan 30, 2025
cbf2ce5
Fix tls testing and make the regular test use tls-secured keycloak wi…
carlesarnal Jan 31, 2025
39b1e2d
Add remaning auth values and authz configuration
carlesarnal Jan 31, 2025
35264bb
Add tests for authorization
carlesarnal Jan 31, 2025
fb87679
Add kafka ouath
carlesarnal Feb 3, 2025
53c1cf5
Fix kafka oauth deployment
carlesarnal Feb 4, 2025
0cfadda
Merge branch 'main' into kafka-auth-support
carlesarnal Feb 17, 2025
3d16024
Fix configuration issue for strimzi oauth
carlesarnal Feb 17, 2025
4ddf765
Don't require both trustore and keystore for kafka tls
carlesarnal Feb 20, 2025
840b1e0
Fix kafka auth tls config
carlesarnal Feb 25, 2025
db9f18d
Implement tls support for the app
carlesarnal Feb 27, 2025
b027922
Fix auth tests
carlesarnal Feb 27, 2025
ab9b3a3
Merge branch 'tls-support' into kafka-auth-support
carlesarnal Mar 3, 2025
2f29977
Implement tls support for the app
carlesarnal Feb 27, 2025
523a34c
Use http for kafka oauth test
carlesarnal Mar 4, 2025
0cfa62a
Fix auth tests
carlesarnal Feb 27, 2025
4c9a494
Merge branch 'tls-support' into kafka-auth-support
carlesarnal Mar 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIID/jCCAuagAwIBAgIUTsdR5JCRLZx8gNn5/Hc4Lle9pB8wDQYJKoZIhvcNAQEL
BQAwdDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1TYW4gRnJh
bmNpc2NvMREwDwYDVQQKDAhLZXljbG9hazEtMCsGA1UEAwwkc2ltcGxlLWtleWNs
b2FrLmFwcHMuY2x1c3Rlci5leGFtcGxlMB4XDTI1MDEzMTA3MjI1MVoXDTI2MDEz
MTA3MjI1MVowdDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1T
YW4gRnJhbmNpc2NvMREwDwYDVQQKDAhLZXljbG9hazEtMCsGA1UEAwwkc2ltcGxl
LWtleWNsb2FrLmFwcHMuY2x1c3Rlci5leGFtcGxlMIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEAq1Kouy7RTmfigX8pfgItDoqAZtBxQmXl8yqLsfNIabcy
mFWDptAeZQErGMOjDozSPbfPacTBRr/CBtOhNpGxojMN7F9gH0aZDQfNmxD5lBJb
RIKD6pcvSeS5fkP+GKtp0wtfjTG27kA41+K0uYuVOAHDDweEOjQIiuUX40yZilkx
xk9Tatz0BgptUW6WLY1MYYfju0wHdfMf1oGbDBuX8lCGF+vHWpyEARjfYBrxKGYa
UW+9Isui2YnOXIDyCDZngP1ctmt+jc7JZCPZdAkPS2I8w/WLLmQetryvnSdd+Run
vIPhaEvaWV018tvOA24j8sRTm1T7NPjvFQoDJacb9QIDAQABo4GHMIGEMGMGA1Ud
EQRcMFqCJHNpbXBsZS1rZXljbG9hay5hcHBzLmNsdXN0ZXIuZXhhbXBsZYIIa2V5
Y2xvYWuCDGtleWNsb2FrLnN2Y4Iaa2V5Y2xvYWsuc3ZjLmNsdXN0ZXIubG9jYWww
HQYDVR0OBBYEFKnx5Hc6DfUqIaXc2fvq6FbVG6WPMA0GCSqGSIb3DQEBCwUAA4IB
AQAMEcYAgL7T1IQdG12pnvwDP1rcNeIGdPgZlVlmXvvM57MGHVP06D2SkbyAiQlQ
r6Ohze4oS+9VcrkqAqoo2H3/fPT/dFLywqrXW47bs/7aEtD7bGnfwCkgS2mhn4ZK
9vpWRrrKQ4ZAG8YG4rJFbsaMNAhMB/joUjjLh60RoQnDdWmyhAbl07ARzCQwuv8M
DvpzrMi/U8nBFlvUPReIpsejj9HAyyfRBv2dJwSZGLxFOb2flSIxSC8aaaJ8NQmD
TZeZInxtUvHwEnnH0u5pB3wE+u8NklGSu7Xo3ctK+9q4Cb51vGapwd6dhtjnmlmx
gg82StaL1n9k01Rhu9keXA3J
-----END CERTIFICATE-----
Empty file added key.pem
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public class Constants {
.withInitialDelaySeconds(15).withTimeoutSeconds(5).withPeriodSeconds(10).withSuccessThreshold(1)
.withFailureThreshold(3).build();

public static final Probe TLS_DEFAULT_READINESS_PROBE = new ProbeBuilder().withNewHttpGet()
.withScheme("HTTPS").withPath("/health/ready").withNewPort().withValue(8443).endPort().endHttpGet()
.withInitialDelaySeconds(15).withTimeoutSeconds(5).withPeriodSeconds(10).withSuccessThreshold(1)
.withFailureThreshold(3).build();

public static final Probe TLS_DEFAULT_LIVENESS_PROBE = new ProbeBuilder().withNewHttpGet()
.withScheme("HTTPS").withPath("/health/live").withNewPort().withValue(8443).endPort().endHttpGet()
.withInitialDelaySeconds(15).withTimeoutSeconds(5).withPeriodSeconds(10).withSuccessThreshold(1)
.withFailureThreshold(3).build();

public static final Map<String, String> BASIC_LABELS = Map.of(MANAGED_BY_LABEL, MANAGED_BY_VALUE,
LABEL_SELECTOR_KEY, LABEL_SELECTOR_VALUE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ public class EnvironmentVariables {
public static final String QUARKUS_HTTP_ACCESS_LOG_ENABLED = "QUARKUS_HTTP_ACCESS_LOG_ENABLED";
public static final String QUARKUS_HTTP_CORS_ORIGINS = "QUARKUS_HTTP_CORS_ORIGINS";

public static final String QUARKUS_HTTP_INSECURE_REQUESTS = "QUARKUS_HTTP_INSECURE_REQUESTS";
public static final String QUARKUS_TLS_KEY_STORE_P12_PATH = "QUARKUS_TLS_KEY_STORE_P12_PATH";
public static final String QUARKUS_TLS_KEY_STORE_P12_PASSWORD = "QUARKUS_TLS_KEY_STORE_P12_PASSWORD";
public static final String QUARKUS_TLS_TRUST_STORE_P12_PATH = "QUARKUS_TLS_TRUST_STORE_P12_PATH";
public static final String QUARKUS_TLS_TRUST_STORE_P12_PASSWORD = "QUARKUS_TLS_TRUST_STORE_P12_PASSWORD";
public static final String QUARKUS_OIDC_TLS_TLS_CONFIGURATION_NAME = "QUARKUS_OIDC_TLS_TLS_CONFIGURATION_NAME";

public static final String APICURIO_REST_DELETION_ARTIFACT_VERSION_ENABLED = "APICURIO_REST_DELETION_ARTIFACT-VERSION_ENABLED";
public static final String APICURIO_REST_DELETION_ARTIFACT_ENABLED = "APICURIO_REST_DELETION_ARTIFACT_ENABLED";
public static final String APICURIO_REST_DELETION_GROUP_ENABLED = "APICURIO_REST_DELETION_GROUP_ENABLED";

public static final String APICURIO_REST_MUTABILITY_ARTIFACT_VERSION_CONTENT_ENABLED = "APICURIO_REST_MUTABILITY_ARTIFACT-VERSION-CONTENT_ENABLED";

private static final String KAFKA_PREFIX = "APICURIO_KAFKA_COMMON_";
Expand All @@ -21,6 +27,14 @@ public class EnvironmentVariables {
public static final String KAFKASQL_SSL_TRUSTSTORE_LOCATION = KAFKA_PREFIX + "SSL_TRUSTSTORE_LOCATION";
public static final String KAFKASQL_SSL_TRUSTSTORE_PASSWORD = KAFKA_PREFIX + "SSL_TRUSTSTORE_PASSWORD";

// KafkaSQL oauth
public static final String APICURIO_KAFKASQL_SECURITY_SASL_ENABLED = "APICURIO_KAFKASQL_SECURITY_SASL_ENABLED";
public static final String APICURIO_KAFKASQL_SECURITY_SASL_MECHANISM = "APICURIO_KAFKASQL_SECURITY_SASL_MECHANISM";
public static final String APICURIO_KAFKASQL_SECURITY_SASL_CLIENT_ID = "APICURIO_KAFKASQL_SECURITY_SASL_CLIENT_ID";
public static final String APICURIO_KAFKASQL_SECURITY_SASL_CLIENT_SECRET = "APICURIO_KAFKASQL_SECURITY_SASL_CLIENT_SECRET";
public static final String APICURIO_KAFKASQL_SECURITY_SASL_TOKEN_ENDPOINT = "APICURIO_KAFKASQL_SECURITY_SASL_TOKEN_ENDPOINT";
public static final String APICURIO_KAFKASQL_SECURITY_SASL_LOGIN_CALLBACK_HANDLER_CLASS = "APICURIO_KAFKASQL_SECURITY_SASL_LOGIN_CALLBACK_HANDLER_CLASS";

// Auth related environment variables
public static final String APICURIO_REGISTRY_AUTH_ENABLED = "QUARKUS_OIDC_TENANT_ENABLED";
public static final String APICURIO_REGISTRY_APP_CLIENT_ID = "QUARKUS_OIDC_CLIENT_ID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.util.Map;

import static io.apicurio.registry.operator.EnvironmentVariables.KAFKASQL_SECURITY_PROTOCOL;
import static io.apicurio.registry.operator.api.v1.ContainerNames.REGISTRY_APP_CONTAINER_NAME;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.addEnvVar;
import static io.apicurio.registry.operator.utils.Utils.isBlank;
Expand All @@ -25,7 +26,7 @@ public class KafkaSql {
public static String ENV_KAFKASQL_BOOTSTRAP_SERVERS = "APICURIO_KAFKASQL_BOOTSTRAP_SERVERS";

public static void configureKafkaSQL(ApicurioRegistry3 primary, Deployment deployment,
Map<String, EnvVar> env) {
Map<String, EnvVar> env) {
ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getApp).map(AppSpec::getStorage)
.map(StorageSpec::getKafkasql).ifPresent(kafkasql -> {
if (!isBlank(kafkasql.getBootstrapServers())) {
Expand All @@ -34,10 +35,30 @@ public static void configureKafkaSQL(ApicurioRegistry3 primary, Deployment deplo
addEnvVar(env, new EnvVarBuilder().withName(ENV_KAFKASQL_BOOTSTRAP_SERVERS)
.withValue(kafkasql.getBootstrapServers()).build());

if (KafkaSqlTLS.configureKafkaSQLTLS(primary, deployment, REGISTRY_APP_CONTAINER_NAME,
env)) {
boolean sslConfigured = KafkaSqlTLS.configureKafkaSQLTLS(primary, deployment, REGISTRY_APP_CONTAINER_NAME,
env);

boolean oAuthConfigured = KafkaSqlAuth.configureKafkaSQLOauth(primary,
env);

if (sslConfigured) {
log.info("KafkaSQL storage with TLS security configured.");
}

if (oAuthConfigured) {
log.info("KafkaSQL storage with Oauth security configured.");
}

// Set the security protocol
if (sslConfigured) {
if (oAuthConfigured) {
addEnvVar(env, KAFKASQL_SECURITY_PROTOCOL, "SASL_SSL");
} else {
addEnvVar(env, KAFKASQL_SECURITY_PROTOCOL, "SSL");
}
} else if (oAuthConfigured) {
addEnvVar(env, KAFKASQL_SECURITY_PROTOCOL, "SASL_PLAINTEXT");
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package io.apicurio.registry.operator.feat;

import io.apicurio.registry.operator.api.v1.ApicurioRegistry3;
import io.apicurio.registry.operator.api.v1.ApicurioRegistry3Spec;
import io.apicurio.registry.operator.api.v1.spec.AppSpec;
import io.apicurio.registry.operator.api.v1.spec.KafkaSqlAuthSpec;
import io.apicurio.registry.operator.api.v1.spec.KafkaSqlSpec;
import io.apicurio.registry.operator.api.v1.spec.StorageSpec;
import io.apicurio.registry.operator.utils.SecretKeyRefTool;
import io.fabric8.kubernetes.api.model.EnvVar;

import java.util.Map;
import java.util.Optional;

import static io.apicurio.registry.operator.EnvironmentVariables.*;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.addEnvVar;
import static java.util.Optional.ofNullable;

public class KafkaSqlAuth {

/**
* KafkaSQL must be already configured.
*/
public static boolean configureKafkaSQLOauth(ApicurioRegistry3 primary, Map<String, EnvVar> env) {

// spotless:off
var clientSecret = new SecretKeyRefTool(getKafkaSqlAuthSpec(primary)
.map(KafkaSqlAuthSpec::getClientSecretRef)
.orElse(null), "clientSecret");

var clientId = new SecretKeyRefTool(getKafkaSqlAuthSpec(primary)
.map(KafkaSqlAuthSpec::getClientIdRef)
.orElse(null), "clientId");

if (clientSecret.isValid()) {
getKafkaSqlAuthSpec(primary)
.filter(KafkaSqlAuthSpec::getEnabled)
.ifPresent(kafkaSqlAuthSpec -> {
addEnvVar(env, APICURIO_KAFKASQL_SECURITY_SASL_ENABLED, kafkaSqlAuthSpec.getEnabled().toString());
addEnvVar(env, APICURIO_KAFKASQL_SECURITY_SASL_MECHANISM, kafkaSqlAuthSpec.getMechanism());

clientId.applySecretEnvVar(env, APICURIO_KAFKASQL_SECURITY_SASL_CLIENT_ID);
clientSecret.applySecretEnvVar(env, APICURIO_KAFKASQL_SECURITY_SASL_CLIENT_SECRET);

addEnvVar(env, APICURIO_KAFKASQL_SECURITY_SASL_TOKEN_ENDPOINT, kafkaSqlAuthSpec.getTokenEndpoint());
addEnvVar(env, APICURIO_KAFKASQL_SECURITY_SASL_LOGIN_CALLBACK_HANDLER_CLASS, kafkaSqlAuthSpec.getLoginHandlerClass());
});

return true;
}
return false;
}

private static Optional<KafkaSqlAuthSpec> getKafkaSqlAuthSpec(ApicurioRegistry3 primary) {
// spotless:off
return ofNullable(primary)
.map(ApicurioRegistry3::getSpec)
.map(ApicurioRegistry3Spec::getApp)
.map(AppSpec::getStorage)
.map(StorageSpec::getKafkasql)
.map(KafkaSqlSpec::getAuth);
// spotless:on
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,32 @@ public static boolean configureKafkaSQLTLS(ApicurioRegistry3 primary, Deployment
.map(KafkaSqlTLSSpec::getTruststorePasswordSecretRef)
.orElse(null), "ca.password");

if (truststore.isValid() && truststorePassword.isValid() && keystore.isValid()
&& keystorePassword.isValid()) {
boolean configured = false;

if (truststore.isValid() && truststorePassword.isValid()) {
// ===== Truststore

addEnvVar(env, KAFKASQL_SECURITY_PROTOCOL, "SSL");
addEnvVar(env, KAFKASQL_SSL_TRUSTSTORE_TYPE, "PKCS12");
truststore.applySecretVolume(deployment, containerName);
addEnvVar(env, KAFKASQL_SSL_TRUSTSTORE_LOCATION, truststore.getSecretVolumeKeyPath());
truststorePassword.applySecretEnvVar(env, KAFKASQL_SSL_TRUSTSTORE_PASSWORD);

configured = true;
}

if (keystore.isValid()
&& keystorePassword.isValid()) {
// ===== Keystore

addEnvVar(env, KAFKASQL_SSL_KEYSTORE_TYPE, "PKCS12");
keystore.applySecretVolume(deployment, containerName);
addEnvVar(env, KAFKASQL_SSL_KEYSTORE_LOCATION, keystore.getSecretVolumeKeyPath());
keystorePassword.applySecretEnvVar(env, KAFKASQL_SSL_KEYSTORE_PASSWORD);

// ===== Truststore

addEnvVar(env, KAFKASQL_SSL_TRUSTSTORE_TYPE, "PKCS12");
truststore.applySecretVolume(deployment, containerName);
addEnvVar(env, KAFKASQL_SSL_TRUSTSTORE_LOCATION, truststore.getSecretVolumeKeyPath());
truststorePassword.applySecretEnvVar(env, KAFKASQL_SSL_TRUSTSTORE_PASSWORD);

return true;
configured = true;
}
return false;

return configured;
}

private static Optional<KafkaSqlTLSSpec> getKafkaSqlTLSSpec(ApicurioRegistry3 primary) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package io.apicurio.registry.operator.feat;

import io.apicurio.registry.operator.api.v1.ApicurioRegistry3;
import io.apicurio.registry.operator.api.v1.ApicurioRegistry3Spec;
import io.apicurio.registry.operator.api.v1.spec.AppSpec;
import io.apicurio.registry.operator.api.v1.spec.TLSSpec;
import io.apicurio.registry.operator.utils.SecretKeyRefTool;
import io.fabric8.kubernetes.api.model.EnvVar;
import io.fabric8.kubernetes.api.model.apps.Deployment;

import java.util.Map;
import java.util.Optional;

import static io.apicurio.registry.operator.EnvironmentVariables.*;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.addEnvVar;
import static java.util.Optional.ofNullable;

public class TLS {

public static void configureTLS(ApicurioRegistry3 primary, Deployment deployment,
String containerName, Map<String, EnvVar> env) {

addEnvVar(env, QUARKUS_HTTP_INSECURE_REQUESTS, Optional.ofNullable(primary.getSpec())
.map(ApicurioRegistry3Spec::getApp)
.map(AppSpec::getTls)
.map(TLSSpec::getInsecureRequests)
.orElse("enabled"));

var keystore = new SecretKeyRefTool(getTlsSpec(primary)
.map(TLSSpec::getKeystoreSecretRef)
.orElse(null), "user.p12");

var keystorePassword = new SecretKeyRefTool(getTlsSpec(primary)
.map(TLSSpec::getKeystorePasswordSecretRef)
.orElse(null), "user.password");

var truststore = new SecretKeyRefTool(getTlsSpec(primary)
.map(TLSSpec::getTruststoreSecretRef)
.orElse(null), "ca.p12");

var truststorePassword = new SecretKeyRefTool(getTlsSpec(primary)
.map(TLSSpec::getTruststorePasswordSecretRef)
.orElse(null), "ca.password");

if (truststore.isValid() && truststorePassword.isValid()) {
// ===== Truststore
truststore.applySecretVolume(deployment, containerName);
addEnvVar(env, QUARKUS_TLS_TRUST_STORE_P12_PATH, truststore.getSecretVolumeKeyPath());
truststorePassword.applySecretEnvVar(env, QUARKUS_TLS_TRUST_STORE_P12_PASSWORD);
}

if (keystore.isValid()
&& keystorePassword.isValid()) {
// ===== Keystore
keystore.applySecretVolume(deployment, containerName);
addEnvVar(env, QUARKUS_TLS_KEY_STORE_P12_PATH, keystore.getSecretVolumeKeyPath());
keystorePassword.applySecretEnvVar(env, QUARKUS_TLS_KEY_STORE_P12_PASSWORD);
}
}

private static Optional<TLSSpec> getTlsSpec(ApicurioRegistry3 primary) {
return ofNullable(primary)
.map(ApicurioRegistry3::getSpec)
.map(ApicurioRegistry3Spec::getApp)
.map(AppSpec::getTls);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.apicurio.registry.operator.api.v1.ApicurioRegistry3Spec;
import io.apicurio.registry.operator.api.v1.spec.AppSpec;
import io.apicurio.registry.operator.api.v1.spec.StudioUiSpec;
import io.apicurio.registry.operator.api.v1.spec.TLSSpec;
import io.apicurio.registry.operator.api.v1.spec.UiSpec;
import io.apicurio.registry.operator.status.ValidationErrorConditionManager;
import io.apicurio.registry.operator.status.StatusManager;
Expand All @@ -23,7 +24,7 @@
import java.util.Map;
import java.util.Optional;

import static io.apicurio.registry.operator.Constants.DEFAULT_REPLICAS;
import static io.apicurio.registry.operator.Constants.*;
import static io.apicurio.registry.operator.api.v1.ContainerNames.*;
import static io.apicurio.registry.operator.resource.Labels.getSelectorLabels;
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.getContainerFromPodTemplateSpec;
Expand Down Expand Up @@ -56,6 +57,19 @@ public Deployment getDefaultAppDeployment(ApicurioRegistry3 primary) {
.map(AppSpec::getReplicas).orElse(DEFAULT_REPLICAS),
ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getApp)
.map(AppSpec::getPodTemplateSpec).orElse(null)); // TODO:

var readinessProbe = new ProbeBuilder().withHttpGet(new HTTPGetActionBuilder().withPath("/health/ready").withPort(new IntOrString(8080)).withScheme("HTTP").build()).build();
var livenessProbe = new ProbeBuilder().withHttpGet(new HTTPGetActionBuilder().withPath("/health/live").withPort(new IntOrString(8080)).withScheme("HTTP").build()).build();

Optional<TLSSpec> tlsSpec = ofNullable(primary.getSpec())
.map(ApicurioRegistry3Spec::getApp)
.map(AppSpec::getTls);

if (tlsSpec.isPresent()) {
readinessProbe = TLS_DEFAULT_READINESS_PROBE;
livenessProbe = TLS_DEFAULT_LIVENESS_PROBE;
}

// Replicas
mergeDeploymentPodTemplateSpec(
COMPONENT_APP_SPEC_FIELD_NAME,
Expand All @@ -64,11 +78,12 @@ public Deployment getDefaultAppDeployment(ApicurioRegistry3 primary) {
REGISTRY_APP_CONTAINER_NAME,
Configuration.getAppImage(),
List.of(new ContainerPortBuilder().withName("http").withProtocol("TCP").withContainerPort(8080).build()),
new ProbeBuilder().withHttpGet(new HTTPGetActionBuilder().withPath("/health/ready").withPort(new IntOrString(8080)).withScheme("HTTP").build()).build(),
new ProbeBuilder().withHttpGet(new HTTPGetActionBuilder().withPath("/health/live").withPort(new IntOrString(8080)).withScheme("HTTP").build()).build(),
readinessProbe,
livenessProbe,
Map.of("cpu", new Quantity("500m"), "memory", new Quantity("512Mi")),
Map.of("cpu", new Quantity("1"), "memory", new Quantity("1Gi"))
);

addDefaultLabels(r.getMetadata().getLabels(), primary, COMPONENT_APP);
addSelectorLabels(r.getSpec().getSelector().getMatchLabels(), primary, COMPONENT_APP);
addDefaultLabels(r.getSpec().getTemplate().getMetadata().getLabels(), primary, COMPONENT_APP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.apicurio.registry.operator.feat.Cors;
import io.apicurio.registry.operator.feat.KafkaSql;
import io.apicurio.registry.operator.feat.PostgresSql;
import io.apicurio.registry.operator.feat.TLS;
import io.apicurio.registry.operator.feat.security.Auth;
import io.apicurio.registry.operator.status.ReadyConditionManager;
import io.apicurio.registry.operator.status.StatusManager;
Expand Down Expand Up @@ -87,6 +88,9 @@ protected Deployment desired(ApicurioRegistry3 primary, Context<ApicurioRegistry
// Configure the CORS_ALLOWED_ORIGINS env var based on the ingress host
Cors.configureAllowedOrigins(primary, envVars);

// Configure the TLS env vars
TLS.configureTLS(primary, deployment, REGISTRY_APP_CONTAINER_NAME, envVars);

// Enable the "mutability" feature in Registry, but only if Studio is deployed. It is based on Service
// in case a custom Ingress is used.
var sOpt = context.getSecondaryResource(STUDIO_UI_SERVICE_KEY.getKlass(),
Expand Down
Loading
Loading