Skip to content

Commit

Permalink
Merge pull request #4742 from justinsb/mount_xtables_lockfile
Browse files Browse the repository at this point in the history
Mount the iptables lock file
  • Loading branch information
k8s-ci-robot authored Mar 21, 2018
2 parents efcae92 + e93d88e commit 5c7f974
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nodeup/pkg/model/kube_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) {
addHostPathMapping(pod, container, "etchosts", "/etc/hosts")
}

// Mount the iptables lock file
if b.IsKubernetesGTE("1.9") {
addHostPathMapping(pod, container, "iptableslock", "/run/xtables.lock").ReadOnly = false

vol := pod.Spec.Volumes[len(pod.Spec.Volumes)-1]
if vol.Name != "iptableslock" {
// Sanity check
glog.Fatalf("expected volume to be last volume added")
}
hostPathType := v1.HostPathFileOrCreate
vol.HostPath.Type = &hostPathType
}

pod.Spec.Containers = append(pod.Spec.Containers, *container)

// Note that e.g. kubeadm has this as a daemonset, but this doesn't have a lot of test coverage AFAICT
Expand Down

0 comments on commit 5c7f974

Please sign in to comment.