From 6151d9abbbb0f8cf12de484832260f5c97079f49 Mon Sep 17 00:00:00 2001 From: "Carlos E. Feria Vila" Date: Thu, 22 Dec 2022 08:50:39 +0100 Subject: [PATCH] Complete operator functionality (#235) * Make the operator work Signed-off-by: carlosthe19916 <2582866+carlosthe19916@users.noreply.github.com> * Upgrade xbuilder version Signed-off-by: carlosthe19916 <2582866+carlosthe19916@users.noreply.github.com> * Upgrade xbuilder version Signed-off-by: carlosthe19916 <2582866+carlosthe19916@users.noreply.github.com> Signed-off-by: carlosthe19916 <2582866+carlosthe19916@users.noreply.github.com> --- application/pom.xml | 2 +- .../files/health/impl/S3ReadinessCheck.java | 25 +++-- .../openubl/ublhub/models/TsidUtil.java | 2 +- .../ublhub/scheduler/SchedulerManager.java | 2 +- .../security/DisabledAuthController.java | 2 +- .../impl/GeneratedIDGenerator.java | 2 +- .../src/main/resources/application.properties | 14 +-- .../project/openubl/operator/Constants.java | 13 ++- .../cdrs/v2alpha1/UblhubFileStoragePVC.java | 78 ++++++++++++++ .../operator/cdrs/v2alpha1/UblhubSpec.java | 90 ++++++++++++++-- .../controllers/UblhubDistConfigurator.java | 102 ++++++++++++------ .../controllers/UblhubReconciler.java | 2 + operator/src/main/resources/ublhub.yml | 4 + 13 files changed, 277 insertions(+), 61 deletions(-) create mode 100644 operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubFileStoragePVC.java diff --git a/application/pom.xml b/application/pom.xml index b7fc478a..9fac0434 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -58,7 +58,7 @@ io.github.project-openubl quarkus-xbuilder - 2.0.0.Beta2 + 2.0.0-Beta4 io.github.project-openubl diff --git a/application/src/main/java/io/github/project/openubl/ublhub/files/health/impl/S3ReadinessCheck.java b/application/src/main/java/io/github/project/openubl/ublhub/files/health/impl/S3ReadinessCheck.java index 27434f9a..f88f8cb1 100644 --- a/application/src/main/java/io/github/project/openubl/ublhub/files/health/impl/S3ReadinessCheck.java +++ b/application/src/main/java/io/github/project/openubl/ublhub/files/health/impl/S3ReadinessCheck.java @@ -27,27 +27,32 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.Optional; @ApplicationScoped @StorageProvider(StorageProvider.Type.S3) public class S3ReadinessCheck implements StorageReadinessCheck { @ConfigProperty(name = "openubl.storage.s3.health.url") - String s3HostHealthCheckUrl; + Optional s3HostHealthCheckUrl; private final HttpClient client = HttpClient.newHttpClient(); @Override public boolean isHealthy() { - try { - HttpRequest request = HttpRequest.newBuilder() - .uri(new URI(s3HostHealthCheckUrl)) - .GET() - .build(); - HttpResponse response = client.send(request, HttpResponse.BodyHandlers.discarding()); - return response.statusCode() == 200; - } catch (URISyntaxException | IOException | InterruptedException e) { - return false; + if (s3HostHealthCheckUrl.isPresent()) { + try { + HttpRequest request = HttpRequest.newBuilder() + .uri(new URI(s3HostHealthCheckUrl.get())) + .GET() + .build(); + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.discarding()); + return response.statusCode() == 200; + } catch (URISyntaxException | IOException | InterruptedException e) { + return false; + } + } else { + return true; } } } diff --git a/application/src/main/java/io/github/project/openubl/ublhub/models/TsidUtil.java b/application/src/main/java/io/github/project/openubl/ublhub/models/TsidUtil.java index 0129a662..12e457f6 100644 --- a/application/src/main/java/io/github/project/openubl/ublhub/models/TsidUtil.java +++ b/application/src/main/java/io/github/project/openubl/ublhub/models/TsidUtil.java @@ -25,7 +25,7 @@ public class TsidUtil { - @ConfigProperty(name = "ublhub.tsid.bytes") + @ConfigProperty(name = "openubl.ublhub.tsid.bytes") int tsidBytes; @Produces diff --git a/application/src/main/java/io/github/project/openubl/ublhub/scheduler/SchedulerManager.java b/application/src/main/java/io/github/project/openubl/ublhub/scheduler/SchedulerManager.java index 1ec6066b..464b4335 100644 --- a/application/src/main/java/io/github/project/openubl/ublhub/scheduler/SchedulerManager.java +++ b/application/src/main/java/io/github/project/openubl/ublhub/scheduler/SchedulerManager.java @@ -30,7 +30,7 @@ @ApplicationScoped public class SchedulerManager { - @ConfigProperty(name = "openubl.scheduler.type") + @ConfigProperty(name = "openubl.ublhub.scheduler.type") String schedulerType; @Inject diff --git a/application/src/main/java/io/github/project/openubl/ublhub/security/DisabledAuthController.java b/application/src/main/java/io/github/project/openubl/ublhub/security/DisabledAuthController.java index daf1ab96..a22d085a 100644 --- a/application/src/main/java/io/github/project/openubl/ublhub/security/DisabledAuthController.java +++ b/application/src/main/java/io/github/project/openubl/ublhub/security/DisabledAuthController.java @@ -29,7 +29,7 @@ @ApplicationScoped public class DisabledAuthController extends AuthorizationController { - @ConfigProperty(name = "ublhub.disable.authorization") + @ConfigProperty(name = "openubl.ublhub.disable.authorization") boolean disableAuthorization; @Override diff --git a/application/src/main/java/io/github/project/openubl/ublhub/ubl/builder/idgenerator/impl/GeneratedIDGenerator.java b/application/src/main/java/io/github/project/openubl/ublhub/ubl/builder/idgenerator/impl/GeneratedIDGenerator.java index 18b59d48..519bb5f3 100644 --- a/application/src/main/java/io/github/project/openubl/ublhub/ubl/builder/idgenerator/impl/GeneratedIDGenerator.java +++ b/application/src/main/java/io/github/project/openubl/ublhub/ubl/builder/idgenerator/impl/GeneratedIDGenerator.java @@ -42,7 +42,7 @@ public class GeneratedIDGenerator implements IDGenerator { public static final String SERIE_PROPERTY = "serie"; public static final String NUMERO_PROPERTY = "numero"; - @ConfigProperty(name = "openubl.xbuilder.timezone") + @ConfigProperty(name = "openubl.ublhub.timezone") String timezone; @Inject diff --git a/application/src/main/resources/application.properties b/application/src/main/resources/application.properties index e722961d..22174f6f 100644 --- a/application/src/main/resources/application.properties +++ b/application/src/main/resources/application.properties @@ -1,6 +1,9 @@ # Resources quarkus.native.resources.includes=schemas/*.json +# For Key generation +quarkus.security.security-providers=BC + # Resteasy quarkus.resteasy-reactive.path=/api @@ -141,20 +144,19 @@ quarkus.smallrye-openapi.info-license-url=https://www.apache.org/licenses/LICENS quarkus.smallrye-openapi.store-schema-directory=src/jreleaser/templates/article # XBuilder -openubl.scheduler.type=vertx -openubl.xbuilder.timezone=America/Lima - quarkus.xbuilder.moneda=PEN quarkus.xbuilder.unidad-medida=NIU quarkus.xbuilder.igv-tasa=0.18 -quarkus.xbuilder.icb-tasa=0.2 +quarkus.xbuilder.icb-tasa=0.3 # XSender quarkus.xsender.enable-logging-feature=false # Ublhub -ublhub.disable.authorization=true -ublhub.tsid.bytes=256 +openubl.ublhub.timezone=America/Lima +openubl.ublhub.scheduler.type=vertx +openubl.ublhub.disable.authorization=true +openubl.ublhub.tsid.bytes=256 # Profiles %basic.ublhub.disable.authorization=false diff --git a/operator/src/main/java/io/github/project/openubl/operator/Constants.java b/operator/src/main/java/io/github/project/openubl/operator/Constants.java index b0baec58..77d532a6 100644 --- a/operator/src/main/java/io/github/project/openubl/operator/Constants.java +++ b/operator/src/main/java/io/github/project/openubl/operator/Constants.java @@ -16,6 +16,8 @@ */ package io.github.project.openubl.operator; +import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubSpec; + import java.util.Map; public class Constants { @@ -44,6 +46,7 @@ public class Constants { public static final String INGRESS_SUFFIX = "-" + UBLHUB_NAME + "-ingress"; public static final String SECRET_SUFFIX = "-" + UBLHUB_NAME + "-secret"; public static final String DEPLOYMENT_SUFFIX = "-" + UBLHUB_NAME + "-deployment"; + public static final String PVC_SUFFIX = "-" + UBLHUB_NAME + "-pvc"; public static final String BASIC_AUTH_SECRET_SUFFIX = "-basic-auth"; @@ -56,6 +59,14 @@ public class Constants { public static final String CERTIFICATES_FOLDER = "/mnt/certificates"; - public static final String WORKSPACES_FOLDER = "/mnt/workspace"; + public static final String STORAGE_FOLDER = "/mnt/ublhub-storage"; + public static final UblhubSpec.XBuilderSpec defaultXBuilderConfig = UblhubSpec.XBuilderSpec.builder() + .moneda("PEN") + .igvTasa("0.18") + .icbTasa("0.4") + .build(); + public static final UblhubSpec.XSenderSpec defaultXSenderConfig = UblhubSpec.XSenderSpec.builder() + .enableLoggingFeature(false) + .build(); } diff --git a/operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubFileStoragePVC.java b/operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubFileStoragePVC.java new file mode 100644 index 00000000..f03bca6e --- /dev/null +++ b/operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubFileStoragePVC.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.github.project.openubl.operator.cdrs.v2alpha1; + +import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; +import io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder; +import io.fabric8.kubernetes.api.model.PersistentVolumeClaimSpec; +import io.fabric8.kubernetes.api.model.PersistentVolumeClaimSpecBuilder; +import io.fabric8.kubernetes.api.model.Quantity; +import io.fabric8.kubernetes.api.model.ResourceRequirementsBuilder; +import io.github.project.openubl.operator.Constants; +import io.github.project.openubl.operator.utils.CRDUtils; +import io.javaoperatorsdk.operator.api.reconciler.Context; +import io.javaoperatorsdk.operator.processing.dependent.kubernetes.CRUDKubernetesDependentResource; + +import java.util.Map; + +public class UblhubFileStoragePVC extends CRUDKubernetesDependentResource { + + public UblhubFileStoragePVC() { + super(PersistentVolumeClaim.class); + } + + @Override + public PersistentVolumeClaim desired(Ublhub cr, Context context) { + return newPersistentVolumeClaim(cr, context); + } + + @SuppressWarnings("unchecked") + private PersistentVolumeClaim newPersistentVolumeClaim(Ublhub cr, Context context) { + final var labels = (Map) context.managedDependentResourceContext() + .getMandatory(Constants.CONTEXT_LABELS_KEY, Map.class); + + PersistentVolumeClaim pvc = new PersistentVolumeClaimBuilder() + .withNewMetadata() + .withName(getPersistentVolumeClaimName(cr)) + .withNamespace(cr.getMetadata().getNamespace()) + .withLabels(labels) + .endMetadata() + .withSpec(getPersistentVolumeClaimSpec(cr)) + .build(); + return pvc; + } + + private PersistentVolumeClaimSpec getPersistentVolumeClaimSpec(Ublhub cr) { + return new PersistentVolumeClaimSpecBuilder() + .withAccessModes("ReadWriteOnce") + .withResources(new ResourceRequirementsBuilder() + .addToRequests("storage", new Quantity(cr.getSpec().getStorageSpec().getFilesystemSpec().getSize())) + .build() + ) + .build(); + } + + public static String getPersistentVolumeClaimName(Ublhub cr) { + return cr.getMetadata().getName() + "-filesystem" + Constants.PVC_SUFFIX; + } + + public static boolean isTlsConfigured(Ublhub cr) { + var tlsSecret = CRDUtils.getValueFromSubSpec(cr.getSpec().getHttpSpec(), UblhubSpec.HttpSpec::getTlsSecret); + return tlsSecret.isPresent() && !tlsSecret.get().trim().isEmpty(); + } + +} diff --git a/operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubSpec.java b/operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubSpec.java index 7b8e8148..43a74883 100644 --- a/operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubSpec.java +++ b/operator/src/main/java/io/github/project/openubl/operator/cdrs/v2alpha1/UblhubSpec.java @@ -72,9 +72,17 @@ public class UblhubSpec { @JsonPropertyDescription("In this section you can configure Oidc settings.") private OidcSpec oidcSpec; - @JsonProperty("sunat") - @JsonPropertyDescription("In this section you can configure SUNAT settings.") - private SunatSpec sunatSpec; + @JsonProperty("storage") + @JsonPropertyDescription("In this section you can configure the Storage.") + private StorageSpec storageSpec; + + @JsonProperty("xbuilder") + @JsonPropertyDescription("XBuilder settings.") + private XBuilderSpec xBuilderSpec; + + @JsonProperty("xsender") + @JsonPropertyDescription("XSender settings.") + private XSenderSpec xSenderSpec; @Data @Builder @@ -152,12 +160,78 @@ public static class OidcSpec { @Builder @AllArgsConstructor @NoArgsConstructor - public static class SunatSpec { - @JsonPropertyDescription("Padron Reducido Url.") - private String padronReducidoUrl; + public static class StorageSpec { + public enum Type { + filesystem, + s3 + } + + @JsonPropertyDescription("Typo of chosen storage.") + private Type type; + + @JsonProperty("filesystem") + @JsonPropertyDescription("Filesystem settings.") + private StorageFilesystemSpec filesystemSpec; + + @JsonProperty("s3") + @JsonPropertyDescription("Filesystem settings.") + private StorageS3Spec s3Spec; + } - @JsonPropertyDescription("Cron for downloading the Padron Reducido.") - private String padronReducidoCron; + @Data + @Builder + @AllArgsConstructor + @NoArgsConstructor + public static class StorageFilesystemSpec { + @JsonPropertyDescription("Size of the PVC to create.") + private String size; } + @Data + @Builder + @AllArgsConstructor + @NoArgsConstructor + public static class StorageS3Spec { + @JsonPropertyDescription("Only if you are using Minio, otherwise leave it empty") + private String host; + + @JsonPropertyDescription("Only if you are using Minio, otherwise leave it empty") + private String healthUrl; + + @JsonPropertyDescription("Region") + private String region; + + @JsonPropertyDescription("Bucket") + private String bucket; + + @JsonPropertyDescription("Access key id") + private String accessKeyId; + + @JsonPropertyDescription("Secret access key") + private String secretAccessKey; + } + + @Data + @Builder + @AllArgsConstructor + @NoArgsConstructor + public static class XBuilderSpec { + @JsonPropertyDescription("Default currency") + private String moneda = "PEN"; + + @JsonPropertyDescription("Default IGV") + private String igvTasa; + + @JsonPropertyDescription("Default ICB") + private String icbTasa; + } + + @Data + @Builder + @AllArgsConstructor + @NoArgsConstructor + public static class XSenderSpec { + @JsonPropertyDescription("Enable logging feature") + private Boolean enableLoggingFeature = false; + } } diff --git a/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubDistConfigurator.java b/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubDistConfigurator.java index 309ad835..2341414b 100644 --- a/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubDistConfigurator.java +++ b/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubDistConfigurator.java @@ -19,6 +19,7 @@ import io.fabric8.kubernetes.api.model.EnvVar; import io.fabric8.kubernetes.api.model.EnvVarBuilder; import io.fabric8.kubernetes.api.model.EnvVarSourceBuilder; +import io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSourceBuilder; import io.fabric8.kubernetes.api.model.SecretKeySelector; import io.fabric8.kubernetes.api.model.Volume; import io.fabric8.kubernetes.api.model.VolumeBuilder; @@ -26,6 +27,7 @@ import io.fabric8.kubernetes.api.model.VolumeMountBuilder; import io.github.project.openubl.operator.Constants; import io.github.project.openubl.operator.cdrs.v2alpha1.Ublhub; +import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubFileStoragePVC; import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubSecretBasicAuth; import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubService; import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubSpec; @@ -62,8 +64,9 @@ public UblhubDistConfigurator(Ublhub cr) { configureDatabase(); configureBasicAuth(); configureOidc(); -// configureSunat(); -// configureWorkspace(); + configureXBuilder(); + configureXSender(); + configureStorage(); allEnvVars.add(new EnvVarBuilder() .withName("QUARKUS_PROFILE") @@ -173,35 +176,72 @@ private void configureOidc() { allProfiles.add(Constants.PROFILE_OIDC); } -// private void configureSunat() { -// List envVars = optionMapper(cr.getSpec().getSunatSpec()) -// .mapOption("UBLHUB_SUNAT_PADRONREDUCIDOURL", UblhubSpec.SunatSpec::getPadronReducidoUrl) -// .mapOption("UBLHUB_SCHEDULED_CRON", UblhubSpec.SunatSpec::getPadronReducidoCron) -// .getEnvVars(); -// -// allEnvVars.addAll(envVars); -// } - -// private void configureWorkspace() { -// var volume = new VolumeBuilder() -// .withName("ublhub-workspace") -// .withNewEmptyDir() -// .endEmptyDir() -// .build(); -// -// var volumeMount = new VolumeMountBuilder() -// .withName(volume.getName()) -// .withMountPath(Constants.WORKSPACES_FOLDER) -// .build(); -// -// allEnvVars.add(new EnvVarBuilder() -// .withName("UBLHUB_WORKSPACE_DIRECTORY") -// .withValue(Constants.WORKSPACES_FOLDER) -// .build() -// ); -// allVolumes.add(volume); -// allVolumeMounts.add(volumeMount); -// } + private void configureXBuilder() { + UblhubSpec.XBuilderSpec xBuilderSpec = cr.getSpec().getXBuilderSpec() != null ? + cr.getSpec().getXBuilderSpec() : Constants.defaultXBuilderConfig; + + List envVars = optionMapper(xBuilderSpec) + .mapOption("QUARKUS_XBUILDER_MONEDA", UblhubSpec.XBuilderSpec::getMoneda) + .mapOption("QUARKUS_XBUILDER_UNIDAD_MEDIDA", "NIU") + .mapOption("QUARKUS_XBUILDER_IGV_TASA", UblhubSpec.XBuilderSpec::getIgvTasa) + .mapOption("QUARKUS_XBUILDER_ICB_TASA", UblhubSpec.XBuilderSpec::getIcbTasa) + .getEnvVars(); + + allEnvVars.addAll(envVars); + } + + private void configureXSender() { + UblhubSpec.XSenderSpec xSenderSpec = cr.getSpec().getXSenderSpec() != null ? + cr.getSpec().getXSenderSpec() : Constants.defaultXSenderConfig; + + List envVars = optionMapper(xSenderSpec) + .mapOption("QUARKUS_XSENDER_ENABLE_LOGGING_FEATURE", UblhubSpec.XSenderSpec::getEnableLoggingFeature) + .getEnvVars(); + + allEnvVars.addAll(envVars); + } + + private void configureStorage() { + UblhubSpec.StorageSpec storageSpec = cr.getSpec().getStorageSpec(); + switch (storageSpec.getType()) { + case filesystem -> { + var volume = new VolumeBuilder() + .withName("ublhub-storage") + .withPersistentVolumeClaim(new PersistentVolumeClaimVolumeSourceBuilder() + .withClaimName(UblhubFileStoragePVC.getPersistentVolumeClaimName(cr)) + .build() + ) + .build(); + + var volumeMount = new VolumeMountBuilder() + .withName(volume.getName()) + .withMountPath(Constants.STORAGE_FOLDER) + .build(); + + List filesystemEnvVars = optionMapper(cr.getSpec().getStorageSpec()) + .mapOption("OPENUBL_STORAGE_TYPE", UblhubSpec.StorageSpec.Type.filesystem) + .mapOption("OPENUBL_STORAGE_FILESYSTEM_FOLDER", Constants.STORAGE_FOLDER) + .getEnvVars(); + + allVolumes.add(volume); + allVolumeMounts.add(volumeMount); + + allEnvVars.addAll(filesystemEnvVars); + } + case s3 -> { + List envVars = optionMapper(cr.getSpec().getStorageSpec()) + .mapOption("OPENUBL_STORAGE_S3_HEALTH_URL", spec -> spec.getS3Spec().getHealthUrl()) + .mapOption("OPENUBL_STORAGE_S3_HOST", spec -> spec.getS3Spec().getHost()) + .mapOption("OPENUBL_STORAGE_S3_REGION", spec -> spec.getS3Spec().getRegion()) + .mapOption("OPENUBL_STORAGE_S3_BUCKET", spec -> spec.getS3Spec().getBucket()) + .mapOption("OPENUBL_STORAGE_S3_ACCESS_KEY_ID", spec -> spec.getS3Spec().getAccessKeyId()) + .mapOption("OPENUBL_STORAGE_S3_SECRET_ACCESS_KEY", spec -> spec.getS3Spec().getSecretAccessKey()) + .getEnvVars(); + + allEnvVars.addAll(envVars); + } + } + } private OptionMapper optionMapper(T optionSpec) { return new OptionMapper<>(optionSpec); diff --git a/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubReconciler.java b/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubReconciler.java index a725e51f..a345c2b3 100644 --- a/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubReconciler.java +++ b/operator/src/main/java/io/github/project/openubl/operator/controllers/UblhubReconciler.java @@ -22,6 +22,7 @@ import io.github.project.openubl.operator.Constants; import io.github.project.openubl.operator.cdrs.v2alpha1.Ublhub; import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubDeployment; +import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubFileStoragePVC; import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubIngress; import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubSecretBasicAuth; import io.github.project.openubl.operator.cdrs.v2alpha1.UblhubService; @@ -40,6 +41,7 @@ import static io.javaoperatorsdk.operator.api.reconciler.Constants.WATCH_CURRENT_NAMESPACE; @ControllerConfiguration(namespaces = WATCH_CURRENT_NAMESPACE, name = "ublhub", dependents = { + @Dependent(name = "pvc", type = UblhubFileStoragePVC.class), @Dependent(name = "secret", type = UblhubSecretBasicAuth.class), @Dependent(name = "deployment", type = UblhubDeployment.class), @Dependent(name = "service", type = UblhubService.class), diff --git a/operator/src/main/resources/ublhub.yml b/operator/src/main/resources/ublhub.yml index 0177a669..afea0731 100644 --- a/operator/src/main/resources/ublhub.yml +++ b/operator/src/main/resources/ublhub.yml @@ -11,3 +11,7 @@ spec: name: postgresql-pguser-foo key: password url: jdbc:postgresql://postgresql-primary.default.svc:5432/ublhubdb + storage: + type: "filesystem" + filesystem: + size: "1Gi"