首页 文章

使用Azure容器服务和Kubernetes的HTTPS

提问于
浏览
0

任何人都可以展示如何在ACS的kubernetes上设置https?大多数教程建议使用LetsEncrypt,但似乎不适合我的情况,因为我有一个现有的.pfx我想使用 .

我使用以下cli命令创建了az acs:

az acs create --orchestrator-type kubernetes --resource-group myResourceGroup --name myAppName --generate-ssh-keys

一旦创建了所有内容,我就使用以下命令来启动我的服务和部署

kubectl create -f myApp.yaml

myApp.yaml的内容如下:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: myApp-deployment
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: myApp
    spec:
      containers:
      - name: myApp
        image: myAppcontainerregistry.azurecr.io/myApp-images:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: myAppservice
spec:
  type: LoadBalancer
  ports:
  - port: 80
  selector:
    app: myApp

这让我的应用程序按照http://的预期工作,但我不太清楚我的下一步是什么让https://工作 . 任何有用的链接也表示赞赏 .

附:我的应用程序是在kestrel中托管的网络核心2.0 .

1 回答

  • 1

    也许我们可以使用 Nginx Ingress Controller 将其存档在ACS中 .

    Ingress控制器的工作方式如下:

    enter image description here

    我们可以按照以下步骤执行此操作:

    1部署Nginx Ingress控制器
    2创建TLS证书
    3部署测试http服务
    4配置TLS终止
    有关在Azure上的Kubernetes上配置Nginx Ingress Controller以进行TLS终止的更多信息,请参阅此blog .

    这里有一个similar case,请参考它 .

    顺便说一句,在这里a example关于使用Azure容器服务在kubernetes上配置Ingress,请参考它 .

相关问题