NFSMount storage plugin for kubelet.

* If you want to test this out when an actual NFS export a good place
 to start is by running the NFS server in a container:

docker run -d --name nfs --privileged cpuguy83/nfs-server /tmp

More detail can be found here:
https://github.com/cpuguy83/docker-nfs-server
This commit is contained in:
Chris Alfonso
2015-02-10 14:00:11 -05:00
parent d845d49dc6
commit 1a45e37d17
14 changed files with 524 additions and 1 deletions

View File

@@ -982,6 +982,9 @@ func init() {
if err := s.Convert(&in.Secret, &out.Secret, 0); err != nil {
return err
}
if err := s.Convert(&in.NFS, &out.NFS, 0); err != nil {
return err
}
return nil
},
func(in *VolumeSource, out *newer.VolumeSource, s conversion.Scope) error {
@@ -1000,6 +1003,9 @@ func init() {
if err := s.Convert(&in.Secret, &out.Secret, 0); err != nil {
return err
}
if err := s.Convert(&in.NFS, &out.NFS, 0); err != nil {
return err
}
return nil
},

View File

@@ -78,6 +78,8 @@ type VolumeSource struct {
GitRepo *GitRepoVolumeSource `json:"gitRepo" description:"git repository at a particular revision"`
// Secret is a secret to populate the volume with
Secret *SecretVolumeSource `json:"secret" description:"secret to populate volume"`
// NFS represents an NFS mount on the host that shares a pod's lifetime
NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine"`
}
// HostPathVolumeSource represents bare host directory volume.
@@ -1215,6 +1217,19 @@ type ResourceQuotaList struct {
Items []ResourceQuota `json:"items" description:"items is a list of ResourceQuota objects"`
}
// NFSVolumeSource represents an NFS mount that lasts the lifetime of a pod
type NFSVolumeSource struct {
// Server is the hostname or IP address of the NFS server
Server string `json:"server" description:"the hostname or IP address of the NFS server"`
// Path is the exported NFS share
Path string `json:"path" description:"the path that is exported by the NFS server"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the NFS export to be mounted with read-only permissions
ReadOnly bool `json:"readOnly,omitempty" description:"forces the NFS export to be mounted with read-only permissions"`
}
// Secret holds secret data of a certain type. The total bytes of the values in
// the Data field must be less than MaxSecretSize bytes.
//