Skip to content

Commit

Permalink
Dedicated volume API
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxuzhonghu committed Feb 19, 2020
1 parent a4f51ee commit 8980d6a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/apis/batch/v1alpha1/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ type VolumeSpec struct {
// defined the PVC name
VolumeClaimName string `json:"volumeClaimName,omitempty" protobuf:"bytes,2,opt,name=volumeClaimName"`

// Note: GenerateName can be set for task scoped volume.
// If `VolumeClaimName` is empty, then the job controller will
// generate a name with `{task_index}` suffixed for each pod of the task.
GenerateName string `json:"generateName,omitempty" protobuf:"bytes,4,opt,name=generateName"`

// VolumeClaim defines the PVC used by the VolumeMount.
VolumeClaim *v1.PersistentVolumeClaimSpec `json:"volumeClaim,omitempty" protobuf:"bytes,3,opt,name=volumeClaim"`
}
Expand Down Expand Up @@ -164,6 +169,12 @@ type TaskSpec struct {
// Specifies the lifecycle of task
// +optional
Policies []LifecyclePolicy `json:"policies,omitempty" protobuf:"bytes,4,opt,name=policies"`

// The volumes mount on pods of the Task
// Depends on the `VolumeSpec.GenerateName`, they can be dedicated or shared.
// If `VolumeSpec.GenerateName` is specified and `VolumeSpec.VolumeClaimName` is empty,
// the Job controller will generate a dedicated PVC for each pod.
Volumes []VolumeSpec `json:"volumes,omitempty" protobuf:"bytes,5,opt,name=volumes"`
}

// JobPhase defines the phase of the job
Expand Down

0 comments on commit 8980d6a

Please sign in to comment.