nitish gavankar:
Lab related Question:
The kube-api server stopped again! Check it out. Inspect the kube-api server logs and identify the root cause and fix the issue.
Run crictl ps -a command to identify the kube-api server container. Run crictl logs container-id command to view the logs.
So the Answer is the - --etcd-cafile=/etc/kubernetes/pki/ca.crt this was set incorrectly.
But How will I know which is the correct CA ?
}. Err: connection error: desc = "transport: authentication handshake failed: tls: failed to verify certificate: x509: certificate signed by unknown authority"
W0817 14:07:55.606233 1 logging.go:59] [core] [Channel #1 SubChannel #2] grpc: addrConn.createTransport failed to connect to {
"Addr": "127.0.0.1:2379", ---------->
"ServerName": "127.0.0.1",
"Attributes": null,
"BalancerAttributes": null,
"Type": 0,
"Metadata": null
Based on this I guessed that there is something wrong with ETCD
"Addr": "127.0.0.1:2379", ---------->
But I didnt understand how shall I conclude that the CA certificate was wrong.
Coz all 3 ETCD related files are located in */pki folder. Only the CA file should be from */pki/etcd folder
- –etcd-cafile=/etc/kubernetes/pki/ca.crt
- –etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt
- –etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key
Does that mean, for every Kube-apiserver, the CA.crt file provided for etcd should be ETCD CA only and cant be Kube-apiserver CA?