cd /opt/minio cat > minio.conf <<EOF # Volume to be used for Minio server. MINIO_VOLUMES="/opt/minio/data" # Use if you want to run Minio on a custom port. MINIO_OPTS="--address 192.168.11.159:9000 --console-address 192.168.11.159:9001" # Access Key of the server. MINIO_ACCESS_KEY=minio # Secret key of the server. MINIO_SECRET_KEY=minio123 EOF
Velero is a tool for managing disaster recovery, specifically for Kubernetes cluster resources. It provides a simple, configurable, and operationally robust way to back up your application state and associated data.
If you're familiar with kubectl, Velero supports a similar model, allowing you to execute commands such as 'velero get backup' and 'velero create schedule'. The same operations can also be performed as 'velero backup get' and 'velero schedule create'. Usage: velero [command] Available Commands: backup Work with backups backup-location Work with backup storage locations bug Report a Velero bug client Velero client related commands completion Output shell completion code for the specified shell (bash or zsh). create Create velero resources delete Delete velero resources describe Describe velero resources get Get velero resources help Help about any command install Install Velero plugin Work with plugins restic Work with restic restore Work with restores schedule Work with schedules snapshot-location Work with snapshot locations version Print the velero version and associated image Flags: --add_dir_header If true, adds the file directory to the header --alsologtostderr log to standard error as well as files --features stringArray Comma-separated list of features to enable for this Velero process. Combines with values from $HOME/.config/velero/config.json if present -h, --help help for velero --kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration --kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context) --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) --log_dir string If non-empty, write log files in this directory --log_file string If non-empty, use this log file --log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --logtostderr log to standard error instead of files (default true) --master --kubeconfig (Deprecated: switch to --kubeconfig) The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. -n, --namespace string The namespace in which Velero should operate (default "velero") --skip_headers If true, avoid header prefixes in the log messages --skip_log_headers If true, avoid headers when opening log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "velero [command] --help" for more information about a command.
# 巡检集群节点是否都为Ready状态 if [ `kubectl get nodes |grep -wv Ready|grep -vc NAME` -ne 0 ];then echo -e "\n`date +%Y"-"%m"-"%d""%H":"%M` [Error] K8s Node is not Ready." >>${LogFile} kubectl get nodes |grep -wv Ready | grep -v NAME >>${LogFile} #exit # 发送邮件 #kubectl get nodes |grep -wv Ready | grep -v NAME | mail -s "Subject" ${MailAddr} fi
# 巡检k8s基础组件是否为Running状态 for p in kube-apiserver- kube-controller-manager- kube-proxy- kube-scheduler- etcd-;do if [ `kubectl get pod -n kube-system|grep "$p"|grep -vc "Running"` -ne 0 ];then echo -e "\n`date +%Y"-"%m"-"%d""%H":"%M` [Error] K8s kube-pod is not Running." >>${LogFile} kubectl get pod -n kube-system|grep "$p" | grep -v "Running" >>${LogFile} # 发送邮件 #kubectl get pod -n kube-system|grep "$p" | mail -s "Subject" ${MailAddr} fi done
# 巡检正在运行的pod是否出现问题 for i in OutOfcpu Evicted Terminating Error Pening;do if [ `kubectl get pods -A |grep -c "${i}"` -gt 3 ];then echo -e "\n`date +%Y"-"%m"-"%d""%H":"%M` [Error] K8s pod is Error." >>${LogFile} kubectl get pods -A | grep "${i}" >>${LogFile} # 发送邮件 #kubectl get pods -A | grep "${i}" | mail -s "Subject" ${MailAddr} fi done