Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

SSL termination at loadbalancer for springboot app in GKE isn't working

I am trying to deploy a springboot application running on 8080 port. My target is to have https protocol for custom subdomain with google managed-certificates.  Here are my yamls:

Deployment.yaml

 

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-deployment
  namespace: my-namespace
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-deployment
      namespace: my-namespace
  template:
    metadata:
      labels:
        app: my-deployment
        namespace: my-namespace
    spec:
      containers:
        - name: app
          image: gcr.io/PROJECT_ID/IMAGE:TAG
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          resources:
            requests:
              memory: "256Mi"
              ephemeral-storage: "256Mi"
              cpu: "250m"
            limits:
              memory: "512Mi"
              ephemeral-storage: "512Mi"
              cpu: "250m"

 

Service.yaml

 

apiVersion: v1
kind: Service
metadata:
  name: my-service
  namespace: my-namespace
  annotations:
    cloud.google.com/backend-config: '{"default": "my-http-health-check"}'
spec:
  selector:
    app: my-deployment
    namespace: my-namespace
  type: NodePort
  ports:
    - port: 80
      name: http
      targetPort: http
      protocol: TCP

 

Ingress.yaml

 

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
  namespace: my-name-space
  annotations:
    kubernetes.io/ingress.global-static-ip-name: my-ip
    networking.gke.io/managed-certificates: my-cert
    kubernetes.io/ingress.class: "gce"
  labels:
    app: my-ingress
spec:
  rules:
    - host: my-domain.com
      http:
        paths:
          - pathType: ImplementationSpecific
            backend:
              service:
                name: my-service
                port:
                  name: http

 

I followed various documentation, most of them could help to make http work but, couldn't make https work and ends with error ERR_SSL_VERSION_OR_CIPHER_MISMATCH. Looks like there is issue with "Global forwarding rule". Ports shows 443-443. Could you please give any lead to terminate the HTTPS traffic at loadbalancer and route it to backend app with http.

I followed this document E2E.

https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs#config-connector

 

Thanks in advance!

0 1 488
1 REPLY 1

The targetPort in the Service should be 8080

Top Labels in this Space