Kubernetes生产实践系列之五:基于虚拟机部署安全加密的etcd集群

本文详细介绍如何在虚拟机上构建安全的etcd集群,包括操作系统准备、生成证书和key文件、安装etcd服务及查看集群状态等关键步骤。

一、前言

etcd集群对于Kubernetes集群及其重要,Kubernetes的API Server本身是无状态的,所有的状态都进入etcd进行存储,所以etcd的性能和安全关乎整个Kubernetes集群的性能和安全:

本文介绍使用在虚拟机上构建证书安全的etcd集群。

转载自https://blog.youkuaiyun.com/cloudvtech

二、准备工作

2.1 操作系统准备工作

#关闭防火墙
systemctl disable firewalld
systemctl stop firewalld

#配置域名
[root@k8s-master-02 etcd]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.101 k8s-master-01
192.168.56.102 k8s-master-02
192.168.56.103 k8s-master-03
192.168.56.111 k8s-node-01
192.168.56.112 k8s-node-02
192.168.56.113 k8s-node-03

#创建需要的目录
mkdir /opt/etcd/
mkdir /opt/etcd/data
mkdir /opt/etcd/logs

 

2.2 生成证书和key文件

工具准备

curl -s -L -o /usr/bin/cfssl https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
curl -s -L -o /usr/bin/cfssljson https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
chmod +x /usr/bin/{cfssl,cfssljson}

ca-config.json 

{
  "signing": {
    "default": {
      "expiry": "100000h"
    },
    "profiles": {
      "server": {
        "usages": ["signing", "
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值