From e3183a19ee34f16fc27bd56f717e4e2bd5545647 Mon Sep 17 00:00:00 2001 From: git-hyagi <45576767+git-hyagi@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:00:29 -0300 Subject: [PATCH] Remove `emptyDir` support closes: #1345 --- CHANGES/1345.removal | 1 + config/samples/galaxy.azure.ci.yaml | 3 + config/samples/galaxy.s3.ci.yaml | 3 + ...project_v1beta1_pulp_cr.galaxy.ocp.ci.yaml | 6 ++ .../pulpproject_v1beta1_pulp_cr.ocp.ci.yaml | 6 ++ config/samples/simple-external-cache.yaml | 1 + controllers/deployment.go | 28 -------- controllers/repo_manager/controller_test.go | 68 +------------------ controllers/repo_manager/database.go | 12 ---- controllers/repo_manager/precheck.go | 40 ++++++++--- controllers/repo_manager/utils.go | 6 -- controllers/utils.go | 15 +--- docs/configuring/database.md | 4 +- docs/configuring/storage.md | 24 +------ .../admin/guides/configurations/database.md | 4 +- .../admin/guides/configurations/storage.md | 25 +------ 16 files changed, 62 insertions(+), 184 deletions(-) create mode 100644 CHANGES/1345.removal diff --git a/CHANGES/1345.removal b/CHANGES/1345.removal new file mode 100644 index 000000000..8c1fcdc9b --- /dev/null +++ b/CHANGES/1345.removal @@ -0,0 +1 @@ +Removed support for installations using `emptyDir`. diff --git a/config/samples/galaxy.azure.ci.yaml b/config/samples/galaxy.azure.ci.yaml index d476b5f51..2bb40f99e 100644 --- a/config/samples/galaxy.azure.ci.yaml +++ b/config/samples/galaxy.azure.ci.yaml @@ -56,3 +56,6 @@ spec: limits: cpu: 800m memory: 1Gi + + database: + postgres_storage_class: standard diff --git a/config/samples/galaxy.s3.ci.yaml b/config/samples/galaxy.s3.ci.yaml index fdc8bfe59..3e87c3ce1 100644 --- a/config/samples/galaxy.s3.ci.yaml +++ b/config/samples/galaxy.s3.ci.yaml @@ -57,3 +57,6 @@ spec: limits: cpu: 800m memory: 1Gi + + database: + postgres_storage_class: standard diff --git a/config/samples/pulpproject_v1beta1_pulp_cr.galaxy.ocp.ci.yaml b/config/samples/pulpproject_v1beta1_pulp_cr.galaxy.ocp.ci.yaml index 918efa2c9..f1674aba7 100644 --- a/config/samples/pulpproject_v1beta1_pulp_cr.galaxy.ocp.ci.yaml +++ b/config/samples/pulpproject_v1beta1_pulp_cr.galaxy.ocp.ci.yaml @@ -50,3 +50,9 @@ spec: limits: cpu: 800m memory: 1Gi + + file_storage_access_mode: "ReadWriteMany" + file_storage_size: "5Gi" + file_storage_storage_class: azurefile-csi + database: + postgres_storage_class: azurefile-csi diff --git a/config/samples/pulpproject_v1beta1_pulp_cr.ocp.ci.yaml b/config/samples/pulpproject_v1beta1_pulp_cr.ocp.ci.yaml index 34c4b1d3c..f344a30f9 100644 --- a/config/samples/pulpproject_v1beta1_pulp_cr.ocp.ci.yaml +++ b/config/samples/pulpproject_v1beta1_pulp_cr.ocp.ci.yaml @@ -43,3 +43,9 @@ spec: limits: cpu: 800m memory: 1Gi + + file_storage_access_mode: "ReadWriteMany" + file_storage_size: "5Gi" + file_storage_storage_class: azurefile-csi + database: + postgres_storage_class: azurefile-csi diff --git a/config/samples/simple-external-cache.yaml b/config/samples/simple-external-cache.yaml index fcfed46c6..ccae6fc8d 100644 --- a/config/samples/simple-external-cache.yaml +++ b/config/samples/simple-external-cache.yaml @@ -17,6 +17,7 @@ spec: file_storage_access_mode: "ReadWriteOnce" file_storage_size: "2Gi" + file_storage_storage_class: standard signing_secret: "signing-galaxy" signing_scripts: "signing-scripts" image_web: "quay.io/pulp/galaxy-web" diff --git a/controllers/deployment.go b/controllers/deployment.go index 1708502fd..a04f58833 100644 --- a/controllers/deployment.go +++ b/controllers/deployment.go @@ -496,24 +496,6 @@ func (d *CommonDeployment) setVolumes(resources any, pulpcoreType settings.Pulpc }, } volumes = append(volumes, fileStorage) - } else if storageType[0] == EmptyDirType { // if there is no SC nor PVC nor object storage defined we will mount an emptyDir - emptyDir := corev1.Volume{ - Name: "tmp-file-storage", - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - } - volumes = append(volumes, emptyDir) - // only api pods need the assets-file-storage - if pulpcoreType == settings.API { - assetVolume := corev1.Volume{ - Name: "assets-file-storage", - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - } - volumes = append(volumes, assetVolume) - } } volumes = signingMetadataVolumes(resources, storageType, volumes) @@ -663,13 +645,6 @@ func (d *CommonDeployment) setVolumeMounts(pulp repomanagerpulpprojectorgv1beta2 MountPath: "/var/lib/pulp", } volumeMounts = append(volumeMounts, fileStorageMount) - } else if storageType[0] == EmptyDirType { // if no file-storage nor object storage were provided we will mount the emptyDir - emptyDir := corev1.VolumeMount{Name: "tmp-file-storage", MountPath: "/var/lib/pulp/tmp"} - volumeMounts = append(volumeMounts, emptyDir) - if pulpcoreType == settings.API { // worker and content pods don't need to mount the assets-file-storage secret - assetsVolume := corev1.VolumeMount{Name: "assets-file-storage", MountPath: "/var/lib/pulp/assets"} - volumeMounts = append(volumeMounts, assetsVolume) - } } if pulp.Spec.SigningSecret != "" { @@ -743,9 +718,6 @@ func (d *CommonDeployment) setInitContainerVolumeMounts(pulp repomanagerpulpproj MountPath: "/var/lib/pulp", } volumeMounts = append(volumeMounts, fileStorageMount) - } else if storageType[0] == EmptyDirType { // if no file-storage nor object storage were provided we will mount the emptyDir - emptyDir := corev1.VolumeMount{Name: "tmp-file-storage", MountPath: "/var/lib/pulp/tmp"} - volumeMounts = append(volumeMounts, emptyDir) } d.initContainerVolumeMounts = append([]corev1.VolumeMount(nil), volumeMounts...) } diff --git a/controllers/repo_manager/controller_test.go b/controllers/repo_manager/controller_test.go index 4473a256a..f0f34c12a 100644 --- a/controllers/repo_manager/controller_test.go +++ b/controllers/repo_manager/controller_test.go @@ -3,7 +3,6 @@ package repo_manager_test import ( "context" "fmt" - "reflect" "strconv" "strings" "time" @@ -835,6 +834,8 @@ exec "${PULP_CONTENT_ENTRYPOINT[@]}" \ Raw: []byte(`{"Api_Root": "/pulp/"}`), } + postgresStorageClass := "standard" + // [TODO] Instead of using this hardcoded pulp CR we should // use the samples from config/samples/ folder during each // pipeline workflow execution @@ -868,6 +869,7 @@ exec "${PULP_CONTENT_ENTRYPOINT[@]}" \ Replicas: 1, }, Database: repomanagerpulpprojectorgv1beta2.Database{ + PostgresStorageClass: &postgresStorageClass, PostgresStorageRequirements: "5Gi", }, FileStorageAccessMode: "ReadWriteOnce", @@ -973,70 +975,6 @@ exec "${PULP_CONTENT_ENTRYPOINT[@]}" \ }) }) - Context("When pulp.Spec.Database.PostgresStorageClass and cluster SC are not defined", func() { - It("Should configure the database pod template with an emptyDir volume", func() { - - By("Making sure that database type is not external") - if len(createdPulp.Spec.Database.ExternalDBSecret) > 0 { - Skip("External database does not need to provision a Persistent Volume") - } - - By("Checking if postgressc is not defined") - if postgresSC := createdPulp.Spec.Database.PostgresStorageClass; postgresSC != nil && *postgresSC != "" { - Skip("PostgresSC defined") - } - - By("Checking if there is no default SC") - if isDefaultSCDefined() { - Skip("Default storage class defined") - } - - By("Checking if sts template is configured to use emptyDir volume") - var found bool - for _, volume := range createdSts.Spec.Template.Spec.Volumes { - if volume.Name == DBVolumeName && reflect.DeepEqual(volume.VolumeSource.EmptyDir, &corev1.EmptyDirVolumeSource{}) { - found = true - break - } - } - Expect(found).Should(BeTrue()) - }) - }) - - Context("When pulp is not configured with object storage nor pulp.Spec.FileStorageClass is defined and there is no default SC", func() { - It("Shoud configure the api pod template with an emptyDir volume", func() { - By("Checking if an object storage is not defined") - if len(createdPulp.Spec.ObjectStorageAzureSecret) != 0 || len(createdPulp.Spec.ObjectStorageS3Secret) != 0 { - Skip("Object storage defined") - } - - By("Checking if fileSC is not defined") - if createdPulp.Spec.FileStorageClass != "" { - Skip("FileStorageClass defined") - } - - By("Checking if there is no default SC") - if isDefaultSCDefined() { - Skip("Default storage class defined") - } - - By("Checking if api deployment is configured to use emptyDir volume") - var foundTmp, foundAsset bool - apiDeployment := &appsv1.Deployment{} - objectGet(ctx, apiDeployment, PulpName+"-api") - for _, volume := range apiDeployment.Spec.Template.Spec.Volumes { - if volume.Name == "tmp-file-storage" && reflect.DeepEqual(volume.VolumeSource.EmptyDir, &corev1.EmptyDirVolumeSource{}) { - foundTmp = true - } - if volume.Name == "assets-file-storage" && reflect.DeepEqual(volume.VolumeSource.EmptyDir, &corev1.EmptyDirVolumeSource{}) { - foundAsset = true - } - } - Expect(foundTmp).Should(BeTrue()) - Expect(foundAsset).Should(BeTrue()) - }) - }) - Context("When creating API deployment", func() { It("Should follow the spec from pulp CR", func() { By("Checking api deployment being found") diff --git a/controllers/repo_manager/database.go b/controllers/repo_manager/database.go index 71d9aa53d..4ddeafaf8 100644 --- a/controllers/repo_manager/database.go +++ b/controllers/repo_manager/database.go @@ -81,7 +81,6 @@ func (r *RepoManagerReconciler) databaseController(ctx context.Context, pulp *re if err != nil && errors.IsNotFound(err) { log.Info("Creating a new Database StatefulSet", "StatefulSet.Namespace", pgSts.Namespace, "StatefulSet.Name", statefulSetName) controllers.UpdateStatus(ctx, r.Client, pulp, metav1.ConditionFalse, conditionType, "CreatingDatabaseSts", "Creating "+statefulSetName+" StatefulSet resource") - controllers.CheckEmptyDir(pulp, controllers.DatabaseResource) // Set Pulp instance as the owner and controller ctrl.SetControllerReference(pulp, expected_sts, r.Scheme) err = r.Create(ctx, expected_sts) @@ -337,17 +336,6 @@ func statefulSetForDatabase(m *repomanagerpulpprojectorgv1beta2.Pulp) *appsv1.St } volumes = append(volumes, volume) - // if there is no SC nor PVC nor object storage defined we will mount an emptyDir - } else if storageType[0] == controllers.EmptyDirType { - emptyDir := []corev1.Volume{ - { - Name: volumeName, - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - }, - } - volumes = append(volumes, emptyDir...) } pgDataMountPath := filepath.Dir(postgresDataPath) diff --git a/controllers/repo_manager/precheck.go b/controllers/repo_manager/precheck.go index fbd6de87a..4b8ca2bf6 100644 --- a/controllers/repo_manager/precheck.go +++ b/controllers/repo_manager/precheck.go @@ -52,7 +52,7 @@ func prechecks(ctx context.Context, r *RepoManagerReconciler, pulp *repomanagerp } // verify if multiple storage types were provided - if reconcile := checkMultipleStorageType(r.RawLogger, pulp); reconcile != nil { + if reconcile := checkStorageDefinitions(r.RawLogger, pulp); reconcile != nil { return reconcile, nil } @@ -72,7 +72,7 @@ func prechecks(ctx context.Context, r *RepoManagerReconciler, pulp *repomanagerp } // verify inconsistency in file_storage_* definition - if reconcile := checkFileStorage(ctx, r, pulp); reconcile != nil { + if reconcile := checkFileStorage(r, pulp); reconcile != nil { return reconcile, nil } @@ -155,13 +155,33 @@ func checkIngressDefinition(log logr.Logger, pulp *repomanagerpulpprojectorgv1be return nil } -// checkMultipleStorageType verifies if there is more than one storage type defined. +// checkStorageDefinitions verifies if there is more than one storage type defined or none. // Only a single type should be provided, if more the operator will not be able to // determine which one should be used. -func checkMultipleStorageType(log logr.Logger, pulp *repomanagerpulpprojectorgv1beta2.Pulp) *ctrl.Result { +func checkStorageDefinitions(log logr.Logger, pulp *repomanagerpulpprojectorgv1beta2.Pulp) *ctrl.Result { for _, resource := range []string{controllers.PulpResource, controllers.CacheResource, controllers.DatabaseResource} { - if foundMultiStorage, storageType := controllers.MultiStorageConfigured(pulp, resource); foundMultiStorage { - log.Error(nil, "found more than one storage type \""+strings.Join(storageType, `", "`)+"\" for "+resource+". Please, choose only one storage type or do not define any to use emptyDir") + foundMultiStorage, storageType := controllers.MultiStorageConfigured(pulp, resource) + if foundMultiStorage { + log.Error(nil, "found more than one storage type \""+strings.Join(storageType, `", "`)+"\" for "+resource+". Please, choose only one storage type.") + return &ctrl.Result{} + } + + // we don't need to check if there is no storage definition for cache pods (redis does not need to persist data) + // so we can skip the next checks and go to the next loop iteration + if resource == controllers.CacheResource { + continue + } + + // we don't need to check if there is no storage definition for installations using an external postgres instance. + // so we can skip the next checks and go to the next loop iteration + if resource == controllers.DatabaseResource { + if pulp.Spec.Database.ExternalDBSecret != "" { + continue + } + } + + if storageType == nil { + log.Error(nil, "could not find any storage definition for "+resource+". You must configure storage for Pulp and Database pods.") return &ctrl.Result{} } } @@ -215,18 +235,16 @@ func checkSecretsAvailability(ctx context.Context, r *RepoManagerReconciler, pul // checkFileStorage verifies if there is a file_storage definition but the storage_class is not provided // the file_storage_* fields are used to provision the PVC using the provided file_storage_class // if no file_storage_class is provided, the other fields will not be useful and can cause confusion -func checkFileStorage(ctx context.Context, r *RepoManagerReconciler, pulp *repomanagerpulpprojectorgv1beta2.Pulp) *ctrl.Result { +func checkFileStorage(r *RepoManagerReconciler, pulp *repomanagerpulpprojectorgv1beta2.Pulp) *ctrl.Result { if hasFileStorageDefinition(pulp) && len(pulp.Spec.FileStorageClass) == 0 { r.RawLogger.Error(nil, "No file_storage_class provided for the file_storage_{access_mode,size} definition(s)!") - r.RawLogger.Error(nil, "Provide a file_storage_storage_class with the file_storage_{access_mode,size} fields to deploy Pulp with persistent data") - r.RawLogger.Error(nil, "or remove all file_storage_* fields to deploy Pulp with emptyDir.") + r.RawLogger.Error(nil, "Provide a file_storage_storage_class with the file_storage_{access_mode,size} fields to deploy Pulp with persistent data.") return &ctrl.Result{} } if len(pulp.Spec.FileStorageClass) > 0 && (len(pulp.Spec.FileStorageAccessMode) == 0 || len(pulp.Spec.FileStorageSize) == 0) { r.RawLogger.Error(nil, "file_storage_class provided but no file_storage_size and/or file_storage_access_mode defined!") - r.RawLogger.Error(nil, "Provide a file_storage_size and file_storage_access_mode fields to deploy Pulp with persistent data") - r.RawLogger.Error(nil, "or remove all file_storage_* fields to deploy Pulp with emptyDir.") + r.RawLogger.Error(nil, "Provide a file_storage_size and file_storage_access_mode fields to deploy Pulp with persistent data.") return &ctrl.Result{} } return nil diff --git a/controllers/repo_manager/utils.go b/controllers/repo_manager/utils.go index 53011a532..d6cb36d19 100644 --- a/controllers/repo_manager/utils.go +++ b/controllers/repo_manager/utils.go @@ -371,12 +371,6 @@ func (r *RepoManagerReconciler) createPulpResource(resource ResourceDefinition, log.Info("Creating a new "+resource.Name+" "+objKind, "Namespace", resource.Pulp.Namespace, "Name", resource.Name) err = r.Create(resource.Context, expectedResource) - // special condition for api deployments where we need to provide a warning message - // in case no storage type is provided - if resource.Name == resource.Pulp.Name+"-api" && objKind == "Deployment" { - controllers.CheckEmptyDir(resource.Pulp, controllers.PulpResource) - } - if err != nil { log.Error(err, "Failed to create new "+resource.Name+" "+objKind) controllers.UpdateStatus(resource.Context, r.Client, resource.Pulp, metav1.ConditionFalse, resource.ConditionType, "ErrorCreating"+resource.Alias+objKind, "Failed to create "+resource.Name+" "+objKind+": "+err.Error()) diff --git a/controllers/utils.go b/controllers/utils.go index 3773bd229..f7f55617b 100644 --- a/controllers/utils.go +++ b/controllers/utils.go @@ -150,7 +150,7 @@ func MultiStorageConfigured(pulp *repomanagerpulpprojectorgv1beta2.Pulp, resourc if len(names) > 1 { return true, names } else if len(names) == 0 { - return false, []string{EmptyDirType} + return false, nil } case CacheResource: @@ -179,7 +179,7 @@ func MultiStorageConfigured(pulp *repomanagerpulpprojectorgv1beta2.Pulp, resourc if len(names) > 1 { return true, names } else if len(names) == 0 { - return false, []string{EmptyDirType} + return false, nil } } @@ -282,17 +282,6 @@ func CustomZapLogger() *zap.Logger { return logger } -// CheckEmptyDir creates a log warn message in case no persistent storage is provided -// for the given resource -func CheckEmptyDir(pulp *repomanagerpulpprojectorgv1beta2.Pulp, resource string) { - _, storageType := MultiStorageConfigured(pulp, resource) - if storageType[0] == EmptyDirType { - logger := CustomZapLogger() - logger.Warn("No StorageClass or PVC defined for " + strings.ToUpper(resource) + " pods!") - logger.Warn("CONFIGURING " + strings.ToUpper(resource) + " POD VOLUME AS EMPTYDIR. THIS SHOULD NOT BE USED IN PRODUCTION CLUSTERS.") - } -} - // CheckImageVersionModified verifies if the container image tag defined in // Pulp CR matches the one in the Deployment func ImageChanged(pulp *repomanagerpulpprojectorgv1beta2.Pulp) bool { diff --git a/docs/configuring/database.md b/docs/configuring/database.md index 7f957b765..1f44c1933 100644 --- a/docs/configuring/database.md +++ b/docs/configuring/database.md @@ -7,12 +7,12 @@ Pulp operator provides a PostgreSQL database for Pulp to use, but it is also pos [Pulp CR page](https://docs.pulpproject.org/pulp_operator/pulp/#database) has all the parameters that can be set to inform Pulp operator how it should deploy the PostgreSQL container. -If no `database` parameter is defined, Pulp operator will deploy PostgreSQL with the following configuration: +To configure Pulp operator to deploy PostgreSQL, **it is required to define the [storage configurations for the database pod](https://pulpproject.org/pulp-operator/docs/admin/guides/configurations/storage/#pulp-operator-storage-configuration)**. +Pulp operator will deploy PostgreSQL with the following configuration: * a `StatefulSet` will be provisioned to handle PostgreSQL pod * a single PostgreSQL replica will be available (it is **not** possible to form a cluster with this container) * it will deploy a `docker.io/library/postgres:13` image -* **no data will be persisted**, the container will mount an emptyDir (all data will be lost in case of pod restart) A new `Secret` (<deployment-name>-postgres-configuration) will also be created with some information like: diff --git a/docs/configuring/storage.md b/docs/configuring/storage.md index de0254726..4d6c2a372 100644 --- a/docs/configuring/storage.md +++ b/docs/configuring/storage.md @@ -1,21 +1,18 @@ # Pulp Operator storage configuration -Before installing Pulp, for production clusters, it is necessary to configure how Pulp should persist the data. +Before installing Pulp, it is necessary to configure how Pulp should persist the data. -[Pulp uses django-storages](https://docs.pulpproject.org/pulpcore/installation/storage.html) to support multiple types of storage backends. The current version of operator supports the following types of storage installation: +[Pulp uses django-storages](https://docs.pulpproject.org/pulpcore/installation/storage.html) to support multiple types of storage backends. The current version of pulp-operator supports the following types of storage installation: * [Storage Class](#configuring-pulp-operator-storage-to-use-a-storage-class) * [Persistent Volume Claim](#configuring-pulp-operator-storage-to-use-a-persistent-volume-claim) * [Azure Blob](#configuring-pulp-operator-to-use-object-storage) * [Amazon Simple Storage Service (S3)](#configuring-pulp-operator-to-use-object-storage) -* [EmptyDir](#configuring-pulp-operator-in-non-production-clusters) !!! info Only one storage type should be provided, trying to configure Pulp CR with multiple storage types will fail operator execution. -If no backend is configured, Pulp will by default use the EmptyDir volume. - ## Configuring Pulp Operator storage to use a Storage Class @@ -178,20 +175,3 @@ spec: ``` After that, Pulp Operator will automatically update the `settings.py` config file and redeploy pulpcore pods to get the new configuration. - - -## Configuring Pulp Operator in non-production clusters - -If there is no `Storage Class` nor `Persistent Volume Claim` nor `Object Storage` provided the operator will deploy the components (Pulp, Database, and Cache) with an [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir). - -You must configure storage for the Pulp Operator. For non-production clusters, you can set the components to an empty directory. If you do so, everything is lost if you restart the pod. - -!!! warning - Configure this option for only non-production clusters. - -!!! warning - The content stored in an `emptyDir` volume is not shared between the pods, because of that deploying Pulp with more than a single replica of `pulpcore-api` and/or `pulpcore-content` will result in unexpected behaviors. - -Configuring Pulp operator with `emptyDir` will fail the execution of some plugins. -For example, `pulp-container` plugin needs to access the data created by `pulpcore-api` component through `pulpcore-content` pod, but since each pod has its own `emptyDir` volume - and their data is not shared between them - Pulp will not work as expected. - diff --git a/staging_docs/admin/guides/configurations/database.md b/staging_docs/admin/guides/configurations/database.md index 40a7928f8..93988e587 100644 --- a/staging_docs/admin/guides/configurations/database.md +++ b/staging_docs/admin/guides/configurations/database.md @@ -7,12 +7,12 @@ Pulp operator provides a PostgreSQL database for Pulp to use, but it is also pos [Pulp CR page](https://docs.pulpproject.org/pulp_operator/pulp/#database) has all the parameters that can be set to inform Pulp operator how it should deploy the PostgreSQL container. -If no `database` parameter is defined, Pulp operator will deploy PostgreSQL with the following configuration: +To configure Pulp operator to deploy PostgreSQL, **it is required to define the [storage configurations for the database pod](https://pulpproject.org/pulp-operator/docs/admin/guides/configurations/storage/#pulp-operator-storage-configuration)**. +Pulp operator will deploy PostgreSQL with the following configuration: * a `StatefulSet` will be provisioned to handle PostgreSQL pod * a single PostgreSQL replica will be available (it is **not** possible to form a cluster with this container) * it will deploy a `docker.io/library/postgres:13` image -* **no data will be persisted**, the container will mount an emptyDir (all data will be lost in case of pod restart) A new `Secret` (-postgres-configuration) will also be created with some information like: diff --git a/staging_docs/admin/guides/configurations/storage.md b/staging_docs/admin/guides/configurations/storage.md index 62769cf6c..459b9b488 100644 --- a/staging_docs/admin/guides/configurations/storage.md +++ b/staging_docs/admin/guides/configurations/storage.md @@ -1,22 +1,18 @@ # Pulp Operator storage configuration -Before installing Pulp, for production clusters, it is necessary to configure how Pulp should persist the data. +Before installing Pulp, it is necessary to configure how Pulp should persist the data. -[Pulp uses django-storages](https://docs.pulpproject.org/pulpcore/installation/storage.html) to support multiple types of storage backends. The current version of operator supports the following types of storage installation: +[Pulp uses django-storages](https://docs.pulpproject.org/pulpcore/installation/storage.html) to support multiple types of storage backends. The current version of pulp-operator supports the following types of storage installation: * [Storage Class](#configuring-pulp-operator-storage-to-use-a-storage-class) * [Persistent Volume Claim](#configuring-pulp-operator-storage-to-use-a-persistent-volume-claim) * [Azure Blob](#configuring-pulp-operator-to-use-object-storage) * [Amazon Simple Storage Service (S3)](#configuring-pulp-operator-to-use-object-storage) -* [EmptyDir](#configuring-pulp-operator-in-non-production-clusters) !!! info Only one storage type should be provided, trying to configure Pulp CR with multiple storage types will fail operator execution. -If no backend is configured, Pulp will by default use the EmptyDir volume. - - ## Configure Pulp Operator storage to use a Storage Class Pulp operator has the following parameters to configure the components with a Storage Class: @@ -178,20 +174,3 @@ spec: ``` After that, Pulp Operator will automatically update the `settings.py` config file and redeploy pulpcore pods to get the new configuration. - - -## Configuring Pulp Operator in non-production clusters - -If there is no `Storage Class` nor `Persistent Volume Claim` nor `Object Storage` provided the operator will deploy the components (Pulp, Database, and Cache) with an [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir). - -You must configure storage for the Pulp Operator. For non-production clusters, you can set the components to an empty directory. If you do so, everything is lost if you restart the pod. - -!!! warning - Configure this option for only non-production clusters. - -!!! warning - The content stored in an `emptyDir` volume is not shared between the pods, because of that deploying Pulp with more than a single replica of `pulpcore-api` and/or `pulpcore-content` will result in unexpected behaviors. - -Configuring Pulp operator with `emptyDir` will fail the execution of some plugins. -For example, `pulp-container` plugin needs to access the data created by `pulpcore-api` component through `pulpcore-content` pod, but since each pod has its own `emptyDir` volume - and their data is not shared between them - Pulp will not work as expected. -