查看k8s secrets证书有效期
1.查看secrets内容
root@tsp-prod-ansible:~# kubectl edit secrets -n istio-system istio-ca-secret #以istio CA证书为例
二、解密secrets内容
[root@k8s-master ~]# echo "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMzakNDQWNhZ0F3SUJBZ0lSQUtSZGtRZzlLYnVwa1d1K0dBZTkxRVl3RFFZSktvWklodmNOQVFFTEJRQXcKR0RFV01CUUdBMVVFQ2hNTlkyeDFjM1JsY2k1c2IyTmhiREFlRncweE9URXhNRFV3T0RVM01USmFGdzB5T1RFeApNREl3T0RVM01USmFNQmd4RmpBVUJnTlZCQW9URFdOc2RYTjBaWEl1Ykc5allXd3dnZ0VpTUEwR0NTcUdTSWIzCkRRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRFNMOUhOUzl1b2RkWWlwejRYcWZWZ29wRDR4MHpBYnJpbUNXa1QKelcvRXVIaWdiWmdiNGw3NElxVkNnWTlVbDJnQitVcHVyNUQwbHVvaVBQV3JydlQxOGJCdE94VmpzdmxEenJLcgpiNms1VGkrWG5KQXcySUMrbVh5bVZyQyttR2x2MUpWQnJRR2RhcjdpWTVUa3VOWUxYWEVJaWNPZktZRmF3L2lhCjJwTlhScXNVSnJ4akZMQTZNTHFwajY5SEJSOGR6anlNTFR5VzdaZGtxOVROam54OThvSjM0VmhEKzBxTDg0M2QKZ3JDV0xqSTgwSzcvVjllUWNUa1hsaHB6bTBDdmJyOGhRTDFiclZiVnc0UTR6c2grVnNGREs5OTcvN3hBaHJmQQo4V2ZGR2ROTnRWWFcvZjZXRDRpelAwVWpaUnppRXhsYlpYbGZFU2xvMlpvRUphQlZBZ01CQUFHakl6QWhNQTRHCkExVWREd0VCL3dRRUF3SUNCREFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUIKQVFDd0c3RkxibGluL3JKV0Z0NW9QTWYzN0daRCtiajkvbEpMY3ZYOE9pbW5vYk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BAAGjIzAhMA4G
A1UdDwEB/wQEAwICBDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IB
AQCwG7FLblin/rJWFt5oPMf37GZD+bj9/lJLcvX8OimnobASIlkIW5KVIwqYhQwB
yosaOuZY2DrXFG2SOZdx54WgCZt10DP7kFiGInrFAq5lXQkRE8id8JISPxq/e97b
P0drLtYDk4fBPc/ZLcw5hapdr9jzVd5/p60+k6T1WhBGeoUCmkVqASR1DYWgli9m
MPlaIgABpYHSJzvNtiWn766jo3nIL1d3FvLn3NPKwqbJeEtt2g94iL8MUE4tUigF
5DB2eO/5i/f2O7N2awswpl7qpl4XJRIskq8o1PEqYzIxJm9wjWGXF8S7qHFwfFAZ
zzlLdXmFeAqIzdQwjTLeJrkd
-----END CERTIFICATE-----
三、使用openssl查看
"一劳永逸" 的话,有是有的,而 "一劳永逸" 的事却极少