Production-Grade Container Scheduling and Management
Go to file
Kubernetes Submit Queue 2cb5c47b12
Merge pull request #64351 from msau42/fix-readonly
Automatic merge from submit-queue (batch tested with PRs 62266, 64351, 64366, 64235, 64560). 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>.

Bind mount subpath with same read/write settings as underlying volume

**What this PR does / why we need it**:
https://github.com/kubernetes/kubernetes/pull/63045 broke two scenarios:
* If volumeMount path already exists in container image, container runtime will try to chown the volume
* In SELinux system, we will try to set SELinux labels when starting the container

This fix makes it so that the subpath bind mount will inherit the read/write settings of the underlying volume mount. It does this by using the "bind,remount" mount options when doing the bind mount.

The underlying volume mount is ro when the volumeSource.readOnly flag is set. This is for persistent volume types like PVC, GCE PD, NFS, etc.  When this is set, we won't try to configure SELinux labels.  Also in this mode, subpaths have to already exist in the volume, we cannot make new directories on a read only volume.

When volumeMount.readOnly is set, the container runtime is in charge of making the volume in the container readOnly, but the underlying volume mount on the host can be writable. This can be set for any volume type, and is permanently set for atomic volume types like configmaps, secrets.  In this case, SELinux labels will be applied before the container runtime makes the volume readOnly.  And subpaths don't have to exist.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #64120

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixes issue for readOnly subpath mounts for SELinux systems and when the volume mountPath already existed in the container image.
```
2018-06-04 18:44:13 -07:00
.github
api Introduce priority class in the resource quota 2018-06-04 16:14:54 -04:00
build Revert "Remove rescheduler and corresponding tests from master" 2018-05-31 22:18:49 -04:00
cluster Merge pull request #64592 from ravisantoshgudimetla/revert-64364-remove-rescheduler 2018-06-04 16:56:11 -07:00
cmd Merge pull request #64661 from liggitt/hostname-override 2018-06-04 16:56:22 -07:00
docs Introduce priority class in the resource quota 2018-06-04 16:14:54 -04:00
Godeps Replace openapi Fake with kube-openapi version 2018-06-01 09:50:05 -07:00
hack Merge pull request #61610 from rajansandeep/kubeupaddon 2018-06-04 12:26:12 -07:00
logo
pkg Merge pull request #64351 from msau42/fix-readonly 2018-06-04 18:44:13 -07:00
plugin Merge pull request #57963 from vikaschoudhary16/priorityclass 2018-06-04 15:11:00 -07:00
staging Merge pull request #64482 from ericchiang/exec-plugin-beta 2018-06-04 16:56:15 -07:00
test Merge pull request #64351 from msau42/fix-readonly 2018-06-04 18:44:13 -07:00
third_party
translations
vendor Replace openapi Fake with kube-openapi version 2018-06-01 09:50:05 -07:00
.bazelrc
.generated_files
.gitattributes
.gitignore
.kazelcfg.json
BUILD.bazel
CHANGELOG-1.2.md
CHANGELOG-1.3.md
CHANGELOG-1.4.md
CHANGELOG-1.5.md
CHANGELOG-1.6.md
CHANGELOG-1.7.md
CHANGELOG-1.8.md
CHANGELOG-1.9.md
CHANGELOG-1.10.md
CHANGELOG-1.11.md Update CHANGELOG-1.11.md for v1.11.0-beta.1. 2018-06-01 00:34:55 +00:00
CHANGELOG.md
code-of-conduct.md
CONTRIBUTING.md
labels.yaml
LICENSE
Makefile
Makefile.generated_files
OWNERS
OWNERS_ALIASES Add tallclair to milestone maintainers 2018-05-31 12:54:00 -07:00
README.md
SECURITY_CONTACTS
SUPPORT.md
WORKSPACE

Kubernetes

Submit Queue Widget GoDoc Widget CII Best Practices


Kubernetes is an open source system for managing containerized applications across multiple hosts; providing basic mechanisms for deployment, maintenance, and scaling of applications.

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.

Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF). If you are a company that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details about who's involved and how Kubernetes plays a role, read the CNCF announcement.


To start using Kubernetes

See our documentation on kubernetes.io.

Try our interactive tutorial.

Take a free course on Scalable Microservices with Kubernetes.

To start developing Kubernetes

The community repository hosts all information about building Kubernetes from source, how to contribute code and documentation, who to contact about what, etc.

If you want to build Kubernetes right away there are two options:

You have a working Go environment.
$ go get -d k8s.io/kubernetes
$ cd $GOPATH/src/k8s.io/kubernetes
$ make
You have a working Docker environment.
$ git clone https://github.com/kubernetes/kubernetes
$ cd kubernetes
$ make quick-release

For the full story, head over to the developer's documentation.

Support

If you need support, start with the troubleshooting guide, and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another.

Analytics