1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 11:48:53 +00:00

Add a disable subPath flag for prometheus-db volume

This commit is contained in:
Barthelemy Vessemont 2020-04-16 10:14:21 +02:00
parent 7f9c968060
commit 9cd369c090
11 changed files with 36 additions and 9 deletions

View file

@ -627,6 +627,7 @@ StorageSpec defines the configured storage for a group Prometheus servers. If ne
| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| disableMountSubPath | Deprecated: subPath usage will be disabled by default in a future release, this option will become unnecessary. DisableMountSubPath allows to remove any subPath usage in volume mounts. | bool | false |
| emptyDir | EmptyDirVolumeSource to be used by the Prometheus StatefulSets. If specified, used in place of any volumeClaimTemplate. More info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir | *[v1.EmptyDirVolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#emptydirvolumesource-v1-core) | false |
| volumeClaimTemplate | A PVC spec to be used by the Prometheus StatefulSets. | [v1.PersistentVolumeClaim](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#persistentvolumeclaim-v1-core) | false |

View file

@ -2969,6 +2969,11 @@ spec:
description: Storage is the definition of how storage will be used by
the Alertmanager instances.
properties:
disableMountSubPath:
description: 'Deprecated: subPath usage will be disabled by default
in a future release, this option will become unnecessary. DisableMountSubPath
allows to remove any subPath usage in volume mounts.'
type: boolean
emptyDir:
description: 'EmptyDirVolumeSource to be used by the Prometheus
StatefulSets. If specified, used in place of any volumeClaimTemplate.

View file

@ -4276,6 +4276,11 @@ spec:
storage:
description: Storage spec to specify how storage shall be used.
properties:
disableMountSubPath:
description: 'Deprecated: subPath usage will be disabled by default
in a future release, this option will become unnecessary. DisableMountSubPath
allows to remove any subPath usage in volume mounts.'
type: boolean
emptyDir:
description: 'EmptyDirVolumeSource to be used by the Prometheus
StatefulSets. If specified, used in place of any volumeClaimTemplate.

View file

@ -3223,6 +3223,11 @@ spec:
storage:
description: Storage spec to specify how storage shall be used.
properties:
disableMountSubPath:
description: 'Deprecated: subPath usage will be disabled by default
in a future release, this option will become unnecessary. DisableMountSubPath
allows to remove any subPath usage in volume mounts.'
type: boolean
emptyDir:
description: 'EmptyDirVolumeSource to be used by the Prometheus
StatefulSets. If specified, used in place of any volumeClaimTemplate.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -570,6 +570,10 @@ func subPathForStorage(s *monitoringv1.StorageSpec) string {
return ""
}
if s.DisableMountSubPath {
return ""
}
return "alertmanager-db"
}

File diff suppressed because one or more lines are too long

View file

@ -375,6 +375,9 @@ type AlertingSpec struct {
// If neither `emptyDir` nor `volumeClaimTemplate` is specified, then by default an [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) will be used.
// +k8s:openapi-gen=true
type StorageSpec struct {
// Deprecated: subPath usage will be disabled by default in a future release, this option will become unnecessary.
// DisableMountSubPath allows to remove any subPath usage in volume mounts.
DisableMountSubPath bool `json:"disableMountSubPath,omitempty"`
// EmptyDirVolumeSource to be used by the Prometheus StatefulSets. If specified, used in place of any volumeClaimTemplate. More
// info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
EmptyDir *v1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`

View file

@ -944,5 +944,9 @@ func subPathForStorage(s *monitoringv1.StorageSpec) string {
return ""
}
if s.DisableMountSubPath {
return ""
}
return "prometheus-db"
}