Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
81cc0c57
Commit
81cc0c57
authored
Aug 09, 2016
by
mbohlool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cleanup addon pod to remove empty keys in etcd
parent
c6697783
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
0 deletions
+107
-0
etcd-empty-dir-cleanup.yaml
...addons/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.yaml
+13
-0
Dockerfile
cluster/images/etcd-empty-dir-cleanup/Dockerfile
+24
-0
Makefile
cluster/images/etcd-empty-dir-cleanup/Makefile
+32
-0
etcd-empty-dir-cleanup.sh
...r/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh
+38
-0
No files found.
cluster/addons/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.yaml
0 → 100644
View file @
81cc0c57
apiVersion
:
v1
kind
:
Pod
metadata
:
name
:
etcd-empty-dir-cleanup
namespace
:
kube-system
labels
:
k8s-app
:
etcd-empty-dir-cleanup
spec
:
hostNetwork
:
true
dnsPolicy
:
Default
containers
:
-
name
:
etcd-empty-dir-cleanup
image
:
gcr.io/google_containers/etcd-empty-dir-cleanup:0.0.1
cluster/images/etcd-empty-dir-cleanup/Dockerfile
0 → 100644
View file @
81cc0c57
# 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
gliderlabs/alpine
MAINTAINER
Mehdy Bohlool <mehdy@google.com>
RUN
apk-install bash
ADD
etcd-empty-dir-cleanup.sh etcd-empty-dir-cleanup.sh
ADD
etcdctl etcdctl
ENV
ETCDCTL /etcdctl
ENV
SLEEP_SECOND 3600
RUN
chmod
+x etcd-empty-dir-cleanup.sh
CMD
bash /etcd-empty-dir-cleanup.sh
cluster/images/etcd-empty-dir-cleanup/Makefile
0 → 100644
View file @
81cc0c57
# 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
=
2.2.1
IMAGE
=
gcr.io/google_containers/etcd-empty-dir-cleanup
TAG
=
0.0.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
-t
$(IMAGE)
:
$(TAG)
.
rm
-rf
etcdctl etcd-v
$(ETCD_VERSION)
-linux-amd64
etcd-v
$(ETCD_VERSION)
-linux-amd64
.tar.gz
push
:
build
gcloud docker push
$(IMAGE)
:
$(TAG)
cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh
0 → 100644
View file @
81cc0c57
#!/bin/bash
# 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
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment