小编jog*_*aco的帖子

Kubernetes - 将 jks 文件存储在 secrets 或 configMap 中

我有一个 keystore.jks 文件,我需要将它作为 docker 进程的 env 变量传递。

我使用以下命令将文件存储为机密。

kubectl 创建秘密通用 ssl-keystore-cert --from-file=./keystore.jks

在我的 deployment.yaml 中使用上述秘密,如下所示。

{
            "name": "SERVER_SSL_KEYSTORE",
            "valueFrom": {
              "secretKeyRef": {
                "name": "ssl-keystore-cert",
                "key": "keystore.jks"
              }
            }
          }
Run Code Online (Sandbox Code Playgroud)

错误:无法启动容器“app-service”:来自守护进程的错误响应:oci 运行时错误:container_linux.go:265:启动容器进程导致“process_linux.go:368:容器初始化导致\”setenv:无效参数\“”回退重启失败的容器

反正有没有将 keystore.jks 存储在 secret 或 configmap 中?

调试:-

kubectl 描述秘密 ssl-keystore-cert

Name:         ssl-keystore-cert
Labels:       <none>
Annotations:  <none>

Type:  Opaque

Data
====
keystore.jks:  4818 bytes
Run Code Online (Sandbox Code Playgroud)

kubernetes

5
推荐指数
1
解决办法
1万
查看次数

如何在没有控制器的情况下保护rspec_api_documentation apitome路由

我有一组API文档页面,我想使用设计密码保护.使用rspec_api_documentation生成文档.gem使用rspec来执行API方法并创建html或json doc文件.我正在生成json并使用另一个gem,apitome作为查看器.

这一切都很漂亮,我的api文档可以在/ api/docs找到,但我无法弄清楚如何要求身份验证来查看文档.

通过apitome查看文档,因此它使用rails.routes.rb中没有路由,但apitom初始化程序会安装文档.

从apitom初始化器:

# This determines where the Apitome routes will be mounted. Changing this to "/api/documentation" for instance would
# allow you to browse to http://localhost:3000/api/documentation to see your api documentation. Set to nil and mount
# it yourself if you need to.
config.mount_at = "/api/docs"
Run Code Online (Sandbox Code Playgroud)

https://github.com/zipmark/rspec_api_documentation

https://github.com/modeset/apitome

我发现这个How-to应该会使网站上的每个页面都需要进行身份验证,但我仍然可以在不登录的情况下点击文档URL.

#https://github.com/plataformatec/devise/wiki/How-To:-Require-authentication-for-all-pages
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

rspec ruby-on-rails devise

2
推荐指数
1
解决办法
1176
查看次数

标签 统计

devise ×1

kubernetes ×1

rspec ×1

ruby-on-rails ×1