FEATURE: Support privileged containers in a pod

Add a Privileged field to containers in a pod, in order to facilitate pods
performing administrative tasks such as builds via Docker-in-Docker.

Discussion: https://github.com/GoogleCloudPlatform/kubernetes/issues/391
pull/6/head
Dan Mace 2014-08-12 09:04:00 -04:00 committed by Brendan Burns
parent 9b6042ea2c
commit 3a3fab3f82
3 changed files with 5 additions and 0 deletions

View File

@ -195,6 +195,8 @@ type Container struct {
VolumeMounts []VolumeMount `yaml:"volumeMounts,omitempty" json:"volumeMounts,omitempty"`
LivenessProbe *LivenessProbe `yaml:"livenessProbe,omitempty" json:"livenessProbe,omitempty"`
Lifecycle *Lifecycle `yaml:"lifecycle,omitempty" json:"lifecycle,omitempty"`
// Optional: Default to false.
Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"`
}
// Handler defines a specific action that should be taken

View File

@ -205,6 +205,8 @@ type Container struct {
VolumeMounts []VolumeMount `yaml:"volumeMounts,omitempty" json:"volumeMounts,omitempty"`
LivenessProbe *LivenessProbe `yaml:"livenessProbe,omitempty" json:"livenessProbe,omitempty"`
Lifecycle *Lifecycle `yaml:"lifecycle,omitempty" json:"lifecycle,omitempty"`
// Optional: Default to false.
Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"`
}
// Handler defines a specific action that should be taken

View File

@ -339,6 +339,7 @@ func (kl *Kubelet) runContainer(pod *Pod, container *api.Container, podVolumes v
PortBindings: portBindings,
Binds: binds,
NetworkMode: netMode,
Privileged: container.Privileged,
})
if err == nil && container.Lifecycle != nil && container.Lifecycle.PostStart != nil {
handlerErr := kl.runHandler(GetPodFullName(pod), pod.Manifest.UUID, container, container.Lifecycle.PostStart)