Port 443 times out on kubernetes in GCE

9/1/2017

I have created a kubernetes cluster where I'm currently running only a docker service that is serving a static web page. It is working exposing the standard port 80.

Now I want to attach an SSL certificate to the domain, and have managed to do so running locally. But when I try to publish my service to the kubernates cluster, the https://my.domain.com times out. It appears like the service does not receives the request, but is blocked by the kuernates or GCE.

Do I need to open up a firewall, or setup my cluster deployment to open port 443? What might be the issue?

I have heard about Ingress and kubernetes secrets, and that is the way to go. But all I find is with using Ingress-nginx, and as I'm only having a single docker service I do not utilize Nginx. To me it seems like enabling the 443 call to reach the service would be the easiest solution. Or am I wrong?

Below is my setup:

apiVersion: v1
kind: Service
metadata:
  name: client
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
      name: http
    - port: 443
      targetPort: 443
      protocol: TCP
      name: https
  selector:
    name: client-pods
-----
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: client
spec:
  replicas: 1
  revisionHistoryLimit: 0
  template:
    metadata:
      labels:
        name: client-pods
    spec:
      containers:
      - image: <CONTAINER>
        name: client-container
        imagePullPolicy: Always
        ports:
        - containerPort: 80
          name: http
        - containerPort: 443
          name: https
        livenessProbe:
          httpGet:
            path: /health
            port: http
          initialDelaySeconds: 10
          timeoutSeconds: 1

I have also enabled HTTPS traffic on the GKE VM running the cluster, and the Dockerfile exposes both 80 and 443. I'm at a loss. Anyone know what I'm doing wrong?

-- David Gustavsson
docker
google-compute-engine
kubernetes
ssl

0 Answers