1 Star 1 Fork 4

liy36/k8s-certs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
openssl.conf 4.47 KB
一键复制 编辑 原始数据 按行查看 历史
liy36 提交于 2022-08-15 14:09 . init k8s-certs
# environment variable values
BASE_DOMAIN=
CLUSTER_NAME=
CERT_DIR=
APISERVER_CLUSTER_IP=
MASTER_NAME1=
MASTER_NAME2=
MASTER_NAME3=
NODE_IP01=
NODE_IP02=
NODE_IP03=
NODE_NAME01=
NODE_NAME02=
NODE_NAME03=
[ ca ]
# `man ca`
default_ca = CA_default
[ CA_default ]
# Directory and file locations.
dir = ${ENV::CERT_DIR}
certs = $dir
crl_dir = $dir/crl
new_certs_dir = $dir
database = $dir/index.txt
serial = $dir/serial
# certificate revocation lists.
crlnumber = $dir/crlnumber
crl = $dir/crl/intermediate-ca.crl
crl_extensions = crl_ext
default_crl_days = 30
default_md = sha256
name_opt = ca_default
cert_opt = ca_default
default_days = 375
preserve = no
policy = policy_loose
[ policy_loose ]
# Allow the CA to sign a range of certificates.
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ req ]
# `man req`
default_bits = 4096
distinguished_name = req_distinguished_name
string_mask = utf8only
default_md = sha256
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
stateOrProvinceName = State or Province Name
localityName = Locality Name
0.organizationName = Organization Name
organizationalUnitName = Organizational Unit Name
commonName = Common Name
# Certificate extensions (`man x509v3_config`)
[ v3_ca ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
basicConstraints = critical, CA:true, pathlen:0
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
[ client_cert ]
basicConstraints = CA:FALSE
nsCertType = client
nsComment = "OpenSSL Generated Client Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth
[ server_cert ]
basicConstraints = CA:FALSE
nsCertType = server
nsComment = "OpenSSL Generated Server Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
[ etcd_server_cert ]
basicConstraints = CA:FALSE
nsCertType = server
nsComment = "OpenSSL Generated Server Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @etcd_names
[ etcd_peer_cert ]
basicConstraints = CA:FALSE
nsCertType = server
nsComment = "OpenSSL Generated Server Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @etcd_names
[ etcd_names ]
IP.1 = ${ENV::NODE_IP01}
IP.2 = ${ENV::NODE_IP02}
IP.3 = ${ENV::NODE_IP03}
DNS.1 = ${ENV::NODE_NAME01}.${ENV::BASE_DOMAIN}
DNS.2 = ${ENV::NODE_NAME02}.${ENV::BASE_DOMAIN}
DNS.3 = ${ENV::NODE_NAME03}.${ENV::BASE_DOMAIN}
DNS.4 = *.${ENV::BASE_DOMAIN}
[ apiserver_cert ]
basicConstraints = CA:FALSE
nsCertType = server
nsComment = "OpenSSL Generated Server Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @apiserver_names
[ master_component_client_cert ]
basicConstraints = CA:FALSE
nsCertType = client
nsComment = "OpenSSL Generated Client Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth
subjectAltName = @master_names
[apiserver_names]
DNS.1 = ${ENV::CLUSTER_NAME}-api.${ENV::BASE_DOMAIN}
DNS.2 = ${ENV::MASTER_NAME1}.${ENV::BASE_DOMAIN}
DNS.3 = ${ENV::MASTER_NAME2}.${ENV::BASE_DOMAIN}
DNS.4 = ${ENV::MASTER_NAME3}.${ENV::BASE_DOMAIN}
DNS.5 = kubernetes
DNS.6 = kubernetes.default
DNS.7 = kubernetes.default.svc
DNS.8 = kubernetes.default.svc.cluster.local
IP.1 = ${ENV::APISERVER_CLUSTER_IP}
[ master_names ]
DNS.1 = ${ENV::MASTER_NAME1}.${ENV::BASE_DOMAIN}
DNS.2 = ${ENV::MASTER_NAME2}.${ENV::BASE_DOMAIN}
DNS.3 = ${ENV::MASTER_NAME3}.${ENV::BASE_DOMAIN}
DNS.4 = ${ENV::CLUSTER_NAME}-api.${ENV::BASE_DOMAIN}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liy36/k8s-certs.git
git@gitee.com:liy36/k8s-certs.git
liy36
k8s-certs
k8s-certs
master

搜索帮助