简体   繁体   English

Kubernetes Google容器引擎。 配置Spring Boot HTTPS

[英]Kubernetes Google container engine. Configuring Spring Boot HTTPS

I have configured Spring Boot to use HTTPS via application.properties. 我已经将Spring Boot配置为通过application.properties使用HTTPS。

server.port: 8443
server.ssl.key-store=keystore.jks
server.ssl.key-store-password=password

The JKS file is a self signed certificate in / with the web app jar . JKS文件是Web应用程序jar中的自签名证书。 My Kubernetes replication controller has the port 8443 configured for the docker image thats running the Spring Boot app. 我的Kubernetes复制控制器具有为运行Spring Boot应用程序的Docker映像配置的端口8443。 I have a service configured for the replication controller exposing 8443. 我为复制控制器暴露了8443配置了服务。

When I go to LoadBalancer Ingress IP :8443 in the browser I get 'no data from server' 当我在浏览器中转到LoadBalancer Ingress IP:8443时,“没有来自服务器的数据”

What is the correct way of configuring HTTPS load balancing a Spring Boot application on the Google container engine. 在Google容器引擎上配置HTTPS负载均衡Spring Boot应用程序的正确方法是什么。

Cheers, Ian 干杯,伊恩

I have followed this guide and it`s working on my side. 我遵循了本指南,它在我的身边工作。 https://github.com/mkjelland/spring-boot-postgres-on-k8s-sample https://github.com/mkjelland/spring-boot-postgres-on-k8s-sample

Here you can find spring boot yaml https://github.com/mkjelland/spring-boot-postgres-on-k8s-sample/blob/master/specs/postgres.yml 在这里您可以找到Spring Boot Yaml https://github.com/mkjelland/spring-boot-postgres-on-k8s-sample/blob/master/specs/postgres.yml

Plese expose the resource with 请使用以下方式公开资源

kubectl expose deployment YOUR_DEPLOYMENT --type=LoadBalancer --port=8443

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM