diff --git a/build/dependencies.yaml b/build/dependencies.yaml index 080b470422b..62fe217b80c 100644 --- a/build/dependencies.yaml +++ b/build/dependencies.yaml @@ -50,12 +50,8 @@ dependencies: match: etcd_docker_tag|etcd_version - path: build/workspace.bzl match: ETCD_VERSION - - path: cluster/gce/manifests/etcd-empty-dir-cleanup.yaml - match: k8s.gcr.io/etcd-empty-dir-cleanup - path: cluster/gce/upgrade-aliases.sh match: ETCD_IMAGE|ETCD_VERSION - - path: cluster/images/etcd-empty-dir-cleanup/Makefile - match: ETCD_VERSION|TAG - path: cluster/images/etcd/Makefile match: BUNDLED_ETCD_VERSIONS\?|LATEST_ETCD_VERSION\? - path: cluster/images/etcd/migrate-if-needed.sh @@ -100,8 +96,6 @@ dependencies: match: BASEIMAGE\?\=us\.gcr\.io\/k8s-artifacts-prod\/build-image\/debian-base-ppc64le:v\d+\.\d+\.\d+ - path: cluster/images/etcd/Makefile match: BASEIMAGE\?\=us\.gcr\.io\/k8s-artifacts-prod\/build-image\/debian-base-s390x:v\d+\.\d+\.\d+ - - path: cluster/images/etcd-empty-dir-cleanup/Dockerfile - match: us\.gcr\.io\/k8s-artifacts-prod\/build-image\/debian-base:v\d+\.\d+\.\d+ - name: "k8s.gcr.io/debian-iptables" version: 12.1.0 diff --git a/build/lib/release.sh b/build/lib/release.sh index ec03f90dd49..dae9c21c8e5 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -434,7 +434,6 @@ function kube::release::package_kube_manifests_tarball() { cp "${src_dir}/kube-controller-manager.manifest" "${dst_dir}" cp "${src_dir}/kube-addon-manager.yaml" "${dst_dir}" cp "${src_dir}/glbc.manifest" "${dst_dir}" - cp "${src_dir}/etcd-empty-dir-cleanup.yaml" "${dst_dir}/" find "${src_dir}" -name 'internal-*' -exec cp {} "${dst_dir}" \; cp "${KUBE_ROOT}/cluster/gce/gci/configure-helper.sh" "${dst_dir}/gci-configure-helper.sh" cp "${KUBE_ROOT}/cluster/gce/gci/configure-kubeapiserver.sh" "${dst_dir}/configure-kubeapiserver.sh" diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index a9d0da9aa9f..c939362c06c 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -1682,11 +1682,6 @@ function prepare-etcd-manifest { mv "${temp_file}" /etc/kubernetes/manifests } -function start-etcd-empty-dir-cleanup-pod { - local -r src_file="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/etcd-empty-dir-cleanup.yaml" - cp "${src_file}" "/etc/kubernetes/manifests" -} - # Starts etcd server pod (and etcd-events pod if needed). # More specifically, it prepares dirs and files, sets the variable value # in the manifests, and copies them to /etc/kubernetes/manifests. @@ -2929,7 +2924,6 @@ function main() { compute-master-manifest-variables if [[ -z "${ETCD_SERVERS:-}" ]]; then start-etcd-servers - start-etcd-empty-dir-cleanup-pod fi source ${KUBE_BIN}/configure-kubeapiserver.sh start-kube-apiserver diff --git a/cluster/gce/manifests/BUILD b/cluster/gce/manifests/BUILD index 9c7379aa26b..0e6f7f5a51d 100644 --- a/cluster/gce/manifests/BUILD +++ b/cluster/gce/manifests/BUILD @@ -16,7 +16,6 @@ filegroup( "abac-authz-policy.jsonl", "cluster-autoscaler.manifest", "etcd.manifest", - "etcd-empty-dir-cleanup.yaml", "glbc.manifest", "konnectivity-server.yaml", "kube-addon-manager.yaml", diff --git a/cluster/gce/manifests/etcd-empty-dir-cleanup.yaml b/cluster/gce/manifests/etcd-empty-dir-cleanup.yaml deleted file mode 100644 index a1bc8f96464..00000000000 --- a/cluster/gce/manifests/etcd-empty-dir-cleanup.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: etcd-empty-dir-cleanup - namespace: kube-system - annotations: - seccomp.security.alpha.kubernetes.io/pod: 'docker/default' - labels: - k8s-app: etcd-empty-dir-cleanup -spec: - priorityClassName: system-node-critical - priority: 2000001000 - hostNetwork: true - dnsPolicy: Default - containers: - - name: etcd-empty-dir-cleanup - image: k8s.gcr.io/etcd-empty-dir-cleanup:3.4.7.0 diff --git a/cluster/images/etcd-empty-dir-cleanup/Dockerfile b/cluster/images/etcd-empty-dir-cleanup/Dockerfile deleted file mode 100644 index 37e2ebefb4e..00000000000 --- a/cluster/images/etcd-empty-dir-cleanup/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM us.gcr.io/k8s-artifacts-prod/build-image/debian-base:v2.1.0 - -COPY etcdctl etcd-empty-dir-cleanup.sh / -RUN chmod a+rx /etcdctl /etcd-empty-dir-cleanup.sh - -ENV ETCDCTL /etcdctl -ENV SLEEP_SECOND 3600 - -USER nobody:nogroup - -ENTRYPOINT ["/etcd-empty-dir-cleanup.sh"] diff --git a/cluster/images/etcd-empty-dir-cleanup/Makefile b/cluster/images/etcd-empty-dir-cleanup/Makefile deleted file mode 100644 index 9caa5494d76..00000000000 --- a/cluster/images/etcd-empty-dir-cleanup/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -.PHONY: build push - -ETCD_VERSION = 3.4.7 -# Image should be pulled from k8s.gcr.io, which will auto-detect -# region (us, eu, asia, ...) and pull from the closest. -REGISTRY = k8s.gcr.io -# Images should be pushed to staging-k8s.gcr.io. -PUSH_REGISTRY = staging-k8s.gcr.io -TAG = 3.4.7.1 - -clean: - rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz - -build: clean - curl -L -O https://github.com/coreos/etcd/releases/download/v$(ETCD_VERSION)/etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz - tar xzvf etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz - cp etcd-v$(ETCD_VERSION)-linux-amd64/etcdctl . - docker build --pull -t $(REGISTRY)/etcd-empty-dir-cleanup:$(TAG) . - rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz - -push: build - docker tag $(REGISTRY)/etcd-empty-dir-cleanup:$(TAG) $(PUSH_REGISTRY)/etcd-empty-dir-cleanup:$(TAG) - docker push $(PUSH_REGISTRY)/etcd-empty-dir-cleanup:$(TAG) diff --git a/cluster/images/etcd-empty-dir-cleanup/OWNERS b/cluster/images/etcd-empty-dir-cleanup/OWNERS deleted file mode 100644 index 3ea81fac109..00000000000 --- a/cluster/images/etcd-empty-dir-cleanup/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -labels: -- sig/api-machinery diff --git a/cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh b/cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh deleted file mode 100644 index 37da93f7e00..00000000000 --- a/cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -echo "Removing empty directories from etcd..." - -cleanup_empty_dirs () { - if [ "$("${ETCDCTL}" ls "${1}")" ]; then - for SUBDIR in $("${ETCDCTL}" ls -p "${1}" | grep "/$") - do - cleanup_empty_dirs "${SUBDIR}" - done - else - echo "Removing empty key $1 ..." - "${ETCDCTL}" rmdir "${1}" - fi -} - -while true -do - echo "Starting cleanup..." - cleanup_empty_dirs "/registry" - echo "Done with cleanup." - sleep "${SLEEP_SECOND}" -done