I followed the guestbook tutorial from Google and created my own configuration files from it. So farm everything is working fine. Now, I would like to expose the port 80 and 443 from my webserver pods. I know how to do it in the controller configuration file (see below), but not in the service configuration file. Any clue how to do it please?

This is my controller configuration file:

  "id": "webservers-controller",
  "kind": "ReplicationController",
  "apiVersion": "v1beta1",
  "desiredState": {
    "replicas": 3,
    "replicaSelector": {"name": "webservers"},
    "podTemplate": {
      "desiredState": {
        "manifest": {
          "version": "v1beta1",
          "id": "webservers-controller",
          "containers": [{
            "name": "webservers",
            "ports": [
              {"name": "http-server", "containerPort": 80},
              {"name": "https-server", "containerPort": 443}
      "labels": { "name": "webservers" }
  "labels": {"name": "webservers"}

This is my service configuration file:

  "id": "webservers",
  "kind": "Service",
  "apiVersion": "v1beta1",
  "port": 80,
  "containerPort": "http-server",
  "selector": { "name": "webservers" },
  "labels": { "name": "webservers" },
  "createExternalLoadBalancer": true

This is the commands that I do to setup my load balancer:

create cluster

gcloud alpha container clusters create webservers --machine-type n1-standard-2

create controller

gcloud alpha container kubectl create -f webservers-controller.json

create service (load balancer)

gcloud alpha container kubectl create -f webservers-service.json

open port 80

gcloud compute firewall-rules create webservers-node-80 --allow=tcp:80 --target-tags k8s-webservers-node

open port 443

gcloud compute firewall-rules create webservers-node-443 --allow=tcp:443 --target-tags k8s-webservers-node

show lb IP

gcloud compute forwarding-rules list

create health checks

gcloud compute http-health-checks create webservers-80
gcloud compute target-pools add-health-checks k8s-webservers-default-webservers --http-health-check webservers-80 --region europe-west1

Do you have any clue how to expose the 443 port on the load balancer? Thanks

1 Answer 1


This is not possible in v1beta1. To expose multiple ports you have to use v1beta3:


AFAIU it will be released in v0.15

PR: https://github.com/GoogleCloudPlatform/kubernetes/pull/6182

  • Ok, that's a pretty bad news... Do you have any idea when v0.15 will be released?
    – koleror
    Apr 7, 2015 at 12:07
  • v0.15 should be released this week. Thanks for bearing with us as we improve things! Apr 13, 2015 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.