背景需求:

有多个域名,且每个域名走HTTPS

 

示例架构:

kubernetes的ingress配置多个tls证书

 

 

测试环境:

公有云提供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"
View Code

相关文章:

  • 2021-05-22
  • 2021-06-19
  • 2021-11-20
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2021-05-22
  • 2021-06-17
  • 2021-12-26
  • 2021-06-19
  • 2022-12-23
相关资源
相似解决方案