查看k8s secrets证书有效期

1.查看secrets内容

root@tsp-prod-ansible:~#  kubectl edit secrets -n istio-system istio-ca-secret #以istio CA证书为例

 二、解密secrets内容

[root@k8s-master ~]# echo "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMzakNDQWNhZ0F3SUJBZ0lSQUtSZGtRZzlLYnVwa1d1K0dBZTkxRVl3RFFZSktvWklodmNOQVFFTEJRQXcKR0RFV01CUUdBMVVFQ2hNTlkyeDFjM1JsY2k1c2IyTmhiREFlRncweE9URXhNRFV3T0RVM01USmFGdzB5T1RFeApNREl3T0RVM01USmFNQmd4RmpBVUJnTlZCQW9URFdOc2RYTjBaWEl1Ykc5allXd3dnZ0VpTUEwR0NTcUdTSWIzCkRRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRFNMOUhOUzl1b2RkWWlwejRYcWZWZ29wRDR4MHpBYnJpbUNXa1QKelcvRXVIaWdiWmdiNGw3NElxVkNnWTlVbDJnQitVcHVyNUQwbHVvaVBQV3JydlQxOGJCdE94VmpzdmxEenJLcgpiNms1VGkrWG5KQXcySUMrbVh5bVZyQyttR2x2MUpWQnJRR2RhcjdpWTVUa3VOWUxYWEVJaWNPZktZRmF3L2lhCjJwTlhScXNVSnJ4akZMQTZNTHFwajY5SEJSOGR6anlNTFR5VzdaZGtxOVROam54OThvSjM0VmhEKzBxTDg0M2QKZ3JDV0xqSTgwSzcvVjllUWNUa1hsaHB6bTBDdmJyOGhRTDFiclZiVnc0UTR6c2grVnNGREs5OTcvN3hBaHJmQQo4V2ZGR2ROTnRWWFcvZjZXRDRpelAwVWpaUnppRXhsYlpYbGZFU2xvMlpvRUphQlZBZ01CQUFHakl6QWhNQTRHCkExVWREd0VCL3dRRUF3SUNCREFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUIKQVFDd0c3RkxibGluL3JKV0Z0NW9QTWYzN0daRCtiajkvbEpMY3ZYOE9pbW5v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gMBAAGjIzAhMA4G
A1UdDwEB/wQEAwICBDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IB
AQCwG7FLblin/rJWFt5oPMf37GZD+bj9/lJLcvX8OimnobASIlkIW5KVIwqYhQwB
yosaOuZY2DrXFG2SOZdx54WgCZt10DP7kFiGInrFAq5lXQkRE8id8JISPxq/e97b
P0drLtYDk4fBPc/ZLcw5hapdr9jzVd5/p60+k6T1WhBGeoUCmkVqASR1DYWgli9m
MPlaIgABpYHSJzvNtiWn766jo3nIL1d3FvLn3NPKwqbJeEtt2g94iL8MUE4tUigF
5DB2eO/5i/f2O7N2awswpl7qpl4XJRIskq8o1PEqYzIxJm9wjWGXF8S7qHFwfFAZ
zzlLdXmFeAqIzdQwjTLeJrkd
-----END CERTIFICATE-----

三、使用openssl查看

 

posted @ 2022-10-19 11:04  百衲本  阅读(649)  评论(0编辑  收藏  举报
cnblogs_post_body { color: black; font: 0.875em/1.5em "微软雅黑" , "PTSans" , "Arial" ,sans-serif; font-size: 15px; } cnblogs_post_body h1 { text-align:center; background: #333366; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 23px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } cnblogs_post_body h2 { text-align:center; background: #006699; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 20px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } cnblogs_post_body h3 { background: #2B6695; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 18px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } 回到顶部 博客侧边栏 回到顶部 页首代码 回到顶部 页脚代码