Closed ghost closed 4 years ago
Although the switch to the 0.8 branch comes, the unknown option-addext is still displayed when deploying
[root@ma vertical-pod-autoscaler]# git branch
master
* remotes/origin/vpa-release-0.8
[root@ma vertical-pod-autoscaler]# ls
builder common deploy e2e examples FAQ.md go.mod go.sum hack MIGRATE.md OWNERS pkg README.md vendor
[root@ma vertical-pod-autoscaler]# cd hack/
[root@ma hack]# ls
boilerplate.go.txt deploy-for-e2e.sh run-e2e-tests.sh update-kubernetes-deps-in-e2e.sh vpa-apply-upgrade.sh vpa-process-yaml.sh vpa-up.sh
convert-alpha-objects.sh run-e2e.sh update-codegen.sh verify-codegen.sh vpa-down.sh vpa-process-yamls.sh warn-obsolete-vpa-objects.sh
[root@ma hack]# ./vpa-up.sh
customresourcedefinition.apiextensions.k8s.io/verticalpodautoscalers.autoscaling.k8s.io created
customresourcedefinition.apiextensions.k8s.io/verticalpodautoscalercheckpoints.autoscaling.k8s.io created
clusterrole.rbac.authorization.k8s.io/system:metrics-reader created
clusterrole.rbac.authorization.k8s.io/system:vpa-actor created
clusterrole.rbac.authorization.k8s.io/system:vpa-checkpoint-actor created
clusterrole.rbac.authorization.k8s.io/system:evictioner created
clusterrolebinding.rbac.authorization.k8s.io/system:metrics-reader created
clusterrolebinding.rbac.authorization.k8s.io/system:vpa-actor created
clusterrolebinding.rbac.authorization.k8s.io/system:vpa-checkpoint-actor created
clusterrole.rbac.authorization.k8s.io/system:vpa-target-reader created
clusterrolebinding.rbac.authorization.k8s.io/system:vpa-target-reader-binding created
clusterrolebinding.rbac.authorization.k8s.io/system:vpa-evictionter-binding created
serviceaccount/vpa-admission-controller created
clusterrole.rbac.authorization.k8s.io/system:vpa-admission-controller created
clusterrolebinding.rbac.authorization.k8s.io/system:vpa-admission-controller created
clusterrole.rbac.authorization.k8s.io/system:vpa-status-reader created
clusterrolebinding.rbac.authorization.k8s.io/system:vpa-status-reader-binding created
serviceaccount/vpa-updater created
deployment.apps/vpa-updater created
serviceaccount/vpa-recommender created
deployment.apps/vpa-recommender created
Generating certs for the VPA Admission Controller in /tmp/vpa-certs.
Generating RSA private key, 2048 bit long modulus
......................................................................................................................................................+++
.....................................................................................................................+++
e is 65537 (0x10001)
unknown option -addext
req [options] <infile >outfile
where options are
This should not happen, the gencerts.sh script does not use -addext option in vpa-release-0.8 branch: https://github.com/kubernetes/autoscaler/blob/vpa-release-0.8/vertical-pod-autoscaler/pkg/admission-controller/gencerts.sh
Can you verify the contents of gencerts.sh in your setup?
$ cat pkg/admission-controller/gencerts.sh
Just out of curiosity, which openssl version supports the -addtext
option?
1.1.1 seems to have it: https://www.openssl.org/docs/man1.1.1/man1/req.html
Am on 1.1.1g on Mac, still throws error that option doesn't exist
How do I verify that? This is my file
[root@master vertical-pod-autoscaler]# cat pkg/admission-controller/gencerts.sh
#!/bin/bash
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Generates the a CA cert, a server key, and a server cert signed by the CA.
# reference:
# https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/admission/webhook/gencerts.sh
set -e
CN_BASE="vpa_webhook"
TMP_DIR="/tmp/vpa-certs"
echo "Generating certs for the VPA Admission Controller in ${TMP_DIR}."
mkdir -p ${TMP_DIR}
cat > ${TMP_DIR}/server.conf << EOF
[req]
req_extensions = v3_req
distinguished_name = req_distinguished_name
[req_distinguished_name]
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth, serverAuth
subjectAltName = DNS:vpa-webhook.kube-system.svc
EOF
# Create a certificate authority
openssl genrsa -out ${TMP_DIR}/caKey.pem 2048
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"
# Create a server certiticate
openssl genrsa -out ${TMP_DIR}/serverKey.pem 2048
# Note the CN is the DNS name of the service of the webhook.
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"
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
echo "Uploading certs to the cluster."
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
# Clean up after we're done.
echo "Deleting ${TMP_DIR}."
rm -rf ${TMP_DIR}
This is the master version of the file, not from the vpa-release-0.8 branch
I have a script that setup VPA (search for verticalpodautoscaler()
in the file) that used to work just fine until a few weeks ago and it started to give me a black eye recently with the exact same error.
I am basically just cloning https://github.com/kubernetes/autoscaler.git
and then running ./autoscaler/vertical-pod-autoscaler/hack/vpa-up.sh
.
I am using Amazon Linux and my openssl version is (and has always been) this:
sh-4.2# openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017
sh-4.2#
I recommend checking out vpa-release-0.8 branch instead of master in that case.
The change in master is needed as otherwise the webhook will not be able to install on k8s 1.20.X clusters.
Thanks @bskiba. Out of curiosity, should I want to stick to master, what would I need to do? In other words what's breaking it? is it the openssl version? Thanks.
Okay, I've fixed the problem and just need to upgrade OpensSL to 1.1.1
kube-system vpa-admission-controller-69c96bd8bd-4st7v 1/1 Running 0 39s
kube-system vpa-recommender-765b6c5f59-rdxk4 1/1 Running 0 45s
kube-system vpa-updater-86865896cf-z8bxn 1/1 Running 0 50s
@mreferre yes, the openssl version you use needs to support -addext argument @zhaocheng173 Glad that it's working for you
/close
@bskiba: Closing this issue.
When I created the VPA, there was no error, I created the VPA-admissions-Controller and found no VPA-TLs-Certs