mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #91756 from wojtek-t/remove_etcd_empty_dir_cleanup
Remove etcd-empty-dir-cleanup image
This commit is contained in:
commit
db152fdd7d
@ -50,12 +50,8 @@ dependencies:
|
|||||||
match: etcd_docker_tag|etcd_version
|
match: etcd_docker_tag|etcd_version
|
||||||
- path: build/workspace.bzl
|
- path: build/workspace.bzl
|
||||||
match: ETCD_VERSION
|
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
|
- path: cluster/gce/upgrade-aliases.sh
|
||||||
match: ETCD_IMAGE|ETCD_VERSION
|
match: ETCD_IMAGE|ETCD_VERSION
|
||||||
- path: cluster/images/etcd-empty-dir-cleanup/Makefile
|
|
||||||
match: ETCD_VERSION|TAG
|
|
||||||
- path: cluster/images/etcd/Makefile
|
- path: cluster/images/etcd/Makefile
|
||||||
match: BUNDLED_ETCD_VERSIONS\?|LATEST_ETCD_VERSION\?
|
match: BUNDLED_ETCD_VERSIONS\?|LATEST_ETCD_VERSION\?
|
||||||
- path: cluster/images/etcd/migrate-if-needed.sh
|
- 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+
|
match: BASEIMAGE\?\=us\.gcr\.io\/k8s-artifacts-prod\/build-image\/debian-base-ppc64le:v\d+\.\d+\.\d+
|
||||||
- path: cluster/images/etcd/Makefile
|
- path: cluster/images/etcd/Makefile
|
||||||
match: BASEIMAGE\?\=us\.gcr\.io\/k8s-artifacts-prod\/build-image\/debian-base-s390x:v\d+\.\d+\.\d+
|
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"
|
- name: "k8s.gcr.io/debian-iptables"
|
||||||
version: 12.1.0
|
version: 12.1.0
|
||||||
|
@ -434,7 +434,6 @@ function kube::release::package_kube_manifests_tarball() {
|
|||||||
cp "${src_dir}/kube-controller-manager.manifest" "${dst_dir}"
|
cp "${src_dir}/kube-controller-manager.manifest" "${dst_dir}"
|
||||||
cp "${src_dir}/kube-addon-manager.yaml" "${dst_dir}"
|
cp "${src_dir}/kube-addon-manager.yaml" "${dst_dir}"
|
||||||
cp "${src_dir}/glbc.manifest" "${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}" \;
|
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-helper.sh" "${dst_dir}/gci-configure-helper.sh"
|
||||||
cp "${KUBE_ROOT}/cluster/gce/gci/configure-kubeapiserver.sh" "${dst_dir}/configure-kubeapiserver.sh"
|
cp "${KUBE_ROOT}/cluster/gce/gci/configure-kubeapiserver.sh" "${dst_dir}/configure-kubeapiserver.sh"
|
||||||
|
@ -1682,11 +1682,6 @@ function prepare-etcd-manifest {
|
|||||||
mv "${temp_file}" /etc/kubernetes/manifests
|
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).
|
# Starts etcd server pod (and etcd-events pod if needed).
|
||||||
# More specifically, it prepares dirs and files, sets the variable value
|
# More specifically, it prepares dirs and files, sets the variable value
|
||||||
# in the manifests, and copies them to /etc/kubernetes/manifests.
|
# in the manifests, and copies them to /etc/kubernetes/manifests.
|
||||||
@ -2929,7 +2924,6 @@ function main() {
|
|||||||
compute-master-manifest-variables
|
compute-master-manifest-variables
|
||||||
if [[ -z "${ETCD_SERVERS:-}" ]]; then
|
if [[ -z "${ETCD_SERVERS:-}" ]]; then
|
||||||
start-etcd-servers
|
start-etcd-servers
|
||||||
start-etcd-empty-dir-cleanup-pod
|
|
||||||
fi
|
fi
|
||||||
source ${KUBE_BIN}/configure-kubeapiserver.sh
|
source ${KUBE_BIN}/configure-kubeapiserver.sh
|
||||||
start-kube-apiserver
|
start-kube-apiserver
|
||||||
|
@ -16,7 +16,6 @@ filegroup(
|
|||||||
"abac-authz-policy.jsonl",
|
"abac-authz-policy.jsonl",
|
||||||
"cluster-autoscaler.manifest",
|
"cluster-autoscaler.manifest",
|
||||||
"etcd.manifest",
|
"etcd.manifest",
|
||||||
"etcd-empty-dir-cleanup.yaml",
|
|
||||||
"glbc.manifest",
|
"glbc.manifest",
|
||||||
"konnectivity-server.yaml",
|
"konnectivity-server.yaml",
|
||||||
"kube-addon-manager.yaml",
|
"kube-addon-manager.yaml",
|
||||||
|
@ -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
|
|
@ -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"]
|
|
@ -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)
|
|
@ -1,4 +0,0 @@
|
|||||||
# See the OWNERS docs at https://go.k8s.io/owners
|
|
||||||
|
|
||||||
labels:
|
|
||||||
- sig/api-machinery
|
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user