akka - Enable HTTPS for Akka-Discovery Endpoints while forming akka-cluster in kubernetes environment
问题描述
I need to setup up an Akka-Cluster (using Akka Classic) in Kubernetes using DNS-resolver. I've created a headless-service which is able to resolve address for various pods of my Akka application. After DNS resolving, I'm able to get addresses for various pods. Now my Akka-Management runs over Https,
So while one pod tries connecting to management endpoints of various other pods, It needs to use "HTTPS" instead of "HTTP" but Akka by default uses "http". Is there a way to modify this behavior in Java
解决方案
是的,有:要启用 HTTPS,您必须通过向其提供HttpsConnectionContext
对象来实例化您的服务器。
您可能应该执行以下操作:
Http.get(system).newServerAt("localhost", 8080)
.enableHttps(createHttpsContext(system))
.bind(app.createRoute());
前面的示例取自官方文档,其中也展示了该createHttpsContext(system)
方法的工作原理。
推荐阅读
- php - 数组查询 - 转换此数组的最有效方法是什么?
- python - 增加自动缩放组的最大大小的 Lambda 问题
- javascript - 我需要推荐结构以使用 Cytoscape js
- office-js - 如何将 Office displayDialogAsync 与 oauth 库一起使用
- visual-studio-code - 如何在 Visual Studio 代码中自定义选项卡标题的字体大小
- reactjs - 如何在reactjs中将名称标签字体左对齐
- c++ - 我正在尝试对运算符“+”进行二进制重载,但输出错误,我不明白为什么?
- ionic-framework - 增加离子输入文本的字体大小
- python - 如何将此带有二进制数据的 curl 写入 python?
- django - django 表 2 - 删除继承表的列和 delete_item