cnrancher / kube-explorer

A portable explorer for Kubernetes, without any dependency.
Apache License 2.0
215 stars 26 forks source link

Incorrect certificate expiration time #17

Closed niusmallnan closed 1 year ago

niusmallnan commented 1 year ago

Kube-explorer: v0.2.9(UI v2.6.5-kube-explorer-ui-rc1)

Install K3s, and use kube-explorer to connect it. Take k3s-serving as an example, it is a secret of type kubernetes.io/tls.

Use openssl to view the expiration time as follows:

kubectl --insecure-skip-tls-verify  get secret -n kube-system k3s-serving -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -text | grep Not
            Not Before: Jul 22 05:40:32 2022 GMT
            Not After : Jul 22 05:40:32 2023 GMT

However, the expiry time displayed in the Explorer UI is different.

截屏2022-07-22 下午2 31 03
ly5156 commented 1 year ago

@niusmallnan

  1. I tested and verified (v2.6.7-rc5-kube-explorer-ui-rc1)that the time displayed on ui is adjusted for the time zone
image
  1. Before v2.6.5, if you adjust the date format, it will cause the date parsing error because of this issue:https://github.com/rancher/dashboard/issues/5979
niusmallnan commented 1 year ago

Not sure if this is related to the version of K3s, when this display problem occurs, two certificates are saved in the secret. This means that content like this can be seen twice. -----BEGIN CERTIFICATE-----xxx-----END CERTIFICATE-----

When parsing with openssl, it will only return the first certificate information. However, parsing in the UI returns the information for the second certificate.

niusmallnan commented 1 year ago

Let's track this here. https://github.com/rancher/dashboard/issues/6595

ly5156 commented 1 year ago

相关联的 issue:https://github.com/rancher/dashboard/issues/7081 对应的 milstone v2.7.2,以及相关 pr 已经合并

niusmallnan commented 1 year ago

Fixed by v0.3.2.