docker run -d --name pause-1 k8s.gcr.io/pause:3.2
注意:Running Error 请看pods什么周期介绍 https://www.jianshu.com/p/0bb8572e34f
#!/bin/bash
KEY=`cat /proc/sys/kernel/random/uuid`
USER=`echo $KEY |cut -d "-" -f1`
ACCESS_KEY=`uuidgen`
SECRET_KEY=$KEY
ROLE_NAME=$USER-sts
ROLE_DOC=\{\"Version\":\"2012-10-17\",\"Statement\":\[\{\"Effect\":\"Allow\",\"Principal\":\{\"AWS\":\[\"arn:aws:iam:::user/$USER\"\]\},\"Action\":\[\"sts:AssumeRole\"\]\}\]\}
ROLE_POLICY_NAME=$USER-$ROLE_NAME-pilicy
ROLE_POLICY_DOC=\{\"Version\":\"2012-10-17\",\"Statement\":\[\{\"Effect\":\"Allow\",\"Action\":\[\"s3:*\"\],\"Resource\":\"arn:aws:s3:::*\"\}\]\}
radosgw-admin user create --uid=$USER --display-name=$USER --access-key=$ACCESS_KEY --secret-key=$SECRET_KEY >> /dev/null
radosgw-admin role create --role-name=$ROLE_NAME --path=/ --assume-role-policy-doc=$ROLE_DOC >> /dev/null
radosgw-admin role-policy put --role-name=$ROLE_NAME --policy-name=$ROLE_POLICY_NAME --policy-doc=$ROLE_POLICY_DOC >> /dev/null
echo -e "access-key:\t $ACCESS_KEY"
echo -e "secret-key:\t $SECRET_KEY"
echo -e "arn:\t arn:aws:iam:::role/$ROLE_NAME"
# mongo状态检查
/qaxdata/s/services/mongo/27017/bin/mongo $(/qaxdata/s/services/etcd/etcd_2483/bin/etcdctl --endpoints=127.0.0.1:2483 get --prefix=true da.xian.test|egrep "mongo:\/\/"|tail -n 1|sed 's#^mongo://#mongodb://#g'|sed 's/\(.*\?\)?.*/\1\?replicaset=mongorepl\&authSource=admin/g') --quiet --eval "rs.isMaster().ok"
/qaxdata/s/services/mongo/27017/bin/mongo $(/qaxdata/s/services/etcd/etcd_2483/bin/etcdctl --endpoints=127.0.0.1:2483 get --prefix=true da.xian.test|egrep "mongo:\/\/"|tail -n 1|sed 's#^mongo://#mongodb://#g'|sed 's/\(.*\?\)?.*/\1\?replicaset=mongorepl\&authSource=admin/g') --quiet --eval "rs.status().ok"
# 检查硬盘使用百分比和可用空间
df -h /qaxdata | awk 'NR==2 {print $5}' | sed 's/%//'
df /qaxdata|awk 'NR==2{print $3/1024/1024}'