configure SSL in cluster of kubernetes

0

i have kubernetes cluster running on aws EKS.

But problem is that I need to run app through HTTPS(ssl) protocol

we have docker image in aws ECR.we also have certificate key file and chain file for ssl.how do we configure it with kubernetes? so container will run in https

right now it's running like http://www.abc.com .It's should be like https://www.abc.com

  1. push code in github (Done)

  2. create docker image (Done)

  3. push docker image to aws ECR (Done)

  4. pull image from aws ecr and run with kubernetes cluster (Done)

  5. work on http protocol on 80 port (done) http://www.abc.com

  6. bind domain to cluster end point(done)

  7. configure SSL (Not done) https://www.abc.com

Anybody have suggestions?

已提問 5 年前檢視次數 973 次
2 個答案
0
已接受的答案

To run the application or setup SSL and TLS on kubernetes best practices suggest to use cert-manager & ingress.

Ingress works as the gateway and expose the service to the outside world and manage the connection.

While cert-manager use for manage the SSL certificates for domains. you can follow this guide to setup ingress and cert-manager:

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes

已回答 5 年前
0

Here's one way to do it:

Examples

This ingress creates an ALB with port 443 (HTTPS)
The certificate is added via annotation alb.ingress.kubernetes.io/certificate-arn

At a very high level, traffic flow would be:
(client) -> HTTPS/443 -> (ALB) -> traffic decrypted by ALB & forwarded to service -> (POD)

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: app-ingress
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/subnets: subnet-x, subnet-x
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 443}]'
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:REGION:x:certificate/xxx
spec:
  ingressClassName: alb
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: service-name-here
                port:
                  number: 80
已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南