mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-16 21:07:22 +00:00
Merge pull request #50457 from screeley44/volumetype-api
Automatic merge from submit-queue (batch tested with PRs 50457, 55558, 53483, 55731, 52842). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. VolumeMode and VolumeDevice api **What this PR does / why we need it:** Adds volumeType api to PV and PVC for local block support based on this proposal (https://github.com/kubernetes/community/pull/805) and this feature issue: https://github.com/kubernetes/features/issues/351 **Special notes for your reviewer:** There are other PR changes coming, this just simply creates the api fields #53385 - binding logic changes dependent on this change **Release note:** NONE Notes will be added in subsequents PR with the volume plugin changes, CRI, etc... cc @msau42 @liggitt @jsafrane @mtanino @saad-ali @erinboyd
This commit is contained in:
1808
staging/src/k8s.io/api/core/v1/generated.pb.go
generated
1808
staging/src/k8s.io/api/core/v1/generated.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -533,6 +533,13 @@ message Container {
|
||||
// +patchStrategy=merge
|
||||
repeated VolumeMount volumeMounts = 9;
|
||||
|
||||
// volumeDevices is the list of block devices to be used by the container.
|
||||
// This is an alpha feature and may change in the future.
|
||||
// +patchMergeKey=devicePath
|
||||
// +patchStrategy=merge
|
||||
// +optional
|
||||
repeated VolumeDevice volumeDevices = 21;
|
||||
|
||||
// Periodic probe of container liveness.
|
||||
// Container will be restarted if the probe fails.
|
||||
// Cannot be updated.
|
||||
@@ -2219,6 +2226,12 @@ message PersistentVolumeClaimSpec {
|
||||
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
|
||||
// +optional
|
||||
optional string storageClassName = 5;
|
||||
|
||||
// volumeMode defines what type of volume is required by the claim.
|
||||
// Value of Filesystem is implied when not included in claim spec.
|
||||
// This is an alpha feature and may change in the future.
|
||||
// +optional
|
||||
optional string volumeMode = 6;
|
||||
}
|
||||
|
||||
// PersistentVolumeClaimStatus is the current status of a persistent volume claim.
|
||||
@@ -2418,6 +2431,12 @@ message PersistentVolumeSpec {
|
||||
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
|
||||
// +optional
|
||||
repeated string mountOptions = 7;
|
||||
|
||||
// volumeMode defines if a volume is intended to be used with a formatted filesystem
|
||||
// or to remain in raw block state. Value of Filesystem is implied when not included in spec.
|
||||
// This is an alpha feature and may change in the future.
|
||||
// +optional
|
||||
optional string volumeMode = 8;
|
||||
}
|
||||
|
||||
// PersistentVolumeStatus is the current status of a persistent volume.
|
||||
@@ -4205,6 +4224,15 @@ message Volume {
|
||||
optional VolumeSource volumeSource = 2;
|
||||
}
|
||||
|
||||
// volumeDevice describes a mapping of a raw block device within a container.
|
||||
message VolumeDevice {
|
||||
// name must match the name of a persistentVolumeClaim in the pod
|
||||
optional string name = 1;
|
||||
|
||||
// devicePath is the path inside of the container that the device will be mapped to.
|
||||
optional string devicePath = 2;
|
||||
}
|
||||
|
||||
// VolumeMount describes a mounting of a Volume within a container.
|
||||
message VolumeMount {
|
||||
// This must match the Name of a Volume.
|
||||
|
||||
@@ -527,6 +527,11 @@ type PersistentVolumeSpec struct {
|
||||
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
|
||||
// +optional
|
||||
MountOptions []string `json:"mountOptions,omitempty" protobuf:"bytes,7,opt,name=mountOptions"`
|
||||
// volumeMode defines if a volume is intended to be used with a formatted filesystem
|
||||
// or to remain in raw block state. Value of Filesystem is implied when not included in spec.
|
||||
// This is an alpha feature and may change in the future.
|
||||
// +optional
|
||||
VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,8,opt,name=volumeMode,casttype=PersistentVolumeMode"`
|
||||
}
|
||||
|
||||
// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes.
|
||||
@@ -544,6 +549,16 @@ const (
|
||||
PersistentVolumeReclaimRetain PersistentVolumeReclaimPolicy = "Retain"
|
||||
)
|
||||
|
||||
// PersistentVolumeMode describes how a volume is intended to be consumed, either Block or Filesystem.
|
||||
type PersistentVolumeMode string
|
||||
|
||||
const (
|
||||
// PersistentVolumeBlock means the volume will not be formatted with a filesystem and will remain a raw block device.
|
||||
PersistentVolumeBlock PersistentVolumeMode = "Block"
|
||||
// PersistentVolumeFilesystem means the volume will be or is formatted with a filesystem.
|
||||
PersistentVolumeFilesystem PersistentVolumeMode = "Filesystem"
|
||||
)
|
||||
|
||||
// PersistentVolumeStatus is the current status of a persistent volume.
|
||||
type PersistentVolumeStatus struct {
|
||||
// Phase indicates if a volume is available, bound to a claim, or released by a claim.
|
||||
@@ -631,6 +646,11 @@ type PersistentVolumeClaimSpec struct {
|
||||
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
|
||||
// +optional
|
||||
StorageClassName *string `json:"storageClassName,omitempty" protobuf:"bytes,5,opt,name=storageClassName"`
|
||||
// volumeMode defines what type of volume is required by the claim.
|
||||
// Value of Filesystem is implied when not included in claim spec.
|
||||
// This is an alpha feature and may change in the future.
|
||||
// +optional
|
||||
VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,6,opt,name=volumeMode,casttype=PersistentVolumeMode"`
|
||||
}
|
||||
|
||||
// PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type
|
||||
@@ -1709,6 +1729,14 @@ const (
|
||||
MountPropagationBidirectional MountPropagationMode = "Bidirectional"
|
||||
)
|
||||
|
||||
// volumeDevice describes a mapping of a raw block device within a container.
|
||||
type VolumeDevice struct {
|
||||
// name must match the name of a persistentVolumeClaim in the pod
|
||||
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
||||
// devicePath is the path inside of the container that the device will be mapped to.
|
||||
DevicePath string `json:"devicePath" protobuf:"bytes,2,opt,name=devicePath"`
|
||||
}
|
||||
|
||||
// EnvVar represents an environment variable present in a Container.
|
||||
type EnvVar struct {
|
||||
// Name of the environment variable. Must be a C_IDENTIFIER.
|
||||
@@ -2052,6 +2080,12 @@ type Container struct {
|
||||
// +patchMergeKey=mountPath
|
||||
// +patchStrategy=merge
|
||||
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"`
|
||||
// volumeDevices is the list of block devices to be used by the container.
|
||||
// This is an alpha feature and may change in the future.
|
||||
// +patchMergeKey=devicePath
|
||||
// +patchStrategy=merge
|
||||
// +optional
|
||||
VolumeDevices []VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"`
|
||||
// Periodic probe of container liveness.
|
||||
// Container will be restarted if the probe fails.
|
||||
// Cannot be updated.
|
||||
|
||||
@@ -289,6 +289,7 @@ var map_Container = map[string]string{
|
||||
"env": "List of environment variables to set in the container. Cannot be updated.",
|
||||
"resources": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources",
|
||||
"volumeMounts": "Pod volumes to mount into the container's filesystem. Cannot be updated.",
|
||||
"volumeDevices": "volumeDevices is the list of block devices to be used by the container. This is an alpha feature and may change in the future.",
|
||||
"livenessProbe": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
|
||||
"readinessProbe": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
|
||||
"lifecycle": "Actions that the management system should take in response to container lifecycle events. Cannot be updated.",
|
||||
@@ -1162,6 +1163,7 @@ var map_PersistentVolumeClaimSpec = map[string]string{
|
||||
"resources": "Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources",
|
||||
"volumeName": "VolumeName is the binding reference to the PersistentVolume backing this claim.",
|
||||
"storageClassName": "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1",
|
||||
"volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is an alpha feature and may change in the future.",
|
||||
}
|
||||
|
||||
func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string {
|
||||
@@ -1238,6 +1240,7 @@ var map_PersistentVolumeSpec = map[string]string{
|
||||
"persistentVolumeReclaimPolicy": "What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming",
|
||||
"storageClassName": "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.",
|
||||
"mountOptions": "A list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options",
|
||||
"volumeMode": "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. This is an alpha feature and may change in the future.",
|
||||
}
|
||||
|
||||
func (PersistentVolumeSpec) SwaggerDoc() map[string]string {
|
||||
@@ -2077,6 +2080,16 @@ func (Volume) SwaggerDoc() map[string]string {
|
||||
return map_Volume
|
||||
}
|
||||
|
||||
var map_VolumeDevice = map[string]string{
|
||||
"": "volumeDevice describes a mapping of a raw block device within a container.",
|
||||
"name": "name must match the name of a persistentVolumeClaim in the pod",
|
||||
"devicePath": "devicePath is the path inside of the container that the device will be mapped to.",
|
||||
}
|
||||
|
||||
func (VolumeDevice) SwaggerDoc() map[string]string {
|
||||
return map_VolumeDevice
|
||||
}
|
||||
|
||||
var map_VolumeMount = map[string]string{
|
||||
"": "VolumeMount describes a mounting of a Volume within a container.",
|
||||
"name": "This must match the Name of a Volume.",
|
||||
|
||||
@@ -706,6 +706,11 @@ func (in *Container) DeepCopyInto(out *Container) {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.VolumeDevices != nil {
|
||||
in, out := &in.VolumeDevices, &out.VolumeDevices
|
||||
*out = make([]VolumeDevice, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.LivenessProbe != nil {
|
||||
in, out := &in.LivenessProbe, &out.LivenessProbe
|
||||
if *in == nil {
|
||||
@@ -2871,6 +2876,15 @@ func (in *PersistentVolumeClaimSpec) DeepCopyInto(out *PersistentVolumeClaimSpec
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.VolumeMode != nil {
|
||||
in, out := &in.VolumeMode, &out.VolumeMode
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(PersistentVolumeMode)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3213,6 +3227,15 @@ func (in *PersistentVolumeSpec) DeepCopyInto(out *PersistentVolumeSpec) {
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.VolumeMode != nil {
|
||||
in, out := &in.VolumeMode, &out.VolumeMode
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(PersistentVolumeMode)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -5322,6 +5345,22 @@ func (in *Volume) DeepCopy() *Volume {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeDevice) DeepCopyInto(out *VolumeDevice) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeDevice.
|
||||
func (in *VolumeDevice) DeepCopy() *VolumeDevice {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(VolumeDevice)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeMount) DeepCopyInto(out *VolumeMount) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user