mirror of https://github.com/easzlab/kubeasz.git
move dockerfiles to github.com/kubeasz/dockerfiles
parent
f7f88aafdb
commit
2a20179fdd
|
@ -1,29 +0,0 @@
|
||||||
# Dockerfile for building Ansible image for Alpine 3
|
|
||||||
# Origin from https://github.com/William-Yeh/docker-ansible
|
|
||||||
|
|
||||||
FROM alpine:3.8
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
echo "===> Adding Python runtime..." && \
|
|
||||||
apk --update add python py-pip openssl ca-certificates && \
|
|
||||||
apk --update add --virtual build-dependencies \
|
|
||||||
python-dev libffi-dev openssl-dev build-base && \
|
|
||||||
pip install --upgrade pip cffi && \
|
|
||||||
\
|
|
||||||
\
|
|
||||||
echo "===> Installing Ansible..." && \
|
|
||||||
pip install ansible==2.6.12 && \
|
|
||||||
\
|
|
||||||
\
|
|
||||||
echo "===> Installing handy tools..." && \
|
|
||||||
pip install --upgrade pycrypto && \
|
|
||||||
apk --update add bash openssh-client rsync && \
|
|
||||||
\
|
|
||||||
\
|
|
||||||
echo "===> Removing package list..." && \
|
|
||||||
apk del build-dependencies && \
|
|
||||||
rm -rf /var/cache/apk/* && \
|
|
||||||
rm -rf /root/.cache
|
|
||||||
|
|
||||||
# default command: display Ansible version
|
|
||||||
CMD [ "ansible", "--version" ]
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Dockerfile for Rotating the indices in elastic of the EFK deployment
|
|
||||||
#
|
|
||||||
# @author: gjmzj
|
|
||||||
# @repo: https://github.com/kubeasz/mirrorepo/es-index-rotator
|
|
||||||
# @ref: https://github.com/easzlab/kubeasz/tree/master/dockerfiles/es-index-rotator
|
|
||||||
|
|
||||||
FROM alpine:3.8
|
|
||||||
|
|
||||||
COPY rotate.sh /bin/rotate.sh
|
|
||||||
|
|
||||||
RUN echo "===> Installing essential tools..." && \
|
|
||||||
apk --update add bash curl coreutils && \
|
|
||||||
echo "===> Cleaning up cache..." && \
|
|
||||||
rm -rf /var/cache/apk/* && \
|
|
||||||
chmod +x /bin/rotate.sh
|
|
||||||
|
|
||||||
CMD ["/bin/rotate.sh"]
|
|
|
@ -1,44 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#--------------------------------------------------
|
|
||||||
# Rotate the indices in elastic of the EFK deployment
|
|
||||||
#
|
|
||||||
# @author: gjmzj
|
|
||||||
# @usage: ./rotate.sh [num_of_days] (1<num_of_days<999)
|
|
||||||
# @repo: https://github.com/kubeasz/mirrorepo/es-index-rotator
|
|
||||||
# @ref: https://github.com/easzlab/kubeasz/tree/master/dockerfiles/es-index-rotator
|
|
||||||
|
|
||||||
set -o nounset
|
|
||||||
set -o errexit
|
|
||||||
set -o xtrace
|
|
||||||
|
|
||||||
# max days of logs to keep, default=7
|
|
||||||
max_days_of_log=7
|
|
||||||
|
|
||||||
if [[ "$#" -gt 0 && $1 =~ ^[1-9][0-9]{0,2}$ ]];then
|
|
||||||
max_days_of_log=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\n[INFO] rotate job starts, try to keep $max_days_of_log days of logs."
|
|
||||||
|
|
||||||
curl elasticsearch-logging:9200/_cat/indices? > /tmp/indices || \
|
|
||||||
{ echo "[ERROR] Can not connect to elastic!"; exit 1; }
|
|
||||||
|
|
||||||
curr_days_of_log=$(cat /tmp/indices|grep logstash|wc -l)
|
|
||||||
|
|
||||||
curr_days_of_log=$((${curr_days_of_log}-2))
|
|
||||||
|
|
||||||
if [[ "$max_days_of_log" -gt "$curr_days_of_log" ]];then
|
|
||||||
echo "[WARN] No need to rotate the ES indices!"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
first_day=$(date -d "$max_days_of_log days ago" +'%Y.%m.%d')
|
|
||||||
|
|
||||||
rotate=$(cat /tmp/indices|grep logstash|cut -d' ' -f3|cut -d'-' -f2|sort|sed -n "1,/$first_day/"p)
|
|
||||||
|
|
||||||
for day in $rotate;do
|
|
||||||
curl -X DELETE elasticsearch-logging:9200/logstash-$day
|
|
||||||
done
|
|
||||||
|
|
||||||
echo -e "\n[INFO] Success to rotate the ES indices!"
|
|
||||||
exit 0
|
|
|
@ -1,12 +0,0 @@
|
||||||
# NOTE: Prepare following Requirements and Build the image "kubeasz:$TAG"
|
|
||||||
# Requirement 1: git clone --depth=1 https://github.com/easzlab/kubeasz.git
|
|
||||||
# Requirement 2: download binaries at https://pan.baidu.com/s/1c4RFaA, and put into dir 'kubeasz/bin'
|
|
||||||
# Build: docker build -t kubeasz:$TAG .
|
|
||||||
|
|
||||||
FROM jmgao1983/ansible:v2.6
|
|
||||||
|
|
||||||
COPY kubeasz/ /etc/ansible
|
|
||||||
|
|
||||||
RUN ln -s /etc/ansible/tools/easzctl /usr/bin/easzctl
|
|
||||||
|
|
||||||
CMD [ "sleep", "360000000" ]
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Dockerfiles for building images needed
|
||||||
|
|
||||||
|
Please refer to https://github.com/kubeasz/dockerfiles
|
Loading…
Reference in New Issue