为什么当我指定 https 时,hashicorpVault 的 kubernetes 就绪探针会命中 http?

发布于 2025-01-12 17:01:10 字数 468 浏览 3 评论 0原文

我的就绪探针指定 HTTPS 和 8200 作为检查我的 hashcorpVault pod 的端口。

  readinessProbe:
    httpGet:
      scheme: HTTPS
      path: '/v1/sys/health?activecode=200'
      port: 8200

一旦 pod 运行 kubectl describe pod 就会显示这一点

Readiness probe failed: Error checking seal status: Error making API request.

URL: GET http://127.0.0.1:8200/v1/sys/seal-status
Code: 400. Raw Message:

Client sent an HTTP request to an HTTPS server.

My readiness probe specifies HTTPS and 8200 as the port to check my hashicorp vault pod.

  readinessProbe:
    httpGet:
      scheme: HTTPS
      path: '/v1/sys/health?activecode=200'
      port: 8200

Once the pod is running kubectl describe pod shows this

Readiness probe failed: Error checking seal status: Error making API request.

URL: GET http://127.0.0.1:8200/v1/sys/seal-status
Code: 400. Raw Message:

Client sent an HTTP request to an HTTPS server.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不念旧人 2025-01-19 17:01:10

我发现 这个类似的问题。请参阅此处的完整答案

根据 此文档

http/https 方案由 tlsDisable 值控制。

当设置为 true 时,会将 URL 从 https 更改为 http(例如 VAULT_ADDR=http://127.0.0.1)。 0.1:8200 在 Vault Pod 上设置的环境变量)。

要将其关闭:

global:
  tlsDisable: false

注意
Vault 应始终在生产中与 TLS 结合使用,以提供安全通信客户端和 Vault 服务器。它需要运行 Vault 的每台主机上都有一个证书文件和密钥文件。


另请参阅此文档。人们可以找到许多使用就绪性和活性探针的示例,例如

    readinessProbe:
      exec:
        command:
        - /bin/sh
        - -ec
        - vault status
      initialDelaySeconds: 5
      periodSeconds: 5

I have found this similar problem. See the whole answer here.

According to this documentation:

The http/https scheme is controlled by the tlsDisable value.

When set to true, changes URLs from https to http (such as the VAULT_ADDR=http://127.0.0.1:8200 environment variable set on the Vault pods).

To turn it off:

global:
  tlsDisable: false

NOTE:
Vault should always be used with TLS in production to provide secure communication between clients and the Vault server. It requires a certificate file and key file on each host where Vault is running.


See also this documentation. One can find there many examples of using readiness and liveness probes, f.e

    readinessProbe:
      exec:
        command:
        - /bin/sh
        - -ec
        - vault status
      initialDelaySeconds: 5
      periodSeconds: 5
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文