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

fix(pvc): split PVC configuration between Deployments #224

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

andrewazores
Copy link
Member

Related to #220

Splits PVC definition in two. Originally, storage only needed to be provided to the Cryostat container itself, for the archives. Later we added the h2:file database in 2.x, which was still part of the Cryostat container. Since Cryostat 3.0 we have a separate database and a separate S3 storage running as separate containers in the same Pod. In 4.0 we have separate Deployments for each of Cryostat, database, and storage. Therefore, it only makes sense that the database and storage have storage configuration parameters (and Cryostat does not), and both of these should also be configured separately since the size and speed requirements for each are likely to differ significantly.

@andrewazores andrewazores added feat New feature or request safe-to-test labels Nov 29, 2024
@andrewazores andrewazores requested a review from a team November 29, 2024 19:04
@@ -85,12 +85,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if ((.Values.pvc).enabled) }}
{{- if ((.Values.db.resources.pvc).enabled) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- if ((.Values.db.resources.pvc).enabled) }}
{{- if (.Values.db.pvc).enabled }}

I think .db.resources refers to container resource requirements :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, thanks. I initially nested it under resources, but then it would be annoying to set PVC settings and CPU/memory separately so I moved it back up a level. I'll change this when I'm back at my computer (probably Monday).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this when I'm back at my computer (probably Monday).

Sounds good! Happy Black Friday weekends^^

- name: {{ .Chart.Name }}-db
persistentVolumeClaim:
claimName: {{ .Release.Name }}-db
{{- end }}
{{- if not ((.Values.pvc).enabled) }}
{{- if not ((.Values.db.resources.pvc).enabled) }}
Copy link
Member

@tthvo tthvo Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can use else here?

@@ -99,12 +99,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if ((.Values.pvc).enabled) }}
{{- if ((.Values.storage.resources.pvc).enabled) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- if ((.Values.storage.resources.pvc).enabled) }}
{{- if (.Values.storage.pvc).enabled }}

- name: {{ .Chart.Name }}-storage
persistentVolumeClaim:
claimName: {{ .Release.Name }}-storage
{{- end }}
{{- if not ((.Values.pvc).enabled) }}
{{- if not ((.Values.storage.resources.pvc).enabled) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also use else here :D

- ReadWriteOnce
## @param storage.pvc.selector [object] Selector for the persistentVolumeClaim. See: [Selector](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)
selector: {}
## @param storage.pvc.storageClassName [string, nullable] The name of the StorageClass for the persistentVolumeClaim. See: [Class](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we should the URL should include section point. For example:

https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class

## @param storage.pvc.selector [object] Selector for the persistentVolumeClaim. See: [Selector](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)
selector: {}
## @param storage.pvc.storageClassName [string, nullable] The name of the StorageClass for the persistentVolumeClaim. See: [Class](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)
storageClassName: ""
Copy link
Member

@tthvo tthvo Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these storageClassName are meant default to null or unset (i.e. to be commented out). This allows the default storageClass to to be set on the PVC.

https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request safe-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants