How can I install SSL certificate to aws load balancer in kubernetes?

6/1/2018

I got yaml file for specifying ssl certificate (provided by aws certificate manager)to load balancer for kubernetes deployment. But, we are running kubernetes cluster in aws china account where certification manager option is not available. Now if I have SSL certificate provided by Godaddy, how can I install it? Is any other alternative ways to install certificate rather than load balancer? Can I install it in my tomcat container itself and build new image with it?

-- Arun
amazon-web-services
docker
kubernetes
ssl

1 Answer

6/2/2018

As far as I know, you cannot setup an ELB deployed with a kubernetes Service to use a certificate which is NOT an ACM certificate. In fact, if you take a look at the possibile annotations here you'll see that the only annotation available to select a certificate is service.beta.kubernetes.io/aws-load-balancer-ssl-cert and the documentation for that annotation says the following:

ServiceAnnotationLoadBalancerCertificate is the annotation used on the
service to request a secure listener. Value is a valid certificate ARN.
For more, see http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html
CertARN is an IAM or CM certificate ARN, e.g. arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012

As you ask, you can for sure terminate your ssl inside your kubernetes Pod and make the ELB a simple TCP proxy.

In order to do so, you need to add the following annotation to your Service manifest:

service.beta.kubernetes.io/aws-load-balancer-backend-protocol: 'tcp'

Also, you will need to forward both your http and https ports in order to handle http to https redirect correctly inside you pod.

If you need more specific help, please post you current manifest.

-- whites11
Source: StackOverflow