简体   繁体   中英

HTTPS with Azure Container Services and Kubernetes

Can anyone show how to setup https on kubernetes in ACS? Most tutorials suggest to use LetsEncrypt but does not seem to fit my case as I have an existing .pfx i would like to use.

I created the az acs using the following cli command:

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

and once everything got created i used the following command to spin up my services and deployments

kubectl create -f myApp.yaml

where myApp.yaml reads as following:

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

which gets my app working as intended for http:// but I am not too sure what my next steps are to get https:// working. Any helpful links also are appreciated.

Ps my app is a net core 2.0 hosted in kestrel.

Maybe we can use Nginx Ingress Controller to archive that in ACS.

The Ingress Controller works like this:

在此处输入图片说明

We can follow this steps to do it:

1 Deploy the Nginx Ingress controller
2 Create TLS certificates
3 Deploy test http service
4 configure TLS termination
More information about configure Nginx Ingress Controller for TLS termination on Kubernetes on Azure, please refer to this blog .

Here a similar case , please refer to it.

By the way, here a example about configure Ingress on kubernetes using Azure Container service, please refer to it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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