Merge "Add custom apps in the k8s-pod-recovery service"
This commit is contained in:
commit
0e8206e8b7
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
|
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
|
||||||
export KUBECONFIG=/etc/kubernetes/admin.conf
|
export KUBECONFIG=/etc/kubernetes/admin.conf
|
||||||
|
CONF_DIR=/etc/k8s-post-recovery.d
|
||||||
SLEEP_DELAY_SEC=15
|
SLEEP_DELAY_SEC=15
|
||||||
|
|
||||||
NAME=$(basename $0)
|
NAME=$(basename $0)
|
||||||
@ -101,6 +102,12 @@ function _unknown_pods {
|
|||||||
# Target specific namespaces and pods on this host
|
# Target specific namespaces and pods on this host
|
||||||
SUPPORTED_NAMESPACES=('openstack' 'monitor')
|
SUPPORTED_NAMESPACES=('openstack' 'monitor')
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
|
for conf_file in ${CONF_DIR}/*.conf; do
|
||||||
|
grep -q '^namespace=' $conf_file || continue
|
||||||
|
SUPPORTED_NAMESPACES+=($(grep '^namespace=' $conf_file | awk -F '=' '{print $2}'))
|
||||||
|
done
|
||||||
|
|
||||||
if [ "$1" == 'recover' ]; then
|
if [ "$1" == 'recover' ]; then
|
||||||
# Recovers pods that are: Running/Unknown and Pending/Init:Unknown
|
# Recovers pods that are: Running/Unknown and Pending/Init:Unknown
|
||||||
for ns in ${SUPPORTED_NAMESPACES[@]}; do
|
for ns in ${SUPPORTED_NAMESPACES[@]}; do
|
||||||
|
@ -17,10 +17,12 @@ Requires: systemd
|
|||||||
|
|
||||||
%define local_dir /usr/local
|
%define local_dir /usr/local
|
||||||
%define local_sbindir %{local_dir}/sbin
|
%define local_sbindir %{local_dir}/sbin
|
||||||
|
%define k8s_recovery_conf_dir /etc/k8s-post-recovery.d
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
install -d %{buildroot}%{k8s_recovery_conf_dir}
|
||||||
install -d %{buildroot}%{local_sbindir}
|
install -d %{buildroot}%{local_sbindir}
|
||||||
install -m 755 %{SOURCE0} %{buildroot}%{local_sbindir}/k8s-pod-recovery
|
install -m 755 %{SOURCE0} %{buildroot}%{local_sbindir}/k8s-pod-recovery
|
||||||
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/k8s-pod-recovery.service
|
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/k8s-pod-recovery.service
|
||||||
@ -50,3 +52,4 @@ fi
|
|||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{local_sbindir}/k8s-pod-recovery
|
%{local_sbindir}/k8s-pod-recovery
|
||||||
%{_unitdir}/k8s-pod-recovery.service
|
%{_unitdir}/k8s-pod-recovery.service
|
||||||
|
%{k8s_recovery_conf_dir}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user