flag.StringVar(&context.Host,"host","","The host, or apiserver, to connect to")
flag.StringVar(&context.RepoRoot,"repo_root","./","Root directory of kubernetes repository, for finding test files. Default assumes working directory is repository root")
flag.StringVar(&context.Provider,"provider","","The name of the Kubernetes provider (gce, gke, local, vagrant, etc.)")
flag.StringVar(&gceConfig.MasterName,"kube_master","","Name of the kubernetes master. Only required if provider is gce or gke")
flag.StringVar(&gceConfig.ProjectID,"gce_project","","The GCE project being used, if applicable")
flag.StringVar(&gceConfig.Zone,"gce_zone","","GCE zone being used, if applicable")
...
...
@@ -63,5 +67,23 @@ func main() {
glog.Error("Invalid --times (negative or no testing requested)!")
// Source represents the location and type of a volume to mount.
// This is optional for now. If not specified, the Volume is implied to be an EmptyDir.
// This implied behavior is deprecated and will be removed in a future version.
SourceVolumeSource`json:"source,omitempty" description:"location and type of volume to mount; at most one of HostDir, EmptyDir, GCEPersistentDisk, or GitRepo; default is EmptyDir"`
SourceVolumeSource`json:"source,omitempty" description:"location and type of volume to mount; at most one of HostDir, EmptyDir, GCEPersistentDisk, AWSPersistentDisk, or GitRepo; default is EmptyDir"`
}
// VolumeSource represents the source location of a volume to mount.
...
...
@@ -105,6 +105,9 @@ type VolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk*GCEPersistentDiskVolumeSource`json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"`
// AWSPersistentDisk represents a AWS Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
AWSPersistentDisk*AWSPersistentDiskVolumeSource`json:"awsPersistentDisk" description:"AWS disk resource attached to the host machine on demand"`
// GitRepo represents a git repository at a particular revision.
GitRepo*GitRepoVolumeSource`json:"gitRepo" description:"git repository at a particular revision"`
// Secret represents a secret to populate the volume with
...
...
@@ -124,6 +127,9 @@ type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk*GCEPersistentDiskVolumeSource`json:"persistentDisk" description:"GCE disk resource provisioned by an admin"`
// AWSPersistentDisk represents a AWS EBS volume that is attached to a
// kubelet's host machine and then exposed to the pod.
AWSPersistentDisk*AWSPersistentDiskVolumeSource`json:"awsPersistentDisk" description:"AWS disk resource provisioned by an admin"`
// HostPath represents a directory on the host.
// This is useful for development and testing only.
// on-host storage is not supported in any way.
...
...
@@ -302,6 +308,29 @@ type ISCSIVolumeSource struct {
ReadOnlybool`json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"`
}
// AWSPersistentDiskVolumeSource represents a Persistent Disk resource in AWS.
//
// An AWS PD must exist and be formatted before mounting to a container.
// The disk must also be in the same AWS zone as the kubelet.
// A AWS PD can only be mounted on a single machine.
typeAWSPersistentDiskVolumeSourcestruct{
// Unique name of the PD resource. Used to identify the disk in AWS
PDNamestring`json:"pdName" description:"unique id of the PD resource in AWS"`
// Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs"
// TODO: how do we prevent errors in the filesystem from compromising the machine
// TODO: why omitempty if required?
FSTypestring`json:"fsType,omitempty" description:"file system type to mount, such as ext4, xfs, ntfs"`
// Optional: Partition on the disk to mount.
// If omitted, kubelet will attempt to mount the device name.
// Ex. For /dev/sda1, this field is "1", for /dev/sda, this field 0 or empty.
Partitionint`json:"partition,omitempty" description:"partition on the disk to mount (e.g., '1' for /dev/sda1); if omitted the plain device name (e.g., /dev/sda) will be mounted"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
ReadOnlybool`json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"`
}
// GitRepoVolumeSource represents a volume that is pulled from git when the pod is created.
// Source represents the location and type of a volume to mount.
// This is optional for now. If not specified, the Volume is implied to be an EmptyDir.
// This implied behavior is deprecated and will be removed in a future version.
SourceVolumeSource`json:"source,omitempty" description:"location and type of volume to mount; at most one of HostDir, EmptyDir, GCEPersistentDisk, or GitRepo; default is EmptyDir"`
SourceVolumeSource`json:"source,omitempty" description:"location and type of volume to mount; at most one of HostDir, EmptyDir, GCEPersistentDisk, AWSPersistentDisk, or GitRepo; default is EmptyDir"`
}
// VolumeSource represents the source location of a volume to mount.
...
...
@@ -74,6 +74,9 @@ type VolumeSource struct {
// A persistent disk that is mounted to the
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk*GCEPersistentDiskVolumeSource`json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"`
// An AWS persistent disk that is mounted to the
// kubelet's host machine and then exposed to the pod.
AWSPersistentDisk*AWSPersistentDiskVolumeSource`json:"awsPersistentDisk" description:"AWS disk resource attached to the host machine on demand"`
// GitRepo represents a git repository at a particular revision.
GitRepo*GitRepoVolumeSource`json:"gitRepo" description:"git repository at a particular revision"`
// Secret is a secret to populate the volume with
...
...
@@ -93,6 +96,9 @@ type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk*GCEPersistentDiskVolumeSource`json:"persistentDisk" description:"GCE disk resource provisioned by an admin"`
// AWSPersistentDisk represents a AWS Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
AWSPersistentDisk*AWSPersistentDiskVolumeSource`json:"awsPersistentDisk" description:"AWS disk resource provisioned by an admin"`
// HostPath represents a directory on the host.
// This is useful for development and testing only.
// on-host storage is not supported in any way.
...
...
@@ -284,6 +290,29 @@ type GCEPersistentDiskVolumeSource struct {
ReadOnlybool`json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"`
}
// AWSPersistentDiskVolumeSource represents a Persistent Disk resource in AWS.
//
// An AWS PD must exist and be formatted before mounting to a container.
// The disk must also be in the same AWS zone as the kubelet.
// A AWS PD can only be mounted on a single machine.
typeAWSPersistentDiskVolumeSourcestruct{
// Unique name of the PD resource. Used to identify the disk in AWS
PDNamestring`json:"pdName" description:"unique id of the PD resource in AWS"`
// Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs"
// TODO: how do we prevent errors in the filesystem from compromising the machine
// TODO: why omitempty if required?
FSTypestring`json:"fsType,omitempty" description:"file system type to mount, such as ext4, xfs, ntfs"`
// Optional: Partition on the disk to mount.
// If omitted, kubelet will attempt to mount the device name.
// Ex. For /dev/sda1, this field is "1", for /dev/sda, this field 0 or empty.
Partitionint`json:"partition,omitempty" description:"partition on the disk to mount (e.g., '1' for /dev/sda1); if omitted the plain device name (e.g., /dev/sda) will be mounted"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
ReadOnlybool`json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"`
}
// GitRepoVolumeSource represents a volume that is pulled from git when the pod is created.
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk*GCEPersistentDiskVolumeSource`json:"gcePersistentDisk" description:"GCE disk resource attached to the host machine on demand"`
// AWSPersistentDisk represents a AWS Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
AWSPersistentDisk*AWSPersistentDiskVolumeSource`json:"awsPersistentDisk" description:"AWS disk resource attached to the host machine on demand"`
// GitRepo represents a git repository at a particular revision.
GitRepo*GitRepoVolumeSource`json:"gitRepo" description:"git repository at a particular revision"`
// Secret represents a secret that should populate this volume.
...
...
@@ -225,6 +228,9 @@ type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk*GCEPersistentDiskVolumeSource`json:"gcePersistentDisk" description:"GCE disk resource provisioned by an admin"`
// AWSPersistentDisk represents a AWS Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
AWSPersistentDisk*AWSPersistentDiskVolumeSource`json:"awsPersistentDisk" description:"AWS disk resource provisioned by an admin"`
// HostPath represents a directory on the host.
// This is useful for development and testing only.
// on-host storage is not supported in any way.
...
...
@@ -400,6 +406,29 @@ type GCEPersistentDiskVolumeSource struct {
ReadOnlybool`json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"`
}
// AWSPersistentDiskVolumeSource represents a Persistent Disk resource in AWS.
//
// An AWS PD must exist and be formatted before mounting to a container.
// The disk must also be in the same AWS zone as the kubelet.
// A AWS PD can only be mounted on a single machine.
typeAWSPersistentDiskVolumeSourcestruct{
// Unique name of the PD resource. Used to identify the disk in AWS
PDNamestring`json:"pdName" description:"unique id of the PD resource in AWS"`
// Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs"
// TODO: how do we prevent errors in the filesystem from compromising the machine
// TODO: why omitempty if required?
FSTypestring`json:"fsType,omitempty" description:"file system type to mount, such as ext4, xfs, ntfs"`
// Optional: Partition on the disk to mount.
// If omitted, kubelet will attempt to mount the device name.
// Ex. For /dev/sda1, this field is "1", for /dev/sda, this field 0 or empty.
Partitionint`json:"partition,omitempty" description:"partition on the disk to mount (e.g., '1' for /dev/sda1); if omitted the plain device name (e.g., /dev/sda) will be mounted"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
ReadOnlybool`json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"`
}
// GitRepoVolumeSource represents a volume that is pulled from git when the pod is created.
allErrs=append(allErrs,errs.NewFieldInvalid("GCEPersistentDisk.ReadOnly",false,"ReadOnly must be true for replicated pods > 1, as GCE PD can only be mounted on multiple machines if it is read-only."))
}
}
// TODO: What to do for AWS? It doesn't support replicas