【问题标题】:How to expose vault HTTPS API that installed in k8s to outside clients如何将安装在 k8s 中的 Vault HTTPS API 暴露给外部客户端
【发布时间】:2023-03-04 10:40:01
【问题描述】:

我在查找有关如何向外部客户端公开 HTTPS API 的解释时遇到问题。
Vault on Kubernetes Reference Architecture
页面以本页末尾的简短说明结束,没有关于如何操作的更多信息 将 Vault HTTPS API 配置为可供外界访问。
这个tutorial 使用禁用 TLS
或者这个tutorial
它在 minicube 上工作,它的行为与真正的 k8s 不同,而且它也没有 TLS
the funny thing is that the main tutorial configuration the vault server cluster in k8s do use TLS

我只想用 TLS 制作 curl API,它会给我我设置的密码
我该怎么做?

【问题讨论】:

    标签: ssl kubernetes https client hashicorp-vault


    【解决方案1】:

    将服务/pod 端口转发到使用 CLI 的本地计算机后,您可以使用 VAULT_SKIP_VERIFY 跳过证书验证。

    $ kubectl port-forward ... ...
    
    // export your https url
    $ export VAULT_ADDR=https://127.0.0.1:8200
    
    // vault token
    $ export VAULT_TOKEN= "****"
    
    // set true 
    $ export VAULT_SKIP_VERIFY=true
    
    

    现在,您可以使用保管库 CLI。

    $ vault status
    Key             Value
    ---             -----
    Seal Type       shamir
    Initialized     true
    Sealed          false
    ... ... ... 
    

    【讨论】:

    • 我不使用什么port forword kubectl,我喜欢直接连接到Vault
    • @user63898 然后使用url
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-07
    • 2019-04-24
    • 2023-03-17
    • 2013-08-30
    • 1970-01-01
    • 2023-04-05
    相关资源
    最近更新 更多