K8S 中使用 Heketi 管理 GlusterFS

K8S 中使用 Heketi 管理 GlusterFS 与 官方文档不同 , 本文中的 glusterfs 是独立与 k8s 之外的。 Heketi heketi 项目 为 GlusterFS 提供 RESTful 的 API 管理。 Requirements System must have glusterd service enabled and glusterfs-server installed Disks registered with Heketi must be in raw format. 目前提供两种管理方式: ssh, kubernetes heketi-ssh SSH Access SSH user and public key already setup on the node SSH user must have password-less sudo Must be able to run sudo commands from ssh. This requires disabling requiretty in the /etc/sudoers file 使用容器部署 https://hub.docker.com/r/heketi/heketi/ heketi-kubernetes 带实现 勘误 在使用 K8S 部署时, 如果客户端报错……

阅读全文

K8S节点下载 gcr.io 原生镜像

K8S下载 gcr.io 原生镜像 在国内是不能直接下载 gcr.io / k8s.gcr.io 等原生镜像的。 使用比较权威的三方源 aliyun , qcloud 将 gcr.io push 到 hub.docker.com 自建镜像代理 域名翻墙 域名翻墙 通过域名劫持,将目标地址直接解析到代理服务器上。 sniproxy 所有你需要的, 一个能直接访问 gcr.ip 的 https(443) 代理。 通过 sniproxy 实现。 通过 防火墙 , 安全组 限制访问来源。 1 2 # docker run -d --rm --network host --name sniproxy……

阅读全文

docker multi-stage build

Docker multi-stage build Multi-stage 构建,最大的好处是 Docker 本身在构建过程中提供了一个缓存空间,将上一个 stage 的结果通过 COPY --from=<stage> 复制到下一个 stage。 这样就大大简化了镜像清理工作。 这里, docker 官方文档已经对 Multi-stage build 已经有详细说明了。 multi-stage 要求 docker version >= 17.05 举例 每一个 FROM 关键字都表示此处是一个 stage 对 stage 使用命令的关键字是 as , 例如 FROM alpine:latest as initer 在引用……

阅读全文

Haproxy反向代理FTP

Haproxy 反向代理 FTP 4层 代理 haproxy-1.5.18-7.el7.x86_64 #--------------------------------------------------------------------- # Example configuration for a possible web application. See the # full configuration options online. # # http://haproxy.1wt.eu/download/1.4/doc/configuration.txt # #--------------------------------------------------------------------- #--------------------------------------------------------------------- # Global settings #--------------------------------------------------------------------- global # to have these messages end up in /var/log/haproxy.log you will # need to: # # 1) configure syslog to accept network log events. This is done # by adding the '-r' option to the SYSLOGD_OPTIONS in # /etc/sysconfig/syslog # # 2) configure local2 events to go to the /var/log/haproxy.log # file. A line like the following can be added to # /etc/sysconfig/syslog # # local2.* /var/log/haproxy.log # log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user root group root daemon # turn on stats unix socket stats socket /var/lib/haproxy/stats #--------------------------------------------------------------------- # common defaults that all the 'listen' and 'backend' sections……

阅读全文

k8s node 节点

k8s node 节点介绍 node 是 k8s 的工作节点, cpu, memory 的提供者。 上面运行这实际工作的 pod。 node 的服务包括 container 环境、 kubelet 和 kube-proxy。 使用 kubectl 管理 node 基础语法为 : kubectl flag node <node_name> kubectl cordon / uncordon 1 2 3 4 # 驱逐 kubectl cordon node <node_name> # 恢复 kubectl uncordon node <node_name>……

阅读全文

filebeat将多行日志视作一样的参数配置

filebeat 将多行日志视作一样的参数配置 在 filebeat 格式化日志是,可以配置 pattern 将多行日志合并成一样。 在配置文件 filebeat.yml 中,协同完成这个功能的参数有 4 个。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # The regexp Pattern that has to be matched. # 设置行的匹配字段 multiline.pattern: '^[[:space:]]|^[[:alpha:]]' # Defines if the pattern set under pattern should be negated or not. Default is false. # 设置符合上面匹配条件的的行,是否应该被合……

阅读全文

Linux 下的几个命令行下载工具

Linux 下的几个命令行下载工具 linux 下最常用的 wget 是单线程的。虽然好用,但不够用。例如在下载阿里云的数据库备份文件,单线程最多能达到 10Mbps,即使是走内网。 因此,有必要换一下其他的。 axel https://github.com/axel-download-accelerator/axel axel 相较 wget 最大的优点就是支持多线程。 在 ubuntu 16.04 LST 上安装非常简单,已经加入了官方源。 CentOS 系列的话,就去 pkgs.org 上找到对……

阅读全文

使用 sshpass 传递密码

使用 sshpass 传递密码 使用 sshpass 给 ansible 传递密码 1 2 3 4 5 $ sshpass -p 'xxxxxxxx' ansible -i dsgl_domantic.py all -m ping --limit=1x.x.x.x0 -u root --ask-pass 1x.x.x.x0 | SUCCESS => { "changed": false, "ping": "pong" } 将密码写入命令行中 1 sshpass -p 'your_password_string' ssh 58.*.*.197 将密码写入变量中 1 2 export SSHPASS='your_password_string' sshpass -e ssh 118.*.*.16 将密码写入文件中 1 2 3 echo 'your_password_string' > sshpass.sec sshpass -f sshpass.sec ssh 118.*.*.16……

阅读全文

MYSQL 导出用户权限脚本

MYSQL 导出用户权限脚本 分享一个抄来的 mysql 备份权限的脚本 。这个脚本最大的好处是通用,不用像之前那样备份 mysql.user 表而造成在不同 mysql 实例之间造成不必要的问题。 1 2 3 4 5 6 7 8 9 10 11 #!/bin/bash #Function export user privileges source /etc/profile pwd=your_password MYSQL_AUTH=" -uroot -p${pwd} -h127.0.0.1 --port=3306 " expgrants() { mysql -B ${MYSQL_AUTH} -N $@ -e "SELECT CONCAT('SHOW GRANTS FOR ''', user, '''@''', host, ''';') AS query FROM mysql.user" | mysql ${MYSQL_AUTH} $@ | sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/-- \1 /;/--/{x;p;x;}' } expgrants > ./grants.sql http://www.cnblogs.com/huangmr0811/p/5570994.html……

阅读全文

福利派送

  • (免费星球)「运维成长路线」

  • 又拍云免费 CDN

最近文章

分类

标签

其它