• Kubernetes Submit Queue's avatar
    Merge pull request #42755 from aveshagarwal/master-fix-default-toleration-seconds · 8cb14a4f
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 41794, 42349, 42755, 42901, 42933)
    
    Fix DefaultTolerationSeconds admission plugin
    
    DefaultTolerationSeconds is not working as expected. It is supposed to add default tolerations (for unreachable and notready conditions). but no pod was getting these toleration. And api server was throwing this error:
    
    ```
    Mar 08 13:43:57 fedora25 hyperkube[32070]: E0308 13:43:57.769212   32070 admission.go:71] expected pod but got Pod
    Mar 08 13:43:57 fedora25 hyperkube[32070]: E0308 13:43:57.789055   32070 admission.go:71] expected pod but got Pod
    Mar 08 13:44:02 fedora25 hyperkube[32070]: E0308 13:44:02.006784   32070 admission.go:71] expected pod but got Pod
    Mar 08 13:45:39 fedora25 hyperkube[32070]: E0308 13:45:39.754669   32070 admission.go:71] expected pod but got Pod
    Mar 08 14:48:16 fedora25 hyperkube[32070]: E0308 14:48:16.673181   32070 admission.go:71] expected pod but got Pod
    ```
    
    The reason for this error is that the input to admission plugins is internal api objects not versioned objects so expecting versioned object is incorrect. Due to this, no pod got desired tolerations and it always showed:
    
    ```
    Tolerations: <none>
    ```
    
    After this fix, the correct  tolerations are being assigned to pods as follows:
    
    ```
    Tolerations:	node.alpha.kubernetes.io/notReady=:Exists:NoExecute for 300s
    		node.alpha.kubernetes.io/unreachable=:Exists:NoExecute for 300s
    ```
    
    @davidopp @kevin-wangzefeng @kubernetes/sig-scheduling-pr-reviews @kubernetes/sig-scheduling-bugs @derekwaynecarr 
    
    Fixes https://github.com/kubernetes/kubernetes/issues/42716
    8cb14a4f
Name
Last commit
Last update
..
annotations Loading commit data...
endpoints Loading commit data...
errors Loading commit data...
events Loading commit data...
install Loading commit data...
meta Loading commit data...
pod Loading commit data...
resource Loading commit data...
service Loading commit data...
testapi Loading commit data...
testing Loading commit data...
unversioned Loading commit data...
util Loading commit data...
v1 Loading commit data...
validation Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
conversion_test.go Loading commit data...
copy_test.go Loading commit data...
deep_copy_test.go Loading commit data...
defaulting_test.go Loading commit data...
defaults.go Loading commit data...
doc.go Loading commit data...
field_constants.go Loading commit data...
helpers.go Loading commit data...
helpers_test.go Loading commit data...
json.go Loading commit data...
meta_test.go Loading commit data...
node_example.json Loading commit data...
ref.go Loading commit data...
ref_test.go Loading commit data...
register.go Loading commit data...
replication_controller_example.json Loading commit data...
resource_helpers.go Loading commit data...
resource_helpers_test.go Loading commit data...
serialization_proto_test.go Loading commit data...
serialization_test.go Loading commit data...
types.go Loading commit data...
unstructured_test.go Loading commit data...
zz_generated.deepcopy.go Loading commit data...