File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
vertical-pod-autoscaler/pkg/admission-controller Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,18 @@ distinguished_name = req_distinguished_name
33
33
basicConstraints = CA:FALSE
34
34
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
35
35
extendedKeyUsage = clientAuth, serverAuth
36
+ subjectAltName = DNS:vpa-webhook.kube-system.svc
36
37
EOF
37
38
38
39
# Create a certificate authority
39
40
openssl genrsa -out ${TMP_DIR} /caKey.pem 2048
40
- openssl req -x509 -new -nodes -key ${TMP_DIR} /caKey.pem -days 100000 -out ${TMP_DIR} /caCert.pem -subj " /CN=${CN_BASE} _ca"
41
+ openssl req -x509 -new -nodes -key ${TMP_DIR} /caKey.pem -days 100000 -out ${TMP_DIR} /caCert.pem -subj " /CN=${CN_BASE} _ca" -addext " subjectAltName = DNS: ${CN_BASE} _ca "
41
42
42
43
# Create a server certiticate
43
44
openssl genrsa -out ${TMP_DIR} /serverKey.pem 2048
44
45
# Note the CN is the DNS name of the service of the webhook.
45
- openssl req -new -key ${TMP_DIR} /serverKey.pem -out ${TMP_DIR} /server.csr -subj " /CN=vpa-webhook.kube-system.svc" -config ${TMP_DIR} /server.conf
46
- openssl x509 -req -in ${TMP_DIR} /server.csr -CA ${TMP_DIR} /caCert.pem -CAkey ${TMP_DIR} /caKey.pem -CAcreateserial -out ${TMP_DIR} /serverCert.pem -days 100000 -extensions v3_req -extfile ${TMP_DIR} /server.conf
46
+ openssl req -new -key ${TMP_DIR} /serverKey.pem -out ${TMP_DIR} /server.csr -subj " /CN=vpa-webhook.kube-system.svc" -config ${TMP_DIR} /server.conf -addext " subjectAltName = DNS:vpa-webhook.kube-system.svc "
47
+ openssl x509 -req -in ${TMP_DIR} /server.csr -CA ${TMP_DIR} /caCert.pem -CAkey ${TMP_DIR} /caKey.pem -CAcreateserial -out ${TMP_DIR} /serverCert.pem -days 100000 -extensions SAN -extensions v3_req -extfile ${TMP_DIR} /server.conf
47
48
48
49
echo " Uploading certs to the cluster."
49
50
kubectl create secret --namespace=kube-system generic vpa-tls-certs --from-file=${TMP_DIR} /caKey.pem --from-file=${TMP_DIR} /caCert.pem --from-file=${TMP_DIR} /serverKey.pem --from-file=${TMP_DIR} /serverCert.pem
You can’t perform that action at this time.
0 commit comments