zoux86 / blog

0 stars 0 forks source link

post/2021-7-17-k8s-gc%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/ #4

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

k8s gc controller源码分析 | zoux的博客

k8s gc controller源码分析

https://zoux86.github.io/post/2021-7-17-k8s-gc%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/

nayihz commented 1 year ago

您好,请教一下这里是如何实现使用http而不是https请求的?

# curl http://127.0.0.1:10252/debug/controllers/garbagecollector/graph?uid=639d5269-d73d-4964-a7de-d6f386c9c7e4
zoux86 commented 1 year ago

看你的kcm版本。将端口换成 --secure-port 指定的端口。然后类似这样。替换证书文件路径即可

curl https://{ip}:{port}/xxx --cacert {ca.crt} --cert {cert.crt} --key {key.pem}

         see --bind-address instead.)
  --port int
            The port on which to serve unsecured, unauthenticated access. Set to 0 to disable. (default 10252) (DEPRECATED: see --secure-port instead.)
nayihz commented 1 year ago

这还是用https而不是http呀?我看你文章里贴的地址是http的

zoux86 commented 1 year ago

你到底要用http还是https呀。http就是文章说的那种方式。https就是上面回答的方式

nayihz commented 1 year ago

想用http。如果直接按照文章里说的使用 curl http://127.0.0.1:10257/debug/controllers/garbagecollector/graph?uid=xxxxxx会报错 Client sent an HTTP request to an HTTPS server.。可以在某个地方关掉https?还是只能在低版本使用http,高版本不再支持http了?我用的1.26

zoux86 commented 1 year ago

高版本不支持了。这里写了,http方式抛弃了,要用https, 端口通过--secure-port 指定 --port int The port on which to serve unsecured, unauthenticated access. Set to 0 to disable. (default 10252) (DEPRECATED: see --secure-port instead.)