Google Kubernetes Engine Enable HTTPS for Service type

0 votes
I have an application on GKE that I wish to be available via HTTPS only, so I have gotten a signed certificate to secure the application using TLS.

I wish to continue using the external load balancers (the compute engine instances that google has provided me) but I just want my application to be accessible via https.

How do I apply my server.crt and server.key files to enable https.Do I apply it to the Load balancers or to the kubernetes cluster.
May 18, 2020 in Docker by kartik
• 37,520 points
641 views

1 answer to this question.

0 votes

Hello @kartik,

Specifically in Google Kubernetes Engine (GKE), any ingress resources defined in your cluster will be served by a Google Cloud Load Balancer, so I don't think you have to worry about deploying your own Ingress Controller (e.g. Nginx Ingress Controller).

In terms of TLS, you can use your own certificate if you have one. The certificate must be uploaded to the cluster through a Kubernetes Secret. Once that secret is defined, you can reference that secret in your Ingress definition.

You can create the secret using the following command:

kubectl create secret tls my-app-certs --key /tmp/tls.key --cert /tmp/tls.crt

Once you have your secret, you can reference it in your ingress resource:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-app-ingress
spec:
  tls:
  - secretName: my-app-certs
  backend:
    serviceName: s1
    servicePort: 80

Once you have created your ingress resource, GKE will configure the load balancer and give you a publicly accessible IP that you can get using:

kubectl get ingress my-app-ingress
answered May 18, 2020 by Niroj
• 82,840 points

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer

How to enable/ disable Hyper-V for Docker on Windows?

You can do this from command prompt ...READ MORE

answered Sep 10, 2018 in Docker by Tyrion anex
• 8,700 points
6,504 views
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,572 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,059 views
0 votes
1 answer

Error:Failed to start redis.service Unit redis-server.service is masked

Hello, If redis.service file is missed in directory path /etc/systemd/system/redis.service so we ...READ MORE

answered May 18, 2020 in Docker by Niroj
• 82,840 points
19,728 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP