Remove docker-prestart hook

This breaks networking if Docker is restarted
(https://github.com/kubernetes/kops/issues/6191).

The Docker issue linked in the hook's comments has been closed for
over 3 years, and this workaround has not been used by upstream
Kubernetes for over a year:

  5f9735de53 (diff-af1d281c3ce49f7bfe110f7c64c96fdc)

It therefore seems unlikely that this hook is still necessary.
This commit is contained in:
Steven McDonald 2019-03-01 13:43:38 +01:00
parent 8c63970c5b
commit fe249eabbf
6 changed files with 0 additions and 36 deletions

View File

@ -925,7 +925,6 @@ func (b *DockerBuilder) buildSystemdSocket() *nodetasks.Service {
func (b *DockerBuilder) buildSystemdService(dockerVersionMajor int64, dockerVersionMinor int64) *nodetasks.Service {
oldDocker := dockerVersionMajor <= 1 && dockerVersionMinor <= 11
usesDockerSocket := true
hasDockerBabysitter := false
var dockerdCommand string
if oldDocker {
@ -934,10 +933,6 @@ func (b *DockerBuilder) buildSystemdService(dockerVersionMajor int64, dockerVers
dockerdCommand = "/usr/bin/dockerd"
}
if b.Distribution.IsDebianFamily() {
hasDockerBabysitter = true
}
manifest := &systemd.Manifest{}
manifest.Set("Unit", "Description", "Docker Application Container Engine")
manifest.Set("Unit", "Documentation", "https://docs.docker.com")
@ -1005,10 +1000,6 @@ func (b *DockerBuilder) buildSystemdService(dockerVersionMajor int64, dockerVers
// set delegate yes so that systemd does not reset the cgroups of docker containers
manifest.Set("Service", "Delegate", "yes")
if hasDockerBabysitter {
manifest.Set("Service", "ExecStartPre", "/opt/kubernetes/helpers/docker-prestart")
}
manifest.Set("Install", "WantedBy", "multi-user.target")
manifestString := manifest.Render()

View File

@ -248,7 +248,6 @@ definition: |
RestartSec=2s
StartLimitInterval=0
Delegate=yes
ExecStartPre=/opt/kubernetes/helpers/docker-prestart
[Install]
WantedBy=multi-user.target

View File

@ -248,7 +248,6 @@ definition: |
RestartSec=2s
StartLimitInterval=0
Delegate=yes
ExecStartPre=/opt/kubernetes/helpers/docker-prestart
[Install]
WantedBy=multi-user.target

View File

@ -248,7 +248,6 @@ definition: |
RestartSec=2s
StartLimitInterval=0
Delegate=yes
ExecStartPre=/opt/kubernetes/helpers/docker-prestart
[Install]
WantedBy=multi-user.target

View File

@ -1,21 +0,0 @@
#!/bin/bash
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script is intended to be run before we start Docker.
# cleanup docker network checkpoint to avoid running into known issue
# of docker (https://github.com/docker/docker/issues/18283)
rm -rf /var/lib/docker/network