Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

Netkiller Container 手札

Virtualization、Docker、Kubernetes、KVM、Vagrant、OpenVZ、VirtualBox ...

Mr. Neo Chan, 陈景峯(BG7NYT)



中国广东省深圳市望海路半岛城邦三期
518067
+86 13113668890


2015-07-14

电子书最近一次更新于 2023-05-22 11:13:35

版权声明

转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。

http://www.netkiller.cn
http://netkiller.github.io
http://netkiller.sourceforge.net
微信公众号: netkiller
微信:13113668890 请注明“读者”
QQ:13721218 请注明“读者”
QQ群:128659835 请注明“读者”
知乎专栏 | 多维度架构

$Date$


致读者

Netkiller 系列手札 已经被 Github 收录,并备份保存在北极地下250米深的代码库中,备份会保留1000年。

Preserving open source software for future generations

The world is powered by open source software. It is a hidden cornerstone of modern civilization, and the shared heritage of all humanity.

The GitHub Arctic Code Vault is a data repository preserved in the Arctic World Archive (AWA), a very-long-term archival facility 250 meters deep in the permafrost of an Arctic mountain.

We are collaborating with the Bodleian Library in Oxford, the Bibliotheca Alexandrina in Egypt, and Stanford Libraries in California to store copies of 17,000 of GitHub’s most popular and most-depended-upon projects—open source’s “greatest hits”—in their archives, in museum-quality cases, to preserve them for future generations.

https://archiveprogram.github.com/arctic-vault/

目录

