Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all knative pods are in 'CrashLoopBackOff' with "Failed to get k8s version" error #15208

Open
snailshadow opened this issue May 15, 2024 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-user-input Issues which are waiting on a response from the reporter

Comments

@snailshadow
Copy link

snailshadow commented May 15, 2024

In what area(s)?

build
test-and-release

Other classifications:
This is the first issue when I try to installl knative on a fresh AKS cluster

What version of Knative?

knative version : 1.13.1
k8s cluster version:
image

Expected Behavior

'webhook' and 'activator' and 'autoscaler' and 'controller' pods should be in status running.

Actual Behavior

'webhook' and 'activator' and 'autoscaler' and 'controller' pods are in 'CrashLoopBackOff' and won't run.

Steps to Reproduce the Problem

kubectl apply -f crds.yaml
kubectl apply -f core.yaml
image
image
image

Both log see same error cause. 'Failed to get k8s version'
image
I use kubectl -n knative-serving get pods activator -o yaml to the details of pod.I see ca.crt already mount under pod, so why can not verify the certificate of api-server.
image
I use curl command to test ca.crt in a testbox container. it is working fine
image

Is there a workaroud to not verify the certificate of api-server , like "curl -k"

@snailshadow snailshadow added the kind/bug Categorizes issue or PR as related to a bug. label May 15, 2024
@skonto
Copy link
Contributor

skonto commented May 15, 2024

Hi @snailshadow what is the output if you run:

kubectl -it exec <activator> -- curl -v -k https://<api-server>:443/version?timeout=32s
kubectl -it exec <activator> -- curl -v --header "Authorization..." --cacert <path to sa> https://<api-server>:443/version?timeout=32s

@snailshadow
Copy link
Author

@skonto pod is not ready , so I am unable to run these two commands to verify the certificate of k8s api-server

@skonto
Copy link
Contributor

skonto commented May 21, 2024

Activator should be no different it uses the K8s sa crt and token. Do you use a custom activator image or an upstream release? Another possible reason you see this is that certificates are not setup correctly for some reason on your cluster, what happens if you rotate them (https://learn.microsoft.com/en-us/azure/aks/certificate-rotation)? Do you see any difference when you run the nginx pod in the knative-serving ns?

pod is not ready , so I am unable to run these two commands to verify the certificate of k8s api-server

One option would be to modify the activator image to run the commands when it starts or try a PostStart hook (might run after the entrypoint).

@dprotaso
Copy link
Member

/triage needs-user-input

@knative-prow knative-prow bot added the triage/needs-user-input Issues which are waiting on a response from the reporter label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-user-input Issues which are waiting on a response from the reporter
Projects
None yet
Development

No branches or pull requests

3 participants