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년 전972회 조회
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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인