背景需求:
有多个域名,且每个域名走HTTPS
示例架构:
测试环境:
公有云提供Kubernetes环境,自动创建负载均衡IP
示例步骤:
1. 创建一个Deployment
2. 创建一个Service
3. 创建2个证书和2个密钥文件
4. 创建使用Secret和Ingress
5. 测试HTTPS(负载均衡IP)
具体配置:
1. 准备一个Deployment文件 my-mc-deployment.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: my-mc-deployment spec: selector: matchLabels: app: products department: sales replicas: 3 template: metadata: labels: app: products department: sales spec: containers: - name: hello image: "gcr.io/google-samples/hello-app:2.0" env: - name: "PORT" value: "50001" - name: hello-again image: "gcr.io/google-samples/node-hello:1.0" env: - name: "PORT" value: "50002"