1. 自述
1.1. 写给读者
1.2. 作者简介
1.3. 如何获得文档
1.4. 打赏(Donations)
1.5. 联系方式
1. 阿里云 Kubernetes
1.1. 链接到 Kubernetes
1.2. 504 Gateway Time-out
2. Docker
2.1. 安装 Docker
2.1.1. Rocky Linux 9.0 / AlmiLinux 9.0 / CentOS 8 Stream
2.1.2. Ubuntu docker-ce
2.1.3. 测试 Docker
2.1.4. 重置 Docker
2.1.5. 早起版本
2.2. Portainer - Docker 图形管理界面
2.2.1. 安装
2.2.2. 配置 Portainer
2.2.3. 添加代理出错
2.3. 配置 Docker
2.3.1. 开启远程访问
2.3.2. 镜像配置
2.3.3. DNS
2.3.4. ulimit 资源
2.4. docker 命令
2.4.1. docker - A self-sufficient runtime for containers
2.4.2. docker-compose - Define and run multi-container applications with Docker.
2.4.3. Docker Scan
2.5. 镜像管理
2.5.1. 搜索镜像
2.5.2. 获取镜像
2.5.3. 列出本地镜像
2.5.4. tag
2.5.5. 保存和载入镜像
2.5.6. 删除本地镜像
2.5.7. history 镜像历史纪录
2.5.8. format 用法
2.5.9. inspect
2.5.10. 查看镜像内容
2.6. 容器管理
2.6.1. 查看容器
2.6.2. 启动与终止容器
2.6.3. 进入容器
2.6.4. 运行容器内的命令
2.6.5. 导出和导入容器
2.6.6. 停止所有容器
2.6.7. 删除容器
2.6.8. log-driver
2.6.9. 操作系统
2.6.10. 查看容器内运行的进程
2.6.11. 更新容器资源配置
2.6.12. 查看容器的退出状态
2.6.13. 暂停与恢复容器
2.6.14. 对比容器的变化
2.6.15. 查看容器状态
2.6.16. 重启容器
2.6.17. DNS
2.7. 卷管理
2.7.1. 列出卷
2.7.2. 创建卷
2.7.3. 挂在镜像
2.7.4. 检查卷
2.7.5. 删除卷
2.7.6. 销毁所有未使用的卷
2.7.7. 在多个容器间共享卷
2.7.8. 容器绑定本地文件系统
2.7.9. 只读权限
2.8. Docker 网络管理
2.8.1. docker0 IP地址
2.8.2. 容器指定固定IP地址
2.8.3. 创建子网
2.8.4. 创建 overlay 网络
2.8.5. 网络命令空间
2.8.6. flannel 网络配置
2.9. 日志管理
2.9.1. 查看默认驱动
2.9.2. Fluentd 配置
2.9.3. Docker 配置
2.9.4. docker-compose 编排
2.9.5. 将日志输出到 /dev/stdout 和 /dev/stderr
2.10. Dockerfile
2.10.1. 基于 Dockerfile 创建镜像
2.10.2. 基于 Alpine 制作镜像
2.10.3. Dockerfile 缺失的工具
2.10.4. Dockerfile 语法
2.11. 仓库
2.11.1. Docker 官方仓库
2.11.2. 私有仓库
2.11.3. Harbor
2.12. Swarms
2.12.1. 管理 Swarms
2.12.2. Stack
2.12.3. 服务
2.12.4. swarm 卷管理
2.13. docker-compose.yml 容器编排
2.13.1. 版本号
2.13.2. 镜像
2.13.3. 容器名称
2.13.4. 启动策略
2.13.5. 容器用户
2.13.6. 挂在卷
2.13.7. 映射端口的标签
2.13.8. 添加 hosts 文件
2.13.9. 网络配置
2.13.10. links 主机别名
2.13.11. 链接外部容器
2.13.12. 服务依赖
2.13.13. working_dir
2.13.14. 设置环境变量
2.13.15. 临时文件系统
2.13.16. 编译 Dockerfile
2.13.17. resources 硬件资源分配
2.14. Docker Example
2.14.1. registry
2.14.2. Example Java - Spring boot with Docker
2.14.3. Redis
2.14.4. Nginx
2.14.5. MySQL
2.14.6. MongoDB
2.14.7. Node
2.15. Docker FAQ
2.15.1. 通过 IP 找容器
2.15.2. 常用工具
2.15.3. 检查 Docker 是否可用
2.15.4. Bitnami
3. Podman
3.1. 安装 Podman
3.1.1. RockyLinux 安装 Podman
3.1.2. Almalinux 9.0
3.1.3. MacOS 安装 Podman
3.1.4. 初始化 Podman
3.1.5. 让 Podman 支持 Docker Compose
3.1.6. 配置 Podman
3.1.7.
3.2. podman 管理
3.2.1. 虚拟机管理
3.2.2. 镜像管理
3.2.3. Registry
3.3. 按例
3.3.1. podman run 用法
3.3.2. mysql
3.3.3. 制作镜像
I. Kubernetes
4. Minikube
4.1. CentOS 8 安装 minikube
4.1.1. CentOS
4.1.2. Mac OS
4.2. Quickstart
4.3. minikube 命令
4.3.1. minikube ip 地址
4.3.2. 启动 minikube
4.3.3. 停止 minikube
4.3.4. Docker 环境变量
4.3.5. SSH
4.3.6. 缓存镜像
4.3.7. 清理 minikube
4.3.8. Kubernetes 控制面板
4.3.9. service
4.3.10. 查看日志
4.3.11. 查看 Docker 环境变量
4.3.12. profile
4.3.13. addons
4.3.14. SSH
4.3.15. 查看IP地址
4.3.16. 镜像管理
4.3.17. kubectl
4.4. Minikube 案例演示
4.5. FAQ
4.5.1. This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
4.5.2. ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables
4.5.3. ERROR ImagePull
4.5.4. 证书已存在错误
4.5.5. http: server gave HTTP response to HTTPS client
4.5.6. provided port is not in the valid range. The range of valid ports is 30000-32767
4.5.7. Exiting due to MK_ENABLE: run callbacks: running callbacks: [verifying registry addon pods : timed out waiting for the condition: timed out waiting for the condition]
4.5.8. Exiting due to SVC_URL_TIMEOUT: http://127.0.0.1:11068/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ is not accessible: Temporary Error: unexpected response code: 503
4.5.9. Mac minikube ip 不通,ingress 不工作
5. microk8s
5.1. 安装 microk8s
5.1.1. 安装指定版本
5.2. 组件管理
5.2.1. dns
5.2.2. dashboard
5.3. kubectl
5.4. Kubernetes Addons
5.4.1.
6. Kubernetes 集群管理
6.1. 配置
6.1.1. KUBECONFIG
6.1.2. use-context
6.2. 如何从 docker 过渡到 kubectl 命令
6.2.1. 执行 Shell
6.2.2. 查看信息
6.2.3. 查看 pod 日志
6.2.4. 复制文件
6.2.5. edit
6.2.6. 端口转发
6.2.7. 操作系统资源配置
6.2.8. endpoints
6.2.9. explain
6.2.10. describe
6.3. namespace 命名空间
6.3.1. 查看命名空间
6.3.2. 创建命名空间
6.3.3. 使用 yaml 创建命名空间
6.3.4. 删除命名空间
6.4. label 标签
6.5. 服务管理
6.5.1. 列出服务
6.5.2. 创建服务
6.5.3. 查看服务详细信息
6.5.4. 更新服务
6.5.5. 删除服务
6.5.6. clusterip
6.5.7. 设置外部IP
6.5.8. externalname
6.5.9. 负载均衡
6.5.10. nodeport
6.5.11. Example
6.6. serviceaccount
6.7. Pod 管理
6.7.1. 查看 POD 状态
6.7.2. 运行 POD
6.7.3. 删除 pod
6.7.4. 查看 Pod 的事件
6.7.5. Taint(污点)和 Toleration(容忍)
6.7.6. 镜像拉取策略
6.7.7. 指定主机名
6.7.8. 环境变量
6.7.9. 健康状态检查
6.7.10. securityContext
6.7.11. nodeName 选择节点
6.7.12. nodeSelector 选择节点
6.7.13. nodeAffinity 选择节点
6.7.14. Taint(污点)和 Toleration(容忍)
6.7.15. strategy
6.8. 部署管理
6.8.1. expose
6.8.2. 部署容器
6.8.3. 删除 deployment
6.8.4. 扩容管理
6.8.5. rollout
6.8.6. 重启容器
6.8.7. 更新镜像
6.9. secret 密钥管理
6.9.1. 获取 Token
6.9.2. 创建 Secret
6.9.3. Private Registry 用户认证
6.9.4. 配置TLS SSL
6.10. ConfigMap
6.10.1. 创建 Key-Value 配置项
6.10.2. 从文件创建 ConfigMap
6.10.3. 从环境变量文件创建 ConfigMap
6.10.4. 查看 ConfigMap
6.10.5. 删除 ConfigMap
6.10.6. ConfigMap
6.11. Job/CronJob
6.11.1. CronJob
6.11.2. Job
6.12. clusterrolebinding
6.13. Volume
6.13.1. local
6.14. Ingress
6.14.1. 管理 Ingress
6.14.2. 挂载 SSL 证书上
6.14.3. 端口
6.14.4. URI 规则
6.14.5. vhost 虚拟主机
6.14.6. rewrite
6.14.7. annotations 配置
6.14.8. 金丝雀发布(灰度发布)
6.14.9. 解决 504 网关超时
7. kubectl example
7.1. 私有 registry
7.2. mongodb
7.3. tomcat
8. istio
8.1. 启动 istio
8.2. 禁用 istio
9. Kubeapps
10. Helm - The package manager for Kubernetes
10.1. 安装 Helm
10.1.1. AlmaLinux
10.1.2. Rocky Linux
10.1.3. Ubuntu
10.1.4. Mac
10.2. 快速开始
10.3. Helm 命令
10.3.1. 初始化 Helm
10.3.2. 查看仓库列表
10.3.3. 搜索
10.3.4. 查看包信息
10.3.5. 安装
10.3.6. 列表
10.3.7. 删除
10.3.8. 升级
10.3.9. 回滚
10.3.10. 查看状态
10.4. ingress-nginx
10.5. elastic
10.6. Helm The package manager for Kubernetes
10.7. Helm Faq
11. Rancher - Multi-Cluster Kubernetes Management
11.1. 安装 Rancher
11.1.1. Rancher Server
11.1.2. Rancher Kubernetes Engine (RKE) 2
11.1.3. Rancher Kubernetes Engine (RKE) 1
11.1.4. Rancher CLI
11.1.5. rancher-compose
11.2. 快速入门
11.2.1. API
11.3. Rancher Compose
11.3.1. Rancher Compose 命令
11.3.2. 操作演示
11.4. Rancher CLI
11.4.1. 登陆 Rancher
11.4.2. 查看集群
11.4.3. 查看节点
11.4.4. catalog
11.4.5. 查看设置
11.4.6. rancher kubectl
11.5. K3s
11.5.1. AutoK3s
11.5.2. 安装 K3s(Docker 模式)
11.5.3. 安装 K3s(VM 模式)
11.5.4. k3d
11.5.5. TLS 证书
11.5.6. 创建 Token
11.5.7. FAQ
11.6. Rancher Demo
11.6.1. Rancher 部署 Nginx
11.6.2. local-path-provisioner
11.7. Longhorn
11.7.1. 安装 Longhorn
11.7.2. 选择磁盘类型
11.7.3. 节点选择
11.7.4. FAQ
11.8. FAQ
11.8.1. 调试 Rancher 查看日志
11.8.2. [network] Host [rancher.netkiller.cn] is not able to connect to the following ports: [rancher.netkiller.cn:2379]. Please check network policies and firewall rules
11.8.3. cgroups v2
12. netkiller 容器编排工具
12.1. 安装 netkiller-devops
12.2. 使用 python 优雅地编排 Docker 容器
12.2.1. 安装依赖库
12.2.2. 创建一个 Services
12.2.3. 创建 Composes
12.2.4. 容器管理
12.2.5. 演示例子
12.2.6. 使用 Python 编排 Dockerfile
12.2.7.
12.2.8. logstash
12.3. 使用 Python 优雅地编排 Kubernetes
12.3.1. 快速演示编排Nginx
12.3.2. 创建命名空间
12.3.3. ConfigMap/Secret 编排演示
12.3.4. Pod 挂载 ConfigMap 编排演示
12.3.5. Pod 挂载 ConfigMap 设置环境变量
12.3.6. Ingress 挂载 SSL 证书
12.3.7. StatefulSet 部署 Redis
12.3.8. StorageClass
12.3.9. 部署 MySQL 到 kubernetes
12.3.10. MongoDB
12.3.11. Nacos
12.3.12. Redis
12.3.13. Kubernetes 部署 kube-explorer 图形化界面
12.3.14. ELK
12.3.15. sonarqube
13. Virtual Machine(虚拟机)
13.1. Kernel-based Virtual Machine(KVM)
13.1.1. kvm install usage yum
13.1.2. Ubuntu
13.1.3. CentOS 6.2
13.1.4. Scientific Linux Virtualization
13.1.5. libvirt
13.1.6. FAQ
13.2. Xen
13.2.1. install
13.2.2. Manager
13.3. OpenVZ
13.3.1. 安装OpenVZ
13.3.2. 使用OpenVZ & 建立VPS
13.3.3. 设置VPS参数
13.4. vagrant - Tool for building and distributing virtualized development environments
13.4.1. vagrant for windows
13.5. 虚拟机管理
13.5.1. Proxmox - Open-source virtualization management platform Proxmox VE
13.5.2. OpenStack
13.5.3. CloudStack
13.5.4. OpenNode
13.5.5. OpenNEbula

范例清单

4.1. minikube 操作演示
12.1. Redis Master/Slave
13.1. virsh