既然目标是地平线 留给世界的只能是背影。
以下是kube-apiserver的证书示例
Certificate:
Data:
Version: 3 (0x2) # 版本号
Serial Number: 12 (0xc) # 序列号 对于所有的版本,同一个CA颁发的证书序列号都必须是唯一的。
Signature Algorithm: sha256WithRSAEncryption # ID签名算法
Issuer: C = BJ, O = Tech, OU = SRE, CN = www.ca.com # 颁发者名称
Validity # 有效期
Not Before: Aug 14 10:01:46 2022 GMT
Not After : Aug 11 10:01:46 2032 GMT
Subject: C = BJ, ST = BJ, L = BJ, O = Tech, OU = SRE, CN = system:api-server
Subject Public Key Info: # 主题公钥信息
Public Key Algorithm: rsaEncryption # 公钥算法
RSA Public-Key: (2048 bit) # 公钥
Modulus:
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Authority Key Identifier:
DirName:/C=BJ/O=Tech/OU=SRE/CN=www.ca.com
serial:BB:A3:04:8F:CF:8C:F8:99
X509v3 Basic Constraints: # 用于指示一份证书是不是CA证书。
CA:FALSE
X509v3 Key Usage: # 指定了这份证书包含的公钥可以执行的密码操作
Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment
X509v3 Extended Key Usage: # 典型用法是指定叶子证书中的公钥的使用目的。它包括一系列的OID,每一个都指定一种用途
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Subject Alternative Name: # 描述可以使用的主机名,IP地址等
DNS:www.kubernetes.com, DNS:master01.kubernetes.com, DNS:master02.kubernetes.com, IP Address:172.20.0.1 # 除了apiserver向外部暴露的域名,apiserver在集群内部对应的service ip,与需要加到这里
Signature Algorithm: sha256WithRSAEncryption # 证书签名算法
--etcd-certfile string
--cert-dir string
--tls-cert-file string
--tls-private-key-file string
--tls-sni-cert-key namedCertKey
--client-ca-file string
--oidc-ca-file string
--requestheader-allowed-names strings
--requestheader-client-ca-file string
--kubelet-certificate-authority string
--kubelet-client-certificate string
--proxy-client-cert-file string
--proxy-client-key-file string
对应以下几种需要证书通信的配置