Skip to content

Commit

Permalink
Merge pull request kubernetes#5749 from fabioy/gke-guestbook.fix
Browse files Browse the repository at this point in the history
Fix guestbook.sh to make it work on GKE.
  • Loading branch information
roberthbailey committed Mar 23, 2015
2 parents 3864cad + 5b77149 commit 737af02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cluster/gke/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# The following are test-specific settings.
CLUSTER_NAME="${CLUSTER_NAME:-${USER}-gke-e2e}"
NETWORK=${KUBE_GKE_NETWORK:-e2e}
MINION_TAG="k8s-${CLUSTER_NAME}-node"


# For ease of maintenance, extract any pieces that do not vary between default
# and test in a common config.
Expand Down
14 changes: 8 additions & 6 deletions hack/e2e-suite/guestbook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ GUESTBOOK="${KUBE_ROOT}/examples/guestbook"

function teardown() {
${KUBECTL} stop -f "${GUESTBOOK}"
if [[ "${KUBERNETES_PROVIDER}" == "gce" ]]; then
if [[ "${KUBERNETES_PROVIDER}" == "gce" ]] || [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
local REGION=${ZONE%-*}
gcloud compute forwarding-rules delete -q --region ${REGION} "${INSTANCE_PREFIX}-default-frontend" || true
gcloud compute target-pools delete -q --region ${REGION} "${INSTANCE_PREFIX}-default-frontend" || true
gcloud compute firewall-rules delete guestbook-e2e-minion-8000 -q || true
if [[ "${KUBERNETES_PROVIDER}" == "gce" ]]; then
gcloud compute forwarding-rules delete -q --project="${PROJECT}" --region ${REGION} "${INSTANCE_PREFIX}-default-frontend" || true
gcloud compute target-pools delete -q --project="${PROJECT}" --region ${REGION} "${INSTANCE_PREFIX}-default-frontend" || true
fi
gcloud compute firewall-rules delete guestbook-e2e-minion-8000 -q --project="${PROJECT}" || true
fi
}

Expand Down Expand Up @@ -84,8 +86,8 @@ ${KUBECTL} create -f "${GUESTBOOK}"
# Verify that all pods are running
wait_for_running

if [[ "${KUBERNETES_PROVIDER}" == "gce" ]]; then
gcloud compute firewall-rules create --allow=tcp:8000 --network="${NETWORK}" --target-tags="${MINION_TAG}" guestbook-e2e-minion-8000
if [[ "${KUBERNETES_PROVIDER}" == "gce" ]] || [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
gcloud compute firewall-rules create --project="${PROJECT}" --allow=tcp:8000 --network="${NETWORK}" --target-tags="${MINION_TAG}" guestbook-e2e-minion-8000
fi

# Add a new entry to the guestbook and verify that it was remembered
Expand Down

0 comments on commit 737af02

Please sign in to comment.