Skip to content

Commit

Permalink
Merge pull request kubernetes#8728 from justinsb/nodeport_gce_e2e_fixes
Browse files Browse the repository at this point in the history
Nodeport GCE e2e fixes
  • Loading branch information
dchen1107 committed May 23, 2015
2 parents 4292866 + ae80ed5 commit fe84643
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
13 changes: 13 additions & 0 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,15 @@ function test-setup {
--allow tcp:80 tcp:8080 \
--network "${NETWORK}" \
"${MINION_TAG}-${INSTANCE_PREFIX}-http-alt"

# Open up the NodePort range
# TODO(justinsb): Move to main setup, if we decide whether we want to do this by default.
gcloud compute firewall-rules create \
--project "${PROJECT}" \
--target-tags "${MINION_TAG}" \
--allow tcp:30000-32767,udp:30000-32767 \
--network "${NETWORK}" \
"${MINION_TAG}-${INSTANCE_PREFIX}-nodeports"
}

# Execute after running tests to perform any required clean-up. This is called
Expand All @@ -934,6 +943,10 @@ function test-teardown {
--project "${PROJECT}" \
--quiet \
"${MINION_TAG}-${INSTANCE_PREFIX}-http-alt" || true
gcloud compute firewall-rules delete \
--project "${PROJECT}" \
--quiet \
"${MINION_TAG}-${INSTANCE_PREFIX}-nodeports" || true
"${KUBE_ROOT}/cluster/kube-down.sh"
}

Expand Down
11 changes: 10 additions & 1 deletion cluster/gke/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ function test-setup() {
--project "${PROJECT}" \
--target-tags "${MINION_TAG}" \
--network="${NETWORK}"

"${GCLOUD}" compute firewall-rules create \
"${MINION_TAG}-${USER}-nodeports" \
--allow tcp:30000-32767,udp:30000-32767 \
--project "${PROJECT}" \
--target-tags "${MINION_TAG}" \
--network="${NETWORK}"
}

# Ensure that we have a password created for validating to the master.
Expand Down Expand Up @@ -285,9 +292,11 @@ function test-teardown() {
MINION_TAG="k8s-${CLUSTER_NAME}-node"

# First, remove anything we did with test-setup (currently, the firewall).
# NOTE: Keep in sync with name above in test-setup.
# NOTE: Keep in sync with names above in test-setup.
"${GCLOUD}" compute firewall-rules delete "${MINION_TAG}-${USER}-http-alt" \
--project="${PROJECT}" || true
"${GCLOUD}" compute firewall-rules delete "${MINION_TAG}-${USER}-nodeports" \
--project="${PROJECT}" || true

# Then actually turn down the cluster.
"${KUBE_ROOT}/cluster/kube-down.sh"
Expand Down
1 change: 1 addition & 0 deletions test/e2e/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ var _ = Describe("Services", func() {

By("changing service " + serviceName + " back to type=ClusterIP")
service.Spec.Type = api.ServiceTypeClusterIP
service.Spec.Ports[0].NodePort = 0
service, err = c.Services(ns).Update(service)
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit fe84643

Please sign in to comment.