I have nginx service created on a GKE cluster as a load balancer type. I'm looking for enabling SSL certificates on this service. Is there any way in which I can achieve this in GKE? Below is the nginx service YAML:
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- name: "gitlab-docker-registry"
port: 8123
targetPort: 8123
- name: "443"
port: 443
targetPort: 443
selector:
app: nginx
type: LoadBalancer
I would use an Ingress, just take into consideration the ports you can use and define the cert in the yaml file.
If you must use a "LoadBalancer" service type, then you must handle this on your nginx backend, modifying the nginx config file while sharing the certificate via persistent volume.