Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

doc(volumes): add docs for attaching additional volumes #739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions docs/solr-cloud/solr-cloud-crd.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,62 @@ These options can be found in `SolrCloud.spec.dataStorage`
- **`emptyDir`** - An [`emptyDir` volume source](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) that describes the desired emptyDir volume to use in each SolrCloud pod to store data.
- **`hostPath`** - A [`hostPath` volume source](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath) that describes the desired hostPath volume to use in each SolrCloud pod to store data.


### Mounting Additional Volumes

It is also possible to mount additional volumes to the SolrCloud (or its initContainers). Some example scenarios where you might use this would be:
- Custom solr plugins that rely on certain data to be present on disk
- Bootstrapping additional configuration for Solr via a ConfigMap
- A dedicated volume to support backups

Below is an example of the last scenario:

```yaml
apiVersion: solr.apache.org/v1beta1
kind: SolrCloud
metadata:
name: test
namespace: test
spec:
replicas: 1
customSolrKubeOptions:
podOptions:
volumes:
- source:
persistentVolumeClaim:
claimName: backup-data-pvc
name: backup-data
defaultContainerMount:
mountPath: /var/solr/data/backup
name: backup-data
initContainers:
- name: chmod-backup
image: busybox:1.28.0-glibc
command:
- "chmod"
- "-R"
- "766"
- "/var/solr/data/backup"
volumeMounts:
- name: backup-data
mountPath: /var/solr/data/backup

---
# Volume itself provisioned elsewhere
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: backup-data-pvc
namespace: test
spec:
storageClassName: "" # Implementation specific
volumeName: backup-data
accessModes:
- ReadWriteMany
```

Note the `source` spec may change based on the implementation. In this case, the `persisentVolumeClaim` spec requires field `claimName`.

## Update Strategy
_Since v0.2.7_

Expand Down