kubernetes/pkg/volume
Clayton Coleman 3eadd1a9ea
Keep pod worker running until pod is truly complete
A number of race conditions exist when pods are terminated early in
their lifecycle because components in the kubelet need to know "no
running containers" or "containers can't be started from now on" but
were relying on outdated state.

Only the pod worker knows whether containers are being started for
a given pod, which is required to know when a pod is "terminated"
(no running containers, none coming). Move that responsibility and
podKiller function into the pod workers, and have everything that
was killing the pod go into the UpdatePod loop. Split syncPod into
three phases - setup, terminate containers, and cleanup pod - and
have transitions between those methods be visible to other
components. After this change, to kill a pod you tell the pod worker
to UpdatePod({UpdateType: SyncPodKill, Pod: pod}).

Several places in the kubelet were incorrect about whether they
were handling terminating (should stop running, might have
containers) or terminated (no running containers) pods. The pod worker
exposes methods that allow other loops to know when to set up or tear
down resources based on the state of the pod - these methods remove
the possibility of race conditions by ensuring a single component is
responsible for knowing each pod's allowed state and other components
simply delegate to checking whether they are in the window by UID.

Removing containers now no longer blocks final pod deletion in the
API server and are handled as background cleanup. Node shutdown
no longer marks pods as failed as they can be restarted in the
next step.

See https://docs.google.com/document/d/1Pic5TPntdJnYfIpBeZndDelM-AbS4FN9H2GTLFhoJ04/edit# for details
2021-07-06 15:55:22 -04:00
..
awsebs Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
azure_file Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
azuredd Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
cephfs Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
cinder Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
configmap Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
csi Map PV access modes to CSI access modes 2021-06-28 21:25:38 -07:00
csimigration Remove CSIMigrationVSphereComplete flag 2021-05-04 21:38:47 -07:00
downwardapi Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
emptydir Merge pull request #100746 from mengjiao-liu/fix-nil-call 2021-05-26 14:49:38 -07:00
fc Merge pull request #102059 from jsafrane/fix-consistentread 2021-06-03 21:59:37 -07:00
flexvolume remove fakefs to drop spf13/afero dependency 2021-06-24 09:51:34 -04:00
flocker Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
gcepd Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
git_repo Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
glusterfs Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
hostpath hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
iscsi Merge pull request #102059 from jsafrane/fix-consistentread 2021-06-03 21:59:37 -07:00
local Add SupportsMetrics() for Block-mode volumes 2021-05-20 17:10:23 +02:00
nfs Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
portworx Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
projected Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
quobyte Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
rbd Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
secret Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
storageos Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
testing Merge pull request #101115 from wangyx1992/capital-log 2021-05-06 03:51:16 -07:00
util Keep pod worker running until pod is truly complete 2021-07-06 15:55:22 -04:00
validation hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
vsphere_volume Rename access mode contains helper method 2021-06-28 21:24:56 -07:00
doc.go
metrics_block_test.go The test was not very useful and required elevated access 2021-06-04 15:48:35 -04:00
metrics_block.go Add helper functions for Block volume Capacity detection 2021-05-20 16:37:12 +02:00
metrics_cached.go
metrics_du_test.go Add test for counting inodes correct with hardlinks 2021-04-06 14:19:35 +02:00
metrics_du.go Get inodes and disk usage via pure go 2021-04-06 14:19:35 +02:00
metrics_errors.go Add helper functions for Block volume Capacity detection 2021-05-20 16:37:12 +02:00
metrics_nil_test.go Add SupportsMetrics() for Block-mode volumes 2021-05-20 17:10:23 +02:00
metrics_nil.go Add SupportsMetrics() for Block-mode volumes 2021-05-20 17:10:23 +02:00
metrics_statfs_test.go
metrics_statfs.go fix golint in volume fs 2021-01-12 06:35:52 +08:00
noop_expandable_plugin.go plumb service account token down to csi driver 2020-11-12 09:26:43 -08:00
OWNERS Add SIG storage owner aliases 2020-07-07 10:26:16 -04:00
plugins_test.go Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
plugins.go Merge pull request #101510 from huchengze/patch-12 2021-05-20 21:14:57 -07:00
volume_linux_test.go volume: Add unit test for SetVolumeOwnership owners 2020-11-11 09:23:16 -05:00
volume_linux.go migrate log in pkg/volume/volume_linux.go 2021-03-11 09:16:03 +08:00
volume_unsupported.go Fix typecheck 2021-02-15 00:22:04 -08:00
volume.go Add SupportsMetrics() for Block-mode volumes 2021-05-20 17:10:23 +02:00