knative / serving

Kubernetes-based, scale-to-zero, request-driven compute
https://knative.dev/docs/serving/
Apache License 2.0
5.57k stars 1.16k forks source link

Problem with installing the old version. After installation, webhook cannot find the certificate #15614

Open vonsago opened 4 days ago

vonsago commented 4 days ago

Because it is an intranet, the network is not connected, I pull & tag & push the images of knative-operator, operator-webhook, activator, autoscaler, controller and webhook etc.

I try to install knative like doc do.

BTW, my k8s is vcluster witch version is 1.24.16

kubectl apply -f operator.yaml 
kubectl apply -f serving-crds.yaml 
kubectl apply -f serving-core.yaml 

The knative version is 1.8 which I try to install.

But I get an error: `{"severity":"ERROR","timestamp":"2024-11-14T08:06:02.753747884Z","logger":"webhook","caller":"webhook/webhook.go:148","message":"failed to fetch secret","commit":"8d996d9-dirty","knative.dev/pod":"webhook-7f678b758-9vvtg","error":"secret \"operator-webhook-certs\" not found","stacktrace":"knative.dev/pkg/webhook.New.func2\n\tknative.dev/pkg@v0.0.0-20221014164553-b812affa3893/webhook/webhook.go:148\ncrypto/tls.(Config).getCertificate\n\tcrypto/tls/common.go:1064\ncrypto/tls.(serverHandshakeStateTLS13).pickCertificate\n\tcrypto/tls/handshake_server_tls13.go:363\ncrypto/tls.(serverHandshakeStateTLS13).handshake\n\tcrypto/tls/handshake_server_tls13.go:55\ncrypto/tls.(Conn).serverHandshake\n\tcrypto/tls/handshake_server.go:54\ncrypto/tls.(Conn).handshakeContext\n\tcrypto/tls/conn.go:1460\ncrypto/tls.(Conn).HandshakeContext\n\tcrypto/tls/conn.go:1403\nnet/http.(*conn).serve\n\tnet/http/server.go:1848"}

kubectl get secret -A|grep operator-webhook-certs knative-operator operator-webhook-certs Opaque 3 18h `

skonto commented 3 days ago

Hi @vonsago, following the guide here https://knative.dev/docs/install/operator/knative-with-operators/#install-knative-serving you only need to apply the following:

kubectl apply -f https://github.com/knative/operator/releases/download/knative-v1.16.0/operator.yaml

Then the following yaml:

apiVersion: v1
kind: Namespace
metadata:
  name: knative-serving
---
apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
  name: knative-serving
  namespace: knative-serving
spec:
  ingress:
    kourier:
      enabled: true
  config:
    network:
      ingress-class: "kourier.ingress.networking.knative.dev"

I see you are installing with a mix of yamls. You can either install via the operator or via the Serving release yamls. With the above the images I see that you need at minimum are:

gcr.io/knative-releases/knative.dev/serving/cmd/autoscaler-hpa                     <none>         223af62181c4   7 weeks ago     54MB
gcr.io/knative-releases/knative.dev/serving/cmd/activator                          <none>         75d76ff65412   7 weeks ago     54.5MB
gcr.io/knative-releases/knative.dev/net-kourier/cmd/kourier                        <none>         26e26abb1c10   7 weeks ago     64.5MB
gcr.io/knative-releases/knative.dev/serving/cmd/webhook                            <none>         f2a42b55949f   7 weeks ago     54.1MB
gcr.io/knative-releases/knative.dev/serving/cmd/queue                              <none>         30f741ecde93   7 weeks ago     27.7MB
gcr.io/knative-releases/knative.dev/serving/cmd/autoscaler                         <none>         07d2818f44eb   7 weeks ago     54.9MB
gcr.io/knative-releases/knative.dev/serving/pkg/cleanup/cmd/cleanup                <none>         0351a8003a4c   7 weeks ago     39.1MB
gcr.io/knative-releases/knative.dev/serving/cmd/controller                         <none>         ea7dc6abf93e   7 weeks ago     61.8MB
gcr.io/knative-releases/knative.dev/pkg/apiextensions/storageversion/cmd/migrate   <none>         7a8a363a0d44   7 weeks ago     39.2MB
gcr.io/knative-releases/knative.dev/operator/cmd/webhook                           <none>         fbde99453fba   N/A             56.4MB
gcr.io/knative-releases/knative.dev/operator/cmd/operator                          <none>         0efcace96b1a   N/A             79.7MB
$ kubectl get po -n knative-serving
NAME                                                     READY   STATUS      RESTARTS   AGE
3scale-kourier-gateway-7f9db75546-7296j                  1/1     Running     0          7m42s
activator-d66fd5dd8-rt987                                1/1     Running     0          8m39s
autoscaler-6c7bf97997-25nks                              1/1     Running     0          8m38s
autoscaler-hpa-65d7968b4c-n9pbn                          1/1     Running     0          8m37s
cleanup-serving-serving-1.16.0-c2ghl                     0/1     Completed   0          8m36s
controller-5b54cd98c-x2lqr                               1/1     Running     0          8m38s
net-kourier-controller-cc48d56db-csz89                   1/1     Running     0          7m43s
storage-version-migration-serving-serving-1.16.0-nn8gw   0/1     Completed   0          8m36s
webhook-56ffd84996-5c5l2                                 1/1     Running     0          8m37s