forked from gitbeyond/ansible_roles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dockerFiles/ingress-nginx-controller
- Loading branch information
Showing
17 changed files
with
491 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
|
||
# 作用及用法 | ||
example: | ||
```yaml | ||
- hosts: 10.111.32.155 | ||
roles: | ||
- {role: check_virus} | ||
``` | ||
# 问题 | ||
1. 将 curl, wget 及 base64 保护起来的操作有如下几种方式: | ||
* 计算出当前的命令的 md5 值,将其copy到 criminal 目录 | ||
* 这里的问题就是,第二次执行的时候就会操作错误的命令(即非真正的命令) | ||
* 解决上面的问题的办法是每次都安装一次相关命令(但是这不太可取) | ||
* 或者在控制机上将相关命令copy过去,这个倒是一个不错的方法 | ||
* 需要指定相关命令,如遇到系统版本不同的情况,还得为其准备相应的命令 | ||
* 另外有一点就是即使大版本相同,小版本也可能会有些许变化,不过这个影响应该很小 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM k8s.gcr.io/ingress-nginx/controller:v0.35.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 此脚本是用来创建 osd 的,这里显式指定了 --block.db 等参数 | ||
#devs=(sdb sdc sdd) | ||
#devs=(sdb ) | ||
devs=(sdb sdc sdd) | ||
|
||
for disk in ${devs[*]};do | ||
parted /dev/${disk} mklabel gpt | ||
parted /dev/${disk} mkpart primary 0% 30GB | ||
parted /dev/${disk} mkpart primary 30GB 100% | ||
pvcreate /dev/${disk}1 | ||
vgcreate ceph-${disk} /dev/${disk}1 | ||
lvcreate -n ceph-block.db -L 2048m ceph-${disk} | ||
lvcreate -n ceph-block.wal -L 2048m ceph-${disk} | ||
ceph-volume lvm prepare --bluestore --data /dev/${disk}2 --block.db ceph-${disk}/ceph-block.db --block.wal ceph-${disk}/ceph-block.wal &> /tmp/ceph-prepare-${disk}.out | ||
#grepvim | ||
osd_num=$(grep -o "osd.[0-9]\{1,3\}" /tmp/ceph-prepare-${disk}.out | head -n 1 |awk -F'.' '{print $NF}') | ||
osd_uuid=$(grep client.bootstrap-osd /tmp/ceph-prepare-${disk}.out |head -n 1 |awk '{print $NF}') | ||
ceph-volume lvm activate --bluestore ${osd_num} ${osd_uuid} | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin | ||
|
||
osd_num=$1 | ||
|
||
ceph osd out ${osd_num} | ||
systemctl stop ceph-osd@${osd_num} | ||
|
||
ceph osd purge ${osd_num} --yes-i-really-mean-it | ||
|
||
ceph osd crush remove osd.${osd_num} | ||
ceph auth del osd.${osd_num} | ||
ceph osd rm ${osd_num} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
# 这个是临时检测哪个表 distcp 失败, rebuild 失败的脚本, 临时的命令,不太正规,只是实现了一个复杂的命令而已 | ||
cat dbs.txt_all |while read line; do | ||
cd ${line} | ||
cat ${line}_tbs.txt |while read tb; do | ||
if grep "${line}.${tb}" distcp_success.txt > /dev/null;then | ||
if grep "${line}.${tb}" distcp_failed.txt > /dev/null;then | ||
sed -i "/${line}.${tb}/d" distcp_failed.txt | ||
fi | ||
else | ||
echo ${line}.${tb} | ||
fi | ||
done | ||
cd - | ||
done | ||
|
||
cat dbs.txt_all |while read line; do | ||
cd ${line} | ||
cat ${line}_tbs.txt |while read tb; do | ||
if grep "${line}.${tb}" rebuild_table_success.txt > /dev/null;then | ||
if grep "${line}.${tb}" rebuild_table_failed.txt > /dev/null;then | ||
sed -i "/${line}.${tb}/d" rebuild_table_failed.txt | ||
fi | ||
else | ||
echo ${line}.${tb} | ||
fi | ||
done | ||
cd - | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 这也是个临时的脚本,只是把 failed 的表写到 tbs.txt 中,让主脚本把 failed 的表重试 | ||
dt=$(date +%Y%m%d%H%M%S) | ||
cat dbs.txt_all | while read line;do | ||
cd ${line} | ||
if [ -f ${line}_tbs_all.txt ];then | ||
: | ||
else | ||
|
||
mv ${line}_tbs.txt ${line}_tbs_all.txt | ||
fi | ||
if [ -f distcp_failed.txt ];then | ||
awk -F. '{print $NF}' distcp_failed.txt > ${line}_tbs.txt | ||
#mv distcp_failed.txt ${dt} | ||
else | ||
: | ||
fi | ||
cd - | ||
|
||
done |
Oops, something went wrong.