This is an automated email from the ASF dual-hosted git repository.
houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-operator.git
The following commit(s) were added to refs/heads/main by this push:
new f628dc7 Change managed backup repo to volume repo. (#368)
f628dc7 is described below
commit f628dc74e4446aeafd9d8627880d571a3296cb73
Author: Houston Putman <[email protected]>
AuthorDate: Wed Nov 10 15:44:36 2021 -0500
Change managed backup repo to volume repo. (#368)
---
api/v1beta1/solrbackup_types.go | 2 +-
api/v1beta1/solrcloud_types.go | 22 +--
api/v1beta1/solrcloud_with_defaults_test.go | 12 +-
api/v1beta1/zz_generated.deepcopy.go | 38 ++--
config/crd/bases/solr.apache.org_solrbackups.yaml | 2 +-
config/crd/bases/solr.apache.org_solrclouds.yaml | 198 ++++++++++----------
controllers/util/backup_util.go | 4 +-
controllers/util/backup_util_test.go | 160 ++++++++---------
controllers/util/solr_backup_repo_util.go | 33 ++--
controllers/util/solr_backup_repo_util_test.go | 30 ++--
controllers/util/solr_util.go | 20 +--
controllers/util/solr_util_test.go | 16 +-
docs/solr-backup/README.md | 45 +++--
docs/solr-cloud/solr-cloud-crd.md | 5 +
docs/upgrade-notes.md | 8 +-
example/README.md | 3 +-
...backup_managed.yaml => test_backup_volume.yaml} | 4 +-
example/test_solrcloud_backuprepos.yaml | 12 +-
helm/solr-operator/crds/crds.yaml | 200 ++++++++++-----------
helm/solr/README.md | 4 +-
20 files changed, 411 insertions(+), 407 deletions(-)
diff --git a/api/v1beta1/solrbackup_types.go b/api/v1beta1/solrbackup_types.go
index 2665211..ffddd90 100644
--- a/api/v1beta1/solrbackup_types.go
+++ b/api/v1beta1/solrbackup_types.go
@@ -41,7 +41,7 @@ type SolrBackupSpec struct {
// +optional
RepositoryName string `json:"repositoryName,omitempty"`
- // The list of collections to backup. If empty, all collections in the
cloud will be backed up.
+ // The list of collections to backup.
// +optional
Collections []string `json:"collections,omitempty"`
diff --git a/api/v1beta1/solrcloud_types.go b/api/v1beta1/solrcloud_types.go
index 3c6b1ef..eb37648 100644
--- a/api/v1beta1/solrcloud_types.go
+++ b/api/v1beta1/solrcloud_types.go
@@ -54,7 +54,7 @@ const (
DefaultBasicAuthUsername = "k8s-oper"
- LegacyBackupRepositoryName = "legacy_local_repository"
+ LegacyBackupRepositoryName = "legacy_volume_repository"
)
// SolrCloudSpec defines the desired state of SolrCloud
@@ -192,8 +192,8 @@ func (spec *SolrCloudSpec) withDefaults() (changed bool) {
if spec.StorageOptions.BackupRestoreOptions != nil {
spec.BackupRepositories = append(spec.BackupRepositories,
SolrBackupRepository{
Name: LegacyBackupRepositoryName,
- Managed: &ManagedRepository{
- Volume:
spec.StorageOptions.BackupRestoreOptions.Volume,
+ Volume: &VolumeRepository{
+ Source:
spec.StorageOptions.BackupRestoreOptions.Volume,
Directory:
spec.StorageOptions.BackupRestoreOptions.Directory,
},
})
@@ -253,7 +253,7 @@ type SolrDataStorageOptions struct {
EphemeralStorage *SolrEphemeralDataStorageOptions
`json:"ephemeral,omitempty"`
// Options required for backups to be enabled for this solrCloud.
- // Deprecated: Use a SolrBackupRepository with a ManagedRepository
instead
+ // Deprecated: Use a SolrBackupRepository with a VolumeRepository
instead
// TODO: Remove in v0.6.0
// +optional
BackupRestoreOptions *SolrBackupRestoreOptions
`json:"backupRestoreOptions,omitempty"`
@@ -362,19 +362,19 @@ type SolrEphemeralDataStorageOptions struct {
EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`
}
-// Deprecated: Use a SolrBackupRepository with a ManagedRepository instead
+// Deprecated: Use a SolrBackupRepository with a VolumeRepository instead
type SolrBackupRestoreOptions struct {
// This is a volumeSource for a volume that will be mounted to all
solrNodes to store backups and load restores.
// The data within the volume will be namespaces for this instance, so
feel free to use the same volume for multiple clouds.
// Since the volume will be mounted to all solrNodes, it must be able
to be written from multiple pods.
// If a PVC reference is given, the PVC must have `accessModes: -
ReadWriteMany`.
// Other options are to use a NFS volume.
- // Deprecated: Create an explicit 'managedRepositories' entry instead.
+ // Deprecated: Create an explicit 'backupRepositories' entry instead.
Volume corev1.VolumeSource `json:"volume"`
// Select a custom directory name to mount the backup/restore data from
the given volume.
// If not specified, then the name of the solrcloud will be used by
default.
- // Deprecated: Create an explicit 'managedRepositories' entry instead.
+ // Deprecated: Create an explicit 'backupRepositories' entry instead.
// +optional
Directory string `json:"directory,omitempty"`
}
@@ -402,7 +402,7 @@ type SolrBackupRepository struct {
// Repositories defined here are considered "managed" and can take
advantage of special operator features, such as
// post-backup compression.
//+optional
- Managed *ManagedRepository `json:"managed,omitempty"`
+ Volume *VolumeRepository `json:"volume,omitempty"`
}
type GcsRepository struct {
@@ -465,15 +465,15 @@ type S3Credentials struct {
CredentialsFileSecret *corev1.SecretKeySelector
`json:"credentialsFileSecret,omitempty"`
}
-type ManagedRepository struct {
+type VolumeRepository struct {
// This is a volumeSource for a volume that will be mounted to all
solrNodes to store backups and load restores.
// The data within the volume will be namespaced for this instance, so
feel free to use the same volume for multiple clouds.
// Since the volume will be mounted to all solrNodes, it must be able
to be written from multiple pods.
// If a PVC reference is given, the PVC must have `accessModes: -
ReadWriteMany`.
// Other options are to use a NFS volume.
- Volume corev1.VolumeSource `json:"volume"`
+ Source corev1.VolumeSource `json:"source"`
- // Select a custom directory name to mount the backup/restore data from
the given volume.
+ // Select a custom directory name to mount the backup/restore data in
the given volume.
// If not specified, then the name of the solrcloud will be used by
default.
// +optional
Directory string `json:"directory,omitempty"`
diff --git a/api/v1beta1/solrcloud_with_defaults_test.go
b/api/v1beta1/solrcloud_with_defaults_test.go
index 5ed2e03..af0074a 100644
--- a/api/v1beta1/solrcloud_with_defaults_test.go
+++ b/api/v1beta1/solrcloud_with_defaults_test.go
@@ -46,9 +46,9 @@ func TestDeprecatedBackupRepo(t *testing.T) {
var solrCloudTest *SolrCloud
backupRepos := []SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &ManagedRepository{
- Volume: corev1.VolumeSource{},
+ Name: "volumerepository1",
+ Volume: &VolumeRepository{
+ Source: corev1.VolumeSource{},
},
},
{
@@ -99,7 +99,7 @@ func TestDeprecatedBackupRepo(t *testing.T) {
func assertLegacyBackupRepo(t *testing.T, repository SolrBackupRepository,
volume corev1.VolumeSource, dir string) {
assert.Equal(t, LegacyBackupRepositoryName, repository.Name, "Wrong
name for the legacy backup repo")
assert.Nil(t, repository.GCS, "Legacy backup repo should not have GCS
specs")
- assert.NotNil(t, repository.Managed, "Legacy backup repo must have
Managed specs")
- assert.EqualValuesf(t, volume, repository.Managed.Volume, "Volume
incorrectly copied over for legacy backup repo")
- assert.Equal(t, dir, repository.Managed.Directory, "Directory
incorrectly copied over for legacy backup repo")
+ assert.NotNil(t, repository.Volume, "Legacy backup repo must have
Volume specs")
+ assert.EqualValuesf(t, volume, repository.Volume.Source, "Volume Source
incorrectly copied over for legacy backup repo")
+ assert.Equal(t, dir, repository.Volume.Directory, "Directory
incorrectly copied over for legacy backup repo")
}
diff --git a/api/v1beta1/zz_generated.deepcopy.go
b/api/v1beta1/zz_generated.deepcopy.go
index 4e3450b..89b0893 100644
--- a/api/v1beta1/zz_generated.deepcopy.go
+++ b/api/v1beta1/zz_generated.deepcopy.go
@@ -385,22 +385,6 @@ func (in *IngressOptions) DeepCopy() *IngressOptions {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
-func (in *ManagedRepository) DeepCopyInto(out *ManagedRepository) {
- *out = *in
- in.Volume.DeepCopyInto(&out.Volume)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new ManagedRepository.
-func (in *ManagedRepository) DeepCopy() *ManagedRepository {
- if in == nil {
- return nil
- }
- out := new(ManagedRepository)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
func (in *ManagedUpdateOptions) DeepCopyInto(out *ManagedUpdateOptions) {
*out = *in
if in.MaxPodsUnavailable != nil {
@@ -814,9 +798,9 @@ func (in *SolrBackupRepository) DeepCopyInto(out
*SolrBackupRepository) {
*out = new(S3Repository)
(*in).DeepCopyInto(*out)
}
- if in.Managed != nil {
- in, out := &in.Managed, &out.Managed
- *out = new(ManagedRepository)
+ if in.Volume != nil {
+ in, out := &in.Volume, &out.Volume
+ *out = new(VolumeRepository)
(*in).DeepCopyInto(*out)
}
}
@@ -1471,6 +1455,22 @@ func (in *VolumePersistenceSource) DeepCopy()
*VolumePersistenceSource {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *VolumeRepository) DeepCopyInto(out *VolumeRepository) {
+ *out = *in
+ in.Source.DeepCopyInto(&out.Source)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new VolumeRepository.
+func (in *VolumeRepository) DeepCopy() *VolumeRepository {
+ if in == nil {
+ return nil
+ }
+ out := new(VolumeRepository)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
func (in *ZKEphemeral) DeepCopyInto(out *ZKEphemeral) {
*out = *in
in.EmptyDirVolumeSource.DeepCopyInto(&out.EmptyDirVolumeSource)
diff --git a/config/crd/bases/solr.apache.org_solrbackups.yaml
b/config/crd/bases/solr.apache.org_solrbackups.yaml
index aa640fc..0032d4c 100644
--- a/config/crd/bases/solr.apache.org_solrbackups.yaml
+++ b/config/crd/bases/solr.apache.org_solrbackups.yaml
@@ -72,7 +72,7 @@ spec:
description: SolrBackupSpec defines the desired state of SolrBackup
properties:
collections:
- description: The list of collections to backup. If empty, all
collections in the cloud will be backed up.
+ description: The list of collections to backup.
items:
type: string
type: array
diff --git a/config/crd/bases/solr.apache.org_solrclouds.yaml
b/config/crd/bases/solr.apache.org_solrclouds.yaml
index 29ce391..9628d5c 100644
--- a/config/crd/bases/solr.apache.org_solrclouds.yaml
+++ b/config/crd/bases/solr.apache.org_solrclouds.yaml
@@ -115,13 +115,105 @@ spec:
- bucket
- gcsCredentialSecret
type: object
- managed:
+ name:
+ description: 'A name used to identify this local storage
profile. Values should follow RFC-1123. (See here for more details:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names)'
+ maxLength: 100
+ minLength: 1
+ pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?'
+ type: string
+ s3:
+ description: An S3Repository for Solr to use when
backing up and restoring collections.
+ properties:
+ baseLocation:
+ description: An already-created chroot within the
bucket to store data in. Defaults to the root path "/" if not specified.
+ type: string
+ bucket:
+ description: The name of the S3 bucket that all
backup data will be stored in
+ type: string
+ credentials:
+ description: "Options for specifying S3Credentials.
This is optional in case you want to mount this information yourself. However,
if you do not include these credentials, and you do not load them yourself via
a mount or EnvVars, you will likely see errors when taking s3 backups. \n If
running in EKS, you can create an IAMServiceAccount that uses a role
permissioned for this S3 bucket. Then use that serviceAccountName for your
SolrCloud, and the credentials shou [...]
+ properties:
+ accessKeyIdSecret:
+ description: The name & key of a Kubernetes
secret holding an AWS Access Key ID
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ credentialsFileSecret:
+ description: The name & key of a Kubernetes
secret holding an AWS credentials file
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretAccessKeySecret:
+ description: The name & key of a Kubernetes
secret holding an AWS Secret Access Key
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ sessionTokenSecret:
+ description: The name & key of a Kubernetes
secret holding an AWS Session Token
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ endpoint:
+ description: The full endpoint URL to use when
connecting with S3 (or a supported S3 compatible interface)
+ type: string
+ proxyUrl:
+ description: The full proxy URL to use when
connecting with S3
+ type: string
+ region:
+ description: The S3 region to store the backup data
in
+ type: string
+ required:
+ - bucket
+ - region
+ type: object
+ volume:
description: Allows specification of a "repository" for
Solr to use when backing up data "locally". Repositories defined here are
considered "managed" and can take advantage of special operator features, such
as post-backup compression.
properties:
directory:
- description: Select a custom directory name to mount
the backup/restore data from the given volume. If not specified, then the name
of the solrcloud will be used by default.
+ description: Select a custom directory name to mount
the backup/restore data in the given volume. If not specified, then the name of
the solrcloud will be used by default.
type: string
- volume:
+ source:
description: 'This is a volumeSource for a volume
that will be mounted to all solrNodes to store backups and load restores. The
data within the volume will be namespaced for this instance, so feel free to
use the same volume for multiple clouds. Since the volume will be mounted to
all solrNodes, it must be able to be written from multiple pods. If a PVC
reference is given, the PVC must have `accessModes: - ReadWriteMany`. Other
options are to use a NFS volume.'
properties:
awsElasticBlockStore:
@@ -1017,99 +1109,7 @@ spec:
type: object
type: object
required:
- - volume
- type: object
- name:
- description: 'A name used to identify this local storage
profile. Values should follow RFC-1123. (See here for more details:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names)'
- maxLength: 100
- minLength: 1
- pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?'
- type: string
- s3:
- description: An S3Repository for Solr to use when
backing up and restoring collections.
- properties:
- baseLocation:
- description: An already-created chroot within the
bucket to store data in. Defaults to the root path "/" if not specified.
- type: string
- bucket:
- description: The name of the S3 bucket that all
backup data will be stored in
- type: string
- credentials:
- description: "Options for specifying S3Credentials.
This is optional in case you want to mount this information yourself. However,
if you do not include these credentials, and you do not load them yourself via
a mount or EnvVars, you will likely see errors when taking s3 backups. \n If
running in EKS, you can create an IAMServiceAccount that uses a role
permissioned for this S3 bucket. Then use that serviceAccountName for your
SolrCloud, and the credentials shou [...]
- properties:
- accessKeyIdSecret:
- description: The name & key of a Kubernetes
secret holding an AWS Access Key ID
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- credentialsFileSecret:
- description: The name & key of a Kubernetes
secret holding an AWS credentials file
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- secretAccessKeySecret:
- description: The name & key of a Kubernetes
secret holding an AWS Secret Access Key
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- sessionTokenSecret:
- description: The name & key of a Kubernetes
secret holding an AWS Session Token
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- type: object
- endpoint:
- description: The full endpoint URL to use when
connecting with S3 (or a supported S3 compatible interface)
- type: string
- proxyUrl:
- description: The full proxy URL to use when
connecting with S3
- type: string
- region:
- description: The S3 region to store the backup data
in
- type: string
- required:
- - bucket
- - region
+ - source
type: object
required:
- name
@@ -4658,13 +4658,13 @@ spec:
description: Customize how the cloud data is stored. If
neither "persistent" or "ephemeral" is provided, then ephemeral storage will be
used by default.
properties:
backupRestoreOptions:
- description: 'Options required for backups to be enabled
for this solrCloud. Deprecated: Use a SolrBackupRepository with a
ManagedRepository instead TODO: Remove in v0.6.0'
+ description: 'Options required for backups to be enabled
for this solrCloud. Deprecated: Use a SolrBackupRepository with a
VolumeRepository instead TODO: Remove in v0.6.0'
properties:
directory:
- description: 'Select a custom directory name to mount
the backup/restore data from the given volume. If not specified, then the name
of the solrcloud will be used by default. Deprecated: Create an explicit
''managedRepositories'' entry instead.'
+ description: 'Select a custom directory name to mount
the backup/restore data from the given volume. If not specified, then the name
of the solrcloud will be used by default. Deprecated: Create an explicit
''backupRepositories'' entry instead.'
type: string
volume:
- description: 'This is a volumeSource for a volume that
will be mounted to all solrNodes to store backups and load restores. The data
within the volume will be namespaces for this instance, so feel free to use the
same volume for multiple clouds. Since the volume will be mounted to all
solrNodes, it must be able to be written from multiple pods. If a PVC reference
is given, the PVC must have `accessModes: - ReadWriteMany`. Other options are
to use a NFS volume. Dep [...]
+ description: 'This is a volumeSource for a volume that
will be mounted to all solrNodes to store backups and load restores. The data
within the volume will be namespaces for this instance, so feel free to use the
same volume for multiple clouds. Since the volume will be mounted to all
solrNodes, it must be able to be written from multiple pods. If a PVC reference
is given, the PVC must have `accessModes: - ReadWriteMany`. Other options are
to use a NFS volume. Dep [...]
properties:
awsElasticBlockStore:
description: 'AWSElasticBlockStore represents an
AWS Disk resource that is attached to a kubelet''s host machine and then
exposed to the pod. More info:
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore'
diff --git a/controllers/util/backup_util.go b/controllers/util/backup_util.go
index ac89129..443d205 100644
--- a/controllers/util/backup_util.go
+++ b/controllers/util/backup_util.go
@@ -144,8 +144,8 @@ func DeleteAsyncInfoForBackup(ctx context.Context, cloud
*solr.SolrCloud, collec
}
func EnsureDirectoryForBackup(solrCloud *solr.SolrCloud, backupRepository
*solr.SolrBackupRepository, backup *solr.SolrBackup, config *rest.Config) (err
error) {
- // Directory creation only required/possible for managed (i.e. local)
backups
- if IsRepoManaged(backupRepository) {
+ // Directory creation only required/possible for volume (i.e. local)
backups
+ if IsRepoVolume(backupRepository) {
backupPath := BackupLocationPath(backupRepository,
backup.Spec.Location)
return RunExecForPod(
solrCloud.GetAllSolrPodNames()[0],
diff --git a/controllers/util/backup_util_test.go
b/controllers/util/backup_util_test.go
index 18e9cdc..be00836 100644
--- a/controllers/util/backup_util_test.go
+++ b/controllers/util/backup_util_test.go
@@ -25,68 +25,68 @@ import (
"testing"
)
-func TestSolrBackupApiParamsForManagedRepositoryBackup(t *testing.T) {
- managedRepository := &solr.SolrBackupRepository{
- Name: "somemanagedrepository",
- Managed: &solr.ManagedRepository{
- Volume: corev1.VolumeSource{}, // Actual volume info
doesn't matter here
+func TestSolrBackupApiParamsForVolumeRepositoryBackup(t *testing.T) {
+ volumeRepository := &solr.SolrBackupRepository{
+ Name: "some-volume-repository",
+ Volume: &solr.VolumeRepository{
+ Source: corev1.VolumeSource{}, // Actual volume info
doesn't matter here
Directory: "/somedirectory",
},
}
backupConfig := solr.SolrBackup{
ObjectMeta: metav1.ObjectMeta{
- Name: "somebackupname",
+ Name: "some-backup-name",
},
Spec: solr.SolrBackupSpec{
SolrCloud: "solrcloudcluster",
- RepositoryName: "somemanagedrepository",
+ RepositoryName: "some-volume-repository",
Collections: []string{"col1", "col2"},
},
}
- queryParams := GenerateQueryParamsForBackup(managedRepository,
&backupConfig, "col2")
+ queryParams := GenerateQueryParamsForBackup(volumeRepository,
&backupConfig, "col2")
assert.Equalf(t, "BACKUP", queryParams.Get("action"), "Wrong %s for
Collections API Call", "action")
assert.Equalf(t, "col2", queryParams.Get("collection"), "Wrong %s for
Collections API Call", "collection name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("name"), "Wrong
%s for Collections API Call", "backup name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
- assert.Equalf(t,
"/var/solr/data/backup-restore/somemanagedrepository/backups",
queryParams.Get("location"), "Wrong %s for Collections API Call", "backup
location")
- assert.Equalf(t, "somemanagedrepository",
queryParams.Get("repository"), "Wrong %s for Collections API Call",
"repository")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("name"),
"Wrong %s for Collections API Call", "backup name")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
+ assert.Equalf(t,
"/var/solr/data/backup-restore/some-volume-repository/backups",
queryParams.Get("location"), "Wrong %s for Collections API Call", "backup
location")
+ assert.Equalf(t, "some-volume-repository",
queryParams.Get("repository"), "Wrong %s for Collections API Call",
"repository")
}
-func TestSolrBackupApiParamsForManagedRepositoryBackupWithLocation(t
*testing.T) {
- managedRepository := &solr.SolrBackupRepository{
- Name: "somemanagedrepository",
- Managed: &solr.ManagedRepository{
- Volume: corev1.VolumeSource{}, // Actual volume info
doesn't matter here
+func TestSolrBackupApiParamsForVolumeRepositoryBackupWithLocation(t
*testing.T) {
+ volumeRepository := &solr.SolrBackupRepository{
+ Name: "some-volume-repository",
+ Volume: &solr.VolumeRepository{
+ Source: corev1.VolumeSource{}, // Actual volume info
doesn't matter here
Directory: "/somedirectory",
},
}
backupConfig := solr.SolrBackup{
ObjectMeta: metav1.ObjectMeta{
- Name: "somebackupname",
+ Name: "some-backup-name",
},
Spec: solr.SolrBackupSpec{
SolrCloud: "solrcloudcluster",
- RepositoryName: "somemanagedrepository",
+ RepositoryName: "some-volume-repository",
Collections: []string{"col1", "col2"},
Location: "test/location",
},
}
- queryParams := GenerateQueryParamsForBackup(managedRepository,
&backupConfig, "col2")
+ queryParams := GenerateQueryParamsForBackup(volumeRepository,
&backupConfig, "col2")
assert.Equalf(t, "BACKUP", queryParams.Get("action"), "Wrong %s for
Collections API Call", "action")
assert.Equalf(t, "col2", queryParams.Get("collection"), "Wrong %s for
Collections API Call", "collection name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("name"), "Wrong
%s for Collections API Call", "backup name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
- assert.Equalf(t,
"/var/solr/data/backup-restore/somemanagedrepository/test/location",
queryParams.Get("location"), "Wrong %s for Collections API Call", "backup
location")
- assert.Equalf(t, "somemanagedrepository",
queryParams.Get("repository"), "Wrong %s for Collections API Call",
"repository")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("name"),
"Wrong %s for Collections API Call", "backup name")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
+ assert.Equalf(t,
"/var/solr/data/backup-restore/some-volume-repository/test/location",
queryParams.Get("location"), "Wrong %s for Collections API Call", "backup
location")
+ assert.Equalf(t, "some-volume-repository",
queryParams.Get("repository"), "Wrong %s for Collections API Call",
"repository")
}
func TestSolrBackupApiParamsForGcsRepositoryBackup(t *testing.T) {
gcsRepository := &solr.SolrBackupRepository{
- Name: "somegcsrepository",
+ Name: "some-gcs-repository",
GCS: &solr.GcsRepository{
Bucket: "some-gcs-bucket",
GcsCredentialSecret: corev1.SecretKeySelector{
@@ -98,11 +98,11 @@ func TestSolrBackupApiParamsForGcsRepositoryBackup(t
*testing.T) {
}
backupConfig := solr.SolrBackup{
ObjectMeta: metav1.ObjectMeta{
- Name: "somebackupname",
+ Name: "some-backup-name",
},
Spec: solr.SolrBackupSpec{
SolrCloud: "solrcloudcluster",
- RepositoryName: "somegcsrepository",
+ RepositoryName: "some-gcs-repository",
Collections: []string{"col1", "col2"},
},
}
@@ -111,15 +111,15 @@ func TestSolrBackupApiParamsForGcsRepositoryBackup(t
*testing.T) {
assert.Equalf(t, "BACKUP", queryParams.Get("action"), "Wrong %s for
Collections API Call", "action")
assert.Equalf(t, "col2", queryParams.Get("collection"), "Wrong %s for
Collections API Call", "collection name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("name"), "Wrong
%s for Collections API Call", "backup name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("name"),
"Wrong %s for Collections API Call", "backup name")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
assert.Equalf(t, "/some/gcs/path", queryParams.Get("location"), "Wrong
%s for Collections API Call", "backup location")
- assert.Equalf(t, "somegcsrepository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
+ assert.Equalf(t, "some-gcs-repository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
}
func TestSolrBackupApiParamsForGcsRepositoryBackupWithLocation(t *testing.T) {
gcsRepository := &solr.SolrBackupRepository{
- Name: "somegcsrepository",
+ Name: "some-gcs-repository",
GCS: &solr.GcsRepository{
Bucket: "some-gcs-bucket",
GcsCredentialSecret: corev1.SecretKeySelector{
@@ -131,11 +131,11 @@ func
TestSolrBackupApiParamsForGcsRepositoryBackupWithLocation(t *testing.T) {
}
backupConfig := solr.SolrBackup{
ObjectMeta: metav1.ObjectMeta{
- Name: "somebackupname",
+ Name: "some-backup-name",
},
Spec: solr.SolrBackupSpec{
SolrCloud: "solrcloudcluster",
- RepositoryName: "somegcsrepository",
+ RepositoryName: "some-gcs-repository",
Collections: []string{"col1", "col2"},
Location: "/another/gcs/path/test",
},
@@ -145,15 +145,15 @@ func
TestSolrBackupApiParamsForGcsRepositoryBackupWithLocation(t *testing.T) {
assert.Equalf(t, "BACKUP", queryParams.Get("action"), "Wrong %s for
Collections API Call", "action")
assert.Equalf(t, "col2", queryParams.Get("collection"), "Wrong %s for
Collections API Call", "collection name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("name"), "Wrong
%s for Collections API Call", "backup name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("name"),
"Wrong %s for Collections API Call", "backup name")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
assert.Equalf(t, "/another/gcs/path/test", queryParams.Get("location"),
"Wrong %s for Collections API Call", "backup location")
- assert.Equalf(t, "somegcsrepository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
+ assert.Equalf(t, "some-gcs-repository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
}
func TestSolrBackupApiParamsForGcsRepositoryBackupWithNoLocations(t
*testing.T) {
gcsRepository := &solr.SolrBackupRepository{
- Name: "somegcsrepository",
+ Name: "some-gcs-repository",
GCS: &solr.GcsRepository{
Bucket: "some-gcs-bucket",
GcsCredentialSecret: corev1.SecretKeySelector{
@@ -164,11 +164,11 @@ func
TestSolrBackupApiParamsForGcsRepositoryBackupWithNoLocations(t *testing.T)
}
backupConfig := solr.SolrBackup{
ObjectMeta: metav1.ObjectMeta{
- Name: "somebackupname",
+ Name: "some-backup-name",
},
Spec: solr.SolrBackupSpec{
SolrCloud: "solrcloudcluster",
- RepositoryName: "somegcsrepository",
+ RepositoryName: "some-gcs-repository",
Collections: []string{"col1", "col2"},
},
}
@@ -177,15 +177,15 @@ func
TestSolrBackupApiParamsForGcsRepositoryBackupWithNoLocations(t *testing.T)
assert.Equalf(t, "BACKUP", queryParams.Get("action"), "Wrong %s for
Collections API Call", "action")
assert.Equalf(t, "col2", queryParams.Get("collection"), "Wrong %s for
Collections API Call", "collection name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("name"), "Wrong
%s for Collections API Call", "backup name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("name"),
"Wrong %s for Collections API Call", "backup name")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
assert.Equalf(t, "/", queryParams.Get("location"), "Wrong %s for
Collections API Call", "backup location")
- assert.Equalf(t, "somegcsrepository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
+ assert.Equalf(t, "some-gcs-repository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
}
func TestSolrBackupApiParamsForS3RepositoryBackup(t *testing.T) {
s3Repository := &solr.SolrBackupRepository{
- Name: "somes3repository",
+ Name: "some-s3-repository",
S3: &solr.S3Repository{
Bucket: "some-s3-bucket",
Region: "us-west-2",
@@ -193,11 +193,11 @@ func TestSolrBackupApiParamsForS3RepositoryBackup(t
*testing.T) {
}
backupConfig := solr.SolrBackup{
ObjectMeta: metav1.ObjectMeta{
- Name: "somebackupname",
+ Name: "some-backup-name",
},
Spec: solr.SolrBackupSpec{
SolrCloud: "solrcloudcluster",
- RepositoryName: "somes3repository",
+ RepositoryName: "some-s3-repository",
Collections: []string{"col1", "col2"},
},
}
@@ -206,15 +206,15 @@ func TestSolrBackupApiParamsForS3RepositoryBackup(t
*testing.T) {
assert.Equalf(t, "BACKUP", queryParams.Get("action"), "Wrong %s for
Collections API Call", "action")
assert.Equalf(t, "col2", queryParams.Get("collection"), "Wrong %s for
Collections API Call", "collection name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("name"), "Wrong
%s for Collections API Call", "backup name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("name"),
"Wrong %s for Collections API Call", "backup name")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
assert.Equalf(t, "/", queryParams.Get("location"), "Wrong %s for
Collections API Call", "backup location")
- assert.Equalf(t, "somes3repository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
+ assert.Equalf(t, "some-s3-repository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
}
func TestSolrBackupApiParamsForS3RepositoryBackupWithLocation(t *testing.T) {
s3Repository := &solr.SolrBackupRepository{
- Name: "somes3repository",
+ Name: "some-s3-repository",
S3: &solr.S3Repository{
Bucket: "some-gcs-bucket",
Region: "us-west-2",
@@ -222,11 +222,11 @@ func
TestSolrBackupApiParamsForS3RepositoryBackupWithLocation(t *testing.T) {
}
backupConfig := solr.SolrBackup{
ObjectMeta: metav1.ObjectMeta{
- Name: "somebackupname",
+ Name: "some-backup-name",
},
Spec: solr.SolrBackupSpec{
SolrCloud: "solrcloudcluster",
- RepositoryName: "somes3repository",
+ RepositoryName: "some-s3-repository",
Collections: []string{"col1", "col2"},
Location: "/another/path",
},
@@ -236,17 +236,17 @@ func
TestSolrBackupApiParamsForS3RepositoryBackupWithLocation(t *testing.T) {
assert.Equalf(t, "BACKUP", queryParams.Get("action"), "Wrong %s for
Collections API Call", "action")
assert.Equalf(t, "col2", queryParams.Get("collection"), "Wrong %s for
Collections API Call", "collection name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("name"), "Wrong
%s for Collections API Call", "backup name")
- assert.Equalf(t, "somebackupname-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("name"),
"Wrong %s for Collections API Call", "backup name")
+ assert.Equalf(t, "some-backup-name-col2", queryParams.Get("async"),
"Wrong %s for Collections API Call", "async id")
assert.Equalf(t, "/another/path", queryParams.Get("location"), "Wrong
%s for Collections API Call", "backup location")
- assert.Equalf(t, "somes3repository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
+ assert.Equalf(t, "some-s3-repository", queryParams.Get("repository"),
"Wrong %s for Collections API Call", "repository")
}
func TestReportsFailureWhenBackupRepositoryCannotBeFoundByName(t *testing.T) {
repos := []solr.SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository1",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
Name: "gcsrepository1",
@@ -259,16 +259,16 @@ func
TestReportsFailureWhenBackupRepositoryCannotBeFoundByName(t *testing.T) {
},
},
}
- found := GetBackupRepositoryByName(repos, "managedrepository2")
+ found := GetBackupRepositoryByName(repos, "volumerepository2")
assert.Nil(t, found, "Expected GetBackupRepositoryByName to report that
no match was found")
}
-func TestCanLookupManagedRepositoryByName(t *testing.T) {
+func TestCanLookupVolumeRepositoryByName(t *testing.T) {
repos := []solr.SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository1",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
Name: "gcsrepository1",
@@ -281,8 +281,8 @@ func TestCanLookupManagedRepositoryByName(t *testing.T) {
},
},
{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
Name: "gcsrepository2",
@@ -296,7 +296,7 @@ func TestCanLookupManagedRepositoryByName(t *testing.T) {
},
},
}
- found := GetBackupRepositoryByName(repos, "managedrepository2")
+ found := GetBackupRepositoryByName(repos, "volumerepository2")
assert.NotNil(t, found, "Expected GetBackupRepositoryByName to report a
found match")
assert.Equal(t, repos[2], *found, "Wrong repo found")
@@ -305,8 +305,8 @@ func TestCanLookupManagedRepositoryByName(t *testing.T) {
func TestCanLookupGcsRepositoryByName(t *testing.T) {
repos := []solr.SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository1",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
Name: "gcsrepository1",
@@ -319,8 +319,8 @@ func TestCanLookupGcsRepositoryByName(t *testing.T) {
},
},
{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
Name: "gcsrepository2",
@@ -343,8 +343,8 @@ func TestCanLookupGcsRepositoryByName(t *testing.T) {
func TestCanLookupLegacyRepositoryByName(t *testing.T) {
repos := []solr.SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository1",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
Name: "gcsrepository1",
@@ -357,8 +357,8 @@ func TestCanLookupLegacyRepositoryByName(t *testing.T) {
},
},
{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
Name: "gcsrepository2",
@@ -372,11 +372,11 @@ func TestCanLookupLegacyRepositoryByName(t *testing.T) {
},
},
{
- Name: "legacy_local_repository",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "legacy_volume_repository",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
}
- found := GetBackupRepositoryByName(repos, "legacy_local_repository")
+ found := GetBackupRepositoryByName(repos, "legacy_volume_repository")
assert.NotNil(t, found, "Expected GetBackupRepositoryByName to report a
found match")
assert.Equal(t, repos[4], *found, "Wrong repo found")
@@ -387,8 +387,8 @@ func TestCanLookupLegacyRepositoryByName(t *testing.T) {
func TestRepositoryLookupSucceedsIfNoNameProvidedButOnlyOneRepositoryDefined(t
*testing.T) {
repos := []solr.SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository1",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
}
@@ -401,12 +401,12 @@ func
TestRepositoryLookupSucceedsIfNoNameProvidedButOnlyOneRepositoryDefined(t *
func TestRepositoryLookupFailsIfNoNameProvidedAndMultipleRepositoriesDefined(t
*testing.T) {
repos := []solr.SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository1",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{Volume:
corev1.VolumeSource{}},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{Source:
corev1.VolumeSource{}},
},
}
found := GetBackupRepositoryByName(repos, "")
diff --git a/controllers/util/solr_backup_repo_util.go
b/controllers/util/solr_backup_repo_util.go
index 55f34f6..0795919 100644
--- a/controllers/util/solr_backup_repo_util.go
+++ b/controllers/util/solr_backup_repo_util.go
@@ -38,8 +38,8 @@ func RepoVolumeName(repo *solrv1beta1.SolrBackupRepository)
string {
return fmt.Sprintf("backup-repository-%s", repo.Name)
}
-func IsRepoManaged(repo *solrv1beta1.SolrBackupRepository) bool {
- return repo.Managed != nil
+func IsRepoVolume(repo *solrv1beta1.SolrBackupRepository) bool {
+ return repo != nil && repo.Volume != nil
}
func BackupRestoreSubPathForCloud(directoryOverride string, cloud string)
string {
@@ -61,17 +61,17 @@ func S3RepoSecretMountPath(repo
*solrv1beta1.SolrBackupRepository) string {
return fmt.Sprintf("%s/%s/%s", BaseBackupRestorePath, repo.Name,
"s3credential")
}
-func ManagedRepoVolumeMountPath(repo *solrv1beta1.SolrBackupRepository) string
{
+func VolumeRepoVolumeMountPath(repo *solrv1beta1.SolrBackupRepository) string {
return fmt.Sprintf("%s/%s", BaseBackupRestorePath, repo.Name)
}
func RepoVolumeSourceAndMount(repo *solrv1beta1.SolrBackupRepository,
solrCloudName string) (source *corev1.VolumeSource, mount *corev1.VolumeMount) {
f := false
- if repo.Managed != nil {
- source = &repo.Managed.Volume
+ if repo.Volume != nil {
+ source = &repo.Volume.Source
mount = &corev1.VolumeMount{
- MountPath: ManagedRepoVolumeMountPath(repo),
- SubPath:
BackupRestoreSubPathForCloud(repo.Managed.Directory, solrCloudName),
+ MountPath: VolumeRepoVolumeMountPath(repo),
+ SubPath:
BackupRestoreSubPathForCloud(repo.Volume.Directory, solrCloudName),
ReadOnly: false,
}
} else if repo.GCS != nil {
@@ -101,6 +101,9 @@ func RepoVolumeSourceAndMount(repo
*solrv1beta1.SolrBackupRepository, solrCloudN
ReadOnly: true,
}
}
+ if mount != nil {
+ mount.Name = RepoVolumeName(repo)
+ }
return
}
@@ -118,7 +121,7 @@ func AdditionalRepoLibs(repo
*solrv1beta1.SolrBackupRepository) (libs []string)
}
func RepoXML(repo *solrv1beta1.SolrBackupRepository) (xml string) {
- if repo.Managed != nil {
+ if repo.Volume != nil {
xml = fmt.Sprintf(`<repository name="%s"
class="org.apache.solr.core.backup.repository.LocalFileSystemRepository"/>`,
repo.Name)
} else if repo.GCS != nil {
xml = fmt.Sprintf(`
@@ -198,22 +201,12 @@ func GenerateBackupRepositoriesForSolrXml(backupRepos
[]solrv1beta1.SolrBackupRe
return
}
-func IsBackupVolumePresent(repo *solrv1beta1.SolrBackupRepository, pod
*corev1.Pod) bool {
- expectedVolumeName := RepoVolumeName(repo)
- for _, volume := range pod.Spec.Volumes {
- if volume.Name == expectedVolumeName {
- return true
- }
- }
- return false
-}
-
func BackupLocationPath(repo *solrv1beta1.SolrBackupRepository, backupLocation
string) string {
- if repo.Managed != nil {
+ if repo.Volume != nil {
if backupLocation == "" {
backupLocation = "backups"
}
- return fmt.Sprintf("%s/%s", ManagedRepoVolumeMountPath(repo),
backupLocation)
+ return fmt.Sprintf("%s/%s", VolumeRepoVolumeMountPath(repo),
backupLocation)
} else if repo.GCS != nil {
if backupLocation != "" {
return backupLocation
diff --git a/controllers/util/solr_backup_repo_util_test.go
b/controllers/util/solr_backup_repo_util_test.go
index e33de2b..8873e6e 100644
--- a/controllers/util/solr_backup_repo_util_test.go
+++ b/controllers/util/solr_backup_repo_util_test.go
@@ -136,32 +136,32 @@ func TestS3RepoSolrModules(t *testing.T) {
assert.EqualValues(t, []string{"s3-repository"}, RepoSolrModules(repo),
"S3 Repos require the s3-repository solr module")
}
-func TestManagedRepoXML(t *testing.T) {
+func TestVolumeRepoXML(t *testing.T) {
repo := &solr.SolrBackupRepository{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{
- Volume: corev1.VolumeSource{},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{
+ Source: corev1.VolumeSource{},
},
}
- assert.EqualValuesf(t, "<repository name=\"managedrepository2\"
class=\"org.apache.solr.core.backup.repository.LocalFileSystemRepository\"/>",
RepoXML(repo), "Wrong SolrXML entry for the Managed Repo")
+ assert.EqualValuesf(t, "<repository name=\"volumerepository2\"
class=\"org.apache.solr.core.backup.repository.LocalFileSystemRepository\"/>",
RepoXML(repo), "Wrong SolrXML entry for the Volume Repo")
}
-func TestManagedRepoAdditionalLibs(t *testing.T) {
+func TestVolumeRepoAdditionalLibs(t *testing.T) {
repo := &solr.SolrBackupRepository{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{
- Volume: corev1.VolumeSource{},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{
+ Source: corev1.VolumeSource{},
},
}
- assert.Empty(t, AdditionalRepoLibs(repo), "Managed Repos require no
additional libraries for Solr")
+ assert.Empty(t, AdditionalRepoLibs(repo), "Volume Repos require no
additional libraries for Solr")
}
-func TestManagedRepoSolrModules(t *testing.T) {
+func TestVolumeRepoSolrModules(t *testing.T) {
repo := &solr.SolrBackupRepository{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{
- Volume: corev1.VolumeSource{},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{
+ Source: corev1.VolumeSource{},
},
}
- assert.Empty(t, RepoSolrModules(repo), "Managed Repos require no solr
modules")
+ assert.Empty(t, RepoSolrModules(repo), "Volume Repos require no solr
modules")
}
diff --git a/controllers/util/solr_util.go b/controllers/util/solr_util.go
index 9b122bc..db21780 100644
--- a/controllers/util/solr_util.go
+++ b/controllers/util/solr_util.go
@@ -203,7 +203,6 @@ func GenerateStatefulSet(solrCloud *solr.SolrCloud,
solrCloudStatus *solr.SolrCl
Name: RepoVolumeName(&repo),
VolumeSource: *volumeSource,
})
- mount.Name = RepoVolumeName(&repo)
volumeMounts = append(volumeMounts, *mount)
}
repoEnvVars := RepoEnvVars(&repo)
@@ -591,15 +590,16 @@ func generateSolrSetupInitContainers(solrCloud
*solr.SolrCloud, solrCloudStatus
// Add prep for backup-restore Repositories
// This entails setting the correct permissions for the directory
for _, repo := range solrCloud.Spec.BackupRepositories {
- if IsRepoManaged(&repo) {
- _, volumeMount := RepoVolumeSourceAndMount(&repo,
solrCloud.Name)
- volumeMounts = append(volumeMounts, *volumeMount)
-
- setupCommands = append(setupCommands, fmt.Sprintf(
- "chown -R %d:%d %s",
- DefaultSolrUser,
- DefaultSolrGroup,
- volumeMount.MountPath))
+ if IsRepoVolume(&repo) {
+ if _, volumeMount := RepoVolumeSourceAndMount(&repo,
solrCloud.Name); volumeMount != nil {
+ volumeMounts = append(volumeMounts,
*volumeMount)
+
+ setupCommands = append(setupCommands,
fmt.Sprintf(
+ "chown -R %d:%d %s",
+ DefaultSolrUser,
+ DefaultSolrGroup,
+ volumeMount.MountPath))
+ }
}
}
diff --git a/controllers/util/solr_util_test.go
b/controllers/util/solr_util_test.go
index 333609c..d943814 100644
--- a/controllers/util/solr_util_test.go
+++ b/controllers/util/solr_util_test.go
@@ -34,9 +34,9 @@ func TestNoRepositoryXmlGeneratedWhenNoRepositoriesExist(t
*testing.T) {
func TestGeneratedSolrXmlContainsEntryForEachRepository(t *testing.T) {
repos := []solr.SolrBackupRepository{
{
- Name: "managedrepository1",
- Managed: &solr.ManagedRepository{
- Volume: corev1.VolumeSource{},
+ Name: "volumerepository1",
+ Volume: &solr.VolumeRepository{
+ Source: corev1.VolumeSource{},
},
},
{
@@ -57,9 +57,9 @@ func TestGeneratedSolrXmlContainsEntryForEachRepository(t
*testing.T) {
},
},
{
- Name: "managedrepository2",
- Managed: &solr.ManagedRepository{
- Volume: corev1.VolumeSource{},
+ Name: "volumerepository2",
+ Volume: &solr.VolumeRepository{
+ Source: corev1.VolumeSource{},
},
},
{
@@ -85,8 +85,8 @@ func TestGeneratedSolrXmlContainsEntryForEachRepository(t
*testing.T) {
// These assertions don't fully guarantee valid XML, but they at least
make sure each repo is defined and uses the correct class.
// If we wanted to bring in an xpath library for assertions we could be
a lot more comprehensive here.
- assert.Containsf(t, xmlString, "<repository name=\"managedrepository1\"
class=\"org.apache.solr.core.backup.repository.LocalFileSystemRepository\"/>",
"Did not find '%s' in the list of backup repositories", "managedrepository1")
- assert.Containsf(t, xmlString, "<repository name=\"managedrepository2\"
class=\"org.apache.solr.core.backup.repository.LocalFileSystemRepository\"/>",
"Did not find '%s' in the list of backup repositories", "managedrepository2")
+ assert.Containsf(t, xmlString, "<repository name=\"volumerepository1\"
class=\"org.apache.solr.core.backup.repository.LocalFileSystemRepository\"/>",
"Did not find '%s' in the list of backup repositories", "volumerepository1")
+ assert.Containsf(t, xmlString, "<repository name=\"volumerepository2\"
class=\"org.apache.solr.core.backup.repository.LocalFileSystemRepository\"/>",
"Did not find '%s' in the list of backup repositories", "volumerepository2")
assert.Containsf(t, xmlString, "<repository name=\"gcsrepository1\"
class=\"org.apache.solr.gcs.GCSBackupRepository\">", "Did not find '%s' in the
list of backup repositories", "gcsrepository1")
assert.Containsf(t, xmlString, "<repository name=\"gcsrepository2\"
class=\"org.apache.solr.gcs.GCSBackupRepository\">", "Did not find '%s' in the
list of backup repositories", "gcsrepository2")
assert.Containsf(t, xmlString, "<repository name=\"s3repository1\"
class=\"org.apache.solr.s3.S3BackupRepository\">", "Did not find '%s' in the
list of backup repositories", "s3repository1")
diff --git a/docs/solr-backup/README.md b/docs/solr-backup/README.md
index 23c9d3d..d2dcd93 100644
--- a/docs/solr-backup/README.md
+++ b/docs/solr-backup/README.md
@@ -21,11 +21,11 @@ The Solr Operator supports triggering the backup of
arbitrary Solr collections.
Triggering these backups involves setting configuration options on both the
SolrCloud and SolrBackup CRDs.
The SolrCloud instance is responsible for defining one or more backup
"repositories" (metadata describing where and how the backup data should be
stored).
-SolrBackup instances then trigger backups by referencing these repositories by
name, listing the Solr collections to back up, and optionally requesting some
limited post-processing of the backup data (compression, relocation, etc).
+SolrBackup instances then trigger backups by referencing these repositories by
name, listing the Solr collections to back up, and optionally scheduling
recurring backups.
-For detailed information on how to best configure backups for your use case,
please refer to the detailed schema information provided by `kubectl explain
solrcloud.spec.dataStorage.backupRestoreOptions` and its child elements, as
well as `kubectl explain solrbackup`.
+For detailed information on how to best configure backups for your use case,
please refer to the detailed schema information provided by `kubectl explain
solrcloud.spec.backupRepositories` and its child elements, as well as `kubectl
explain solrbackup`.
-This page outlines how to create and delete a Kubernetes SolrBackup
+This page outlines how to create and delete a Kubernetes SolrBackup.
- [Creation](#creating-an-example-solrbackup)
- [Recurring/Scheduled Backups](#recurring-backups)
@@ -33,6 +33,7 @@ This page outlines how to create and delete a Kubernetes
SolrBackup
- [Repository Types](#supported-repository-types)
- [GCS](#gcs-backup-repositories)
- [S3](#s3-backup-repositories)
+ - [Volume](#volume-backup-repositories)
## Creating an example SolrBackup
@@ -70,8 +71,8 @@ To do this, run `kubectl edit solrcloud example`, adding the
following YAML nest
spec:
backupRepositories:
- name: "local-collection-backups-1"
- managed:
- volume:
+ volume:
+ source:
persistentVolumeClaim:
claimName: "collection-backup-pvc"
```
@@ -150,7 +151,7 @@ However, if the recurrent backup is already underway, it
will not be stopped.
### Backup Scheduling
Backups are scheduled based on the `startTimestamp` of the last backup.
-Therefore if a interval schedule such as `@every 1h` is used, and a backup
starts on `2021-11-09T03:10:00Z` and ends on `2021-11-09T05:30:00Z`, then the
next backup will be started at `2021-11-09T04:10:00Z`.
+Therefore, if an interval schedule such as `@every 1h` is used, and a backup
starts on `2021-11-09T03:10:00Z` and ends on `2021-11-09T05:30:00Z`, then the
next backup will be started at `2021-11-09T04:10:00Z`.
If the interval is shorter than the time it takes to complete a backup, then
the next backup will started directly after the previous backup completes (even
though it is delayed from its given schedule).
And the next backup will be scheduled based on the `startTimestamp` of the
delayed backup.
So there is a possibility of skew overtime if backups take longer than the
allotted schedule.
@@ -197,13 +198,13 @@ Note that deleting SolrBackup instances doesn't delete
the backed up data, which
In our example this data can still be found on the volume we created earlier
```bash
-$ kubectl exec example-solrcloud-0 -- ls -lh
/var/solr/data/backup-restore-managed-local-collection-backups-1/backups/
+$ kubectl exec example-solrcloud-0 -- ls -lh
/var/solr/data/backup-restore/local-collection-backups-1/backups/
total 8K
drwxr-xr-x 3 solr solr 4.0K Sep 16 11:48 local-backup-books
drwxr-xr-x 3 solr solr 4.0K Sep 16 11:48 local-backup-techproducts
```
-Managed backup data, as in our example, can always be deleted using standard
shell commands if desired:
+Volume backup data, as in our example, can always be deleted using standard
shell commands if desired:
```bash
kubectl exec example-solrcloud-0 -- rm -r
/var/solr/data/backup-restore/local-collection-backups-1/backups/local-backup-books
@@ -217,24 +218,30 @@ Note all repositories are defined in the `SolrCloud`
specification.
In order to use a repository in the `SolrBackup` CRD, it must be defined in
the `SolrCloud` spec.
All yaml examples below are `SolrCloud` resources, not `SolrBackup` resources.
-The Solr-operator currently supports three different backup repository types:
Google Cloud Storage ("GCS"), AWS S3 ("S3"), and managed ("local").
-The cloud backup solutions (GCS and S3) are strongly suggested over the
managed option, though they require newer Solr releases.
+The Solr-operator currently supports three different backup repository types:
Google Cloud Storage ("GCS"), AWS S3 ("S3"), and Volume ("local").
+The cloud backup solutions (GCS and S3) are strongly suggested as they are
cloud-native backup solutions, however they require newer Solr versions.
Multiple repositories can be defined under the
`SolrCloud.spec.backupRepositories` field.
-Specify a unique name and repo type that you want to connect to.
+Specify a unique name and single repo type that you want to connect to.
Repository-type specific options are found under the object named with the
repository-type.
Examples can be found below under each repository-type section below.
-Feel free to mix and match multiple backup repository types to fit your use
case:
+Feel free to mix and match multiple backup repository types to fit your use
case (or multiple repositories of the same type):
```yaml
spec:
backupRepositories:
- name: "local-collection-backups-1"
- managed:
+ volume:
...
- name: "gcs-collection-backups-1"
gcs:
...
+ - name: "s3-collection-backups-1"
+ s3:
+ ...
+ - name: "s3-collection-backups-2"
+ s3:
+ ...
```
### GCS Backup Repositories
@@ -336,19 +343,21 @@ If this is done correctly, you will only need to specify
the serviceAccount for
_NOTE: Because the Solr S3 Repository is using system-wide settings for AWS
credentials, you cannot specify different credentials for different S3
repositories.
This may be addressed in future Solr versions, but for now use the same
credentials for all s3 repos._
-### Managed ("Local") Backup Repositories
+### Volume Backup Repositories
_Since v0.5.0_
-Managed repositories store backup data "locally" on a Kubernetes volume
mounted by each Solr pod.
-An example of a SolrCloud spec with only one backup repository, with type
Managed:
+Volume repositories store backup data "locally" on a Kubernetes volume mounted
to each Solr pod.
+An example of a SolrCloud spec with only one backup repository, with type
Volume:
```yaml
spec:
backupRepositories:
- name: "local-collection-backups-1"
- managed:
- volume: # Required
+ volume:
+ source: # Required
persistentVolumeClaim:
claimName: "collection-backup-pvc"
directory: "store/here" # Optional
```
+
+**NOTE: All persistent volumes used with Volume Repositories must have
`accessMode: ReadWriteMany` set, otherwise the backups will not succeed.**
diff --git a/docs/solr-cloud/solr-cloud-crd.md
b/docs/solr-cloud/solr-cloud-crd.md
index 6d9c7a0..2e28f36 100644
--- a/docs/solr-cloud/solr-cloud-crd.md
+++ b/docs/solr-cloud/solr-cloud-crd.md
@@ -131,6 +131,11 @@ If both of those criteria are met, then an individual
ClusterIP Service will be
If you are using an `Ingress` for external addressability, you can customize
the created `Ingress` through
`SolrCloud.spec.customSolrKubeOptions.ingressOptions`.
Under this property, you can set custom `annotations`, `labels` and an
`ingressClassName`.
+## Backups
+
+Solr Backups are enabled via the Solr Operator.
+Please refer to the [SolrBackup documentation](../solr-backup) for more
information on setting up a SolrCloud with backups enabled.
+
## Zookeeper Reference
Solr Clouds require an Apache Zookeeper to connect to.
diff --git a/docs/upgrade-notes.md b/docs/upgrade-notes.md
index c7002a5..51b1772 100644
--- a/docs/upgrade-notes.md
+++ b/docs/upgrade-notes.md
@@ -121,16 +121,16 @@ _Note that the Helm chart version does not contain a `v`
prefix, which the downl
**Note**: Do not take backups while upgrading from the Solr Operator
`v0.4.0` to `v0.5.0`.
Wait for the SolrClouds to be updated, after the Solr Operator is upgraded,
and complete their rolling restarts before continuing to use the Backup
functionality.
-- The location of Solr backup data as well as the name of the Solr backups
have been changed, when using managed repositories.
+- The location of Solr backup data as well as the name of the Solr backups
have been changed, when using volume repositories.
Previously the name of the backup (in solr) was set to the name of the
collection.
Now the name given to the backup in Solr will be set to
`<backup-resource-name>-<collection-name>`, without the `<` or `>` characters,
where the `backup-resource-name` is the name of the SolrBackup resource.
- The directory in the Read-Write-Many Volume, required for managed
repositories, that backups are written to is now `/backups` by default, instead
of `/backups/<backup-name>`.
+ The directory in the Read-Write-Many Volume, required for volume
repositories, that backups are written to is now
`/cloud/<solr-cloud-name>/backups` by default, instead of
`/cloud/<solr-cloud-name>/backups/<backup-name>`.
Because the backup name in Solr uses both the SolrBackup resource name and
the collection name, there should be no collisions in this directory.
- However, this can be overridden using the `SolrBackup.spec.location` option.
+ However, this can be overridden using the `SolrBackup.spec.location` option,
which is appended to `/cloud/<solr-cloud-name>`.
- The SolrBackup persistence option has been removed as of `v0.5.0`.
- Users should plan to keep their backup data in the shared volume if using a
MountedVolume Backup repository.
+ Users should plan to keep their backup data in the shared volume if using a
Volume Backup repository.
If `SolrBackup.spec.persistence` is provided, it will be removed and written
back to Kubernetes.
Users using the S3 persistence option should try to use the [S3 backup
repository](solr-backup/README.md#s3-backup-repositories) instead. This
requires Solr 8.10 or higher.
diff --git a/example/README.md b/example/README.md
index 10a08ed..61b7cb7 100644
--- a/example/README.md
+++ b/example/README.md
@@ -11,6 +11,5 @@ The following examples are provided in helping explain
various options provided
- Solr Prometheus Exporter
- [Basic](test_solrprometheusexporter.yaml)
- Solr Backup
- - [Managed Backup](test_backup_managed.yaml)
- - [Managed Backup with
Persistence](test_backup_managed_with_persistence.yaml)
+ - [Volume Backup](test_backup_volume.yaml)
- [GCS Backup](test_backup_gcs.yaml)
diff --git a/example/test_backup_managed.yaml b/example/test_backup_volume.yaml
similarity index 92%
rename from example/test_backup_managed.yaml
rename to example/test_backup_volume.yaml
index f66bd10..ac31610 100644
--- a/example/test_backup_managed.yaml
+++ b/example/test_backup_volume.yaml
@@ -17,10 +17,10 @@
apiVersion: solr.apache.org/v1beta1
kind: SolrBackup
metadata:
- name: local-backup-without-persistence
+ name: volume-backup
namespace: default
spec:
- repositoryName: "managed_repository_1"
+ repositoryName: "volume_repository_1"
solrCloud: multiple-backup-repos
collections:
- example
diff --git a/example/test_solrcloud_backuprepos.yaml
b/example/test_solrcloud_backuprepos.yaml
index 6cb2922..6c0f734 100644
--- a/example/test_solrcloud_backuprepos.yaml
+++ b/example/test_solrcloud_backuprepos.yaml
@@ -22,14 +22,12 @@ spec:
solrImage:
tag: 8.10
backupRepositories:
- # "Managed" repositories store backup data in a Kubernetes volume, This
- # allows the operator to make several advanced features available, such as
- # backup compression and relocation ("persistence").
+ # "Volume" repositories store backup data in a Kubernetes volume.
#
- # This syntax replaces the deprecated local-backup syntax above.
- - name: "managed_repository_1"
- managed:
- volume:
+ # This syntax replaces the deprecated local-backup syntax.
+ - name: "volume_repository_1"
+ volume:
+ source:
persistentVolumeClaim:
claimName: "pvc-test-1" # PVC expected to already exist!
diff --git a/helm/solr-operator/crds/crds.yaml
b/helm/solr-operator/crds/crds.yaml
index 7cd6c99..c9ad81f 100644
--- a/helm/solr-operator/crds/crds.yaml
+++ b/helm/solr-operator/crds/crds.yaml
@@ -72,7 +72,7 @@ spec:
description: SolrBackupSpec defines the desired state of SolrBackup
properties:
collections:
- description: The list of collections to backup. If empty, all
collections in the cloud will be backed up.
+ description: The list of collections to backup.
items:
type: string
type: array
@@ -1368,13 +1368,105 @@ spec:
- bucket
- gcsCredentialSecret
type: object
- managed:
+ name:
+ description: 'A name used to identify this local storage
profile. Values should follow RFC-1123. (See here for more details:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names)'
+ maxLength: 100
+ minLength: 1
+ pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?'
+ type: string
+ s3:
+ description: An S3Repository for Solr to use when
backing up and restoring collections.
+ properties:
+ baseLocation:
+ description: An already-created chroot within the
bucket to store data in. Defaults to the root path "/" if not specified.
+ type: string
+ bucket:
+ description: The name of the S3 bucket that all
backup data will be stored in
+ type: string
+ credentials:
+ description: "Options for specifying S3Credentials.
This is optional in case you want to mount this information yourself. However,
if you do not include these credentials, and you do not load them yourself via
a mount or EnvVars, you will likely see errors when taking s3 backups. \n If
running in EKS, you can create an IAMServiceAccount that uses a role
permissioned for this S3 bucket. Then use that serviceAccountName for your
SolrCloud, and the credentials shou [...]
+ properties:
+ accessKeyIdSecret:
+ description: The name & key of a Kubernetes
secret holding an AWS Access Key ID
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ credentialsFileSecret:
+ description: The name & key of a Kubernetes
secret holding an AWS credentials file
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretAccessKeySecret:
+ description: The name & key of a Kubernetes
secret holding an AWS Secret Access Key
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ sessionTokenSecret:
+ description: The name & key of a Kubernetes
secret holding an AWS Session Token
+ properties:
+ key:
+ description: The key of the secret to select
from. Must be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or
its key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ endpoint:
+ description: The full endpoint URL to use when
connecting with S3 (or a supported S3 compatible interface)
+ type: string
+ proxyUrl:
+ description: The full proxy URL to use when
connecting with S3
+ type: string
+ region:
+ description: The S3 region to store the backup data
in
+ type: string
+ required:
+ - bucket
+ - region
+ type: object
+ volume:
description: Allows specification of a "repository" for
Solr to use when backing up data "locally". Repositories defined here are
considered "managed" and can take advantage of special operator features, such
as post-backup compression.
properties:
directory:
- description: Select a custom directory name to mount
the backup/restore data from the given volume. If not specified, then the name
of the solrcloud will be used by default.
+ description: Select a custom directory name to mount
the backup/restore data in the given volume. If not specified, then the name of
the solrcloud will be used by default.
type: string
- volume:
+ source:
description: 'This is a volumeSource for a volume
that will be mounted to all solrNodes to store backups and load restores. The
data within the volume will be namespaced for this instance, so feel free to
use the same volume for multiple clouds. Since the volume will be mounted to
all solrNodes, it must be able to be written from multiple pods. If a PVC
reference is given, the PVC must have `accessModes: - ReadWriteMany`. Other
options are to use a NFS volume.'
properties:
awsElasticBlockStore:
@@ -2270,99 +2362,7 @@ spec:
type: object
type: object
required:
- - volume
- type: object
- name:
- description: 'A name used to identify this local storage
profile. Values should follow RFC-1123. (See here for more details:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names)'
- maxLength: 100
- minLength: 1
- pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?'
- type: string
- s3:
- description: An S3Repository for Solr to use when
backing up and restoring collections.
- properties:
- baseLocation:
- description: An already-created chroot within the
bucket to store data in. Defaults to the root path "/" if not specified.
- type: string
- bucket:
- description: The name of the S3 bucket that all
backup data will be stored in
- type: string
- credentials:
- description: "Options for specifying S3Credentials.
This is optional in case you want to mount this information yourself. However,
if you do not include these credentials, and you do not load them yourself via
a mount or EnvVars, you will likely see errors when taking s3 backups. \n If
running in EKS, you can create an IAMServiceAccount that uses a role
permissioned for this S3 bucket. Then use that serviceAccountName for your
SolrCloud, and the credentials shou [...]
- properties:
- accessKeyIdSecret:
- description: The name & key of a Kubernetes
secret holding an AWS Access Key ID
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- credentialsFileSecret:
- description: The name & key of a Kubernetes
secret holding an AWS credentials file
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- secretAccessKeySecret:
- description: The name & key of a Kubernetes
secret holding an AWS Secret Access Key
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- sessionTokenSecret:
- description: The name & key of a Kubernetes
secret holding an AWS Session Token
- properties:
- key:
- description: The key of the secret to select
from. Must be a valid secret key.
- type: string
- name:
- description: 'Name of the referent. More
info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
- type: string
- optional:
- description: Specify whether the Secret or
its key must be defined
- type: boolean
- required:
- - key
- type: object
- type: object
- endpoint:
- description: The full endpoint URL to use when
connecting with S3 (or a supported S3 compatible interface)
- type: string
- proxyUrl:
- description: The full proxy URL to use when
connecting with S3
- type: string
- region:
- description: The S3 region to store the backup data
in
- type: string
- required:
- - bucket
- - region
+ - source
type: object
required:
- name
@@ -5911,13 +5911,13 @@ spec:
description: Customize how the cloud data is stored. If
neither "persistent" or "ephemeral" is provided, then ephemeral storage will be
used by default.
properties:
backupRestoreOptions:
- description: 'Options required for backups to be enabled
for this solrCloud. Deprecated: Use a SolrBackupRepository with a
ManagedRepository instead TODO: Remove in v0.6.0'
+ description: 'Options required for backups to be enabled
for this solrCloud. Deprecated: Use a SolrBackupRepository with a
VolumeRepository instead TODO: Remove in v0.6.0'
properties:
directory:
- description: 'Select a custom directory name to mount
the backup/restore data from the given volume. If not specified, then the name
of the solrcloud will be used by default. Deprecated: Create an explicit
''managedRepositories'' entry instead.'
+ description: 'Select a custom directory name to mount
the backup/restore data from the given volume. If not specified, then the name
of the solrcloud will be used by default. Deprecated: Create an explicit
''backupRepositories'' entry instead.'
type: string
volume:
- description: 'This is a volumeSource for a volume that
will be mounted to all solrNodes to store backups and load restores. The data
within the volume will be namespaces for this instance, so feel free to use the
same volume for multiple clouds. Since the volume will be mounted to all
solrNodes, it must be able to be written from multiple pods. If a PVC reference
is given, the PVC must have `accessModes: - ReadWriteMany`. Other options are
to use a NFS volume. Dep [...]
+ description: 'This is a volumeSource for a volume that
will be mounted to all solrNodes to store backups and load restores. The data
within the volume will be namespaces for this instance, so feel free to use the
same volume for multiple clouds. Since the volume will be mounted to all
solrNodes, it must be able to be written from multiple pods. If a PVC reference
is given, the PVC must have `accessModes: - ReadWriteMany`. Other options are
to use a NFS volume. Dep [...]
properties:
awsElasticBlockStore:
description: 'AWSElasticBlockStore represents an
AWS Disk resource that is attached to a kubelet''s host machine and then
exposed to the pod. More info:
https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore'
diff --git a/helm/solr/README.md b/helm/solr/README.md
index 0871e66..5f642f7 100644
--- a/helm/solr/README.md
+++ b/helm/solr/README.md
@@ -125,8 +125,8 @@ See the
[documentation](https://apache.github.io/solr-operator/docs/solr-cloud/s
| dataStorage.persistent.pvc.annotations | map[string]string | | Set the
annotations for your Solr data PVCs |
| dataStorage.persistent.pvc.labels | map[string]string | | Set the labels for
your Solr data PVCs |
| dataStorage.persistent.pvc.storageClassName | string | | Override the
default storageClass for your Solr data PVCs |
-| dataStorage.backupRestoreOptions.volume | object | | **DEPRECATED: Use a
Managed Repo in `backupRepositories` instead. This option will be removed in
`v0.6.0`.** A read-write-many volume that can be attached to all Solr pods, for
the purpose of storing backup data. This is required when using the SolrBackup
CRD. |
-| dataStorage.backupRestoreOptions.directory | string | | **DEPRECATED: Use a
Managed Repo in `backupRepositories` instead. This option will be removed in
`v0.6.0`.** Override the default backup-restore volume location in the Solr
container |
+| dataStorage.backupRestoreOptions.volume | object | | **DEPRECATED: Use a
Volume Repo in `backupRepositories` instead. This option will be removed in
`v0.6.0`.** A read-write-many volume that can be attached to all Solr pods, for
the purpose of storing backup data. This is required when using the SolrBackup
CRD. |
+| dataStorage.backupRestoreOptions.directory | string | | **DEPRECATED: Use a
Volume Repo in `backupRepositories` instead. This option will be removed in
`v0.6.0`.** Override the default backup-restore volume location in the Solr
container |
### Addressability Options