Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added e2e test for HA master replicas in different zones. #34539

Merged
merged 1 commit into from
Nov 9, 2016

Conversation

jszczepkowski
Copy link
Contributor

@jszczepkowski jszczepkowski commented Oct 11, 2016

Added e2e test for HA master replicas in different zones.


This change is Reviewable

@jszczepkowski jszczepkowski added area/HA release-note-none Denotes a PR that doesn't merit a release note. and removed cla: yes labels Oct 11, 2016
@k8s-github-robot k8s-github-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 11, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins GCE e2e failed for commit 0056bf6. Full PR test history.

The magic incantation to run this job again is @k8s-bot gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@jszczepkowski
Copy link
Contributor Author

@k8s-bot gce e2e test this
issue #33867

@@ -16,6 +16,9 @@

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..

if [[ ! -z "${1:-}" ]]; then
export GCE_ZONE="${1}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable GCE_ZONE is only used (according to grep) in test/e2e_node/jenkins. Why are you setting it here? I don't understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: changed to KUBE_GCE_ZONE

@@ -75,26 +76,61 @@ func verifyNumberOfMasterReplicas(expected int) {
}
}

func findRegionForZone(zone string) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done easier:

$ gcloud compute zones list asia-east1-a --format="[no-heading](region)"
asia-east1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return "" // unreachable
}

func findZonesForRegion(region string) []string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: instead of assuming that a zone is prefixed by region, you can explicitly filter by region:

$ gcloud compute zones list --filter="region=asia-east1" --format="[no-heading](name)"
asia-east1-a
asia-east1-b
asia-east1-c

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return zones
}

func removeZoneFromZones(zones []string, zone string) []string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of implementing this on your own you can also use sets.String implemented in pkg/util/sets or use a map instead where you could just delete a key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot do it as additionalReplicaZones is a mult-map: if numAdditionalReplicas is larger then the number of remaining zones in the region, we create a few masters in the same zone and zone entry is repeated in additionalReplicaZones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add such comment, that it can be a multimap. It was not clear when I was reading the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jszczepkowski
Copy link
Contributor Author

@fgrzadkowski
Comments applied, PTAL

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GKE smoke e2e failed for commit 3064f9b9009f05640158613eea6fcf4b2d7562af. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 24, 2016
@jszczepkowski jszczepkowski removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 25, 2016
Copy link
Contributor

@fgrzadkowski fgrzadkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just add a small comment and feel free to apply LGTM label afterwards.

return zones
}

func removeZoneFromZones(zones []string, zone string) []string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add such comment, that it can be a multimap. It was not clear when I was reading the code.

@jszczepkowski jszczepkowski added this to the v1.5 milestone Nov 4, 2016
@jszczepkowski jszczepkowski added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2016
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 7, 2016
@jszczepkowski
Copy link
Contributor Author

@k8s-bot unit test this
issue #36351

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2016
Added e2e test for HA master replicas in different zones.
@k8s-github-robot k8s-github-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 8, 2016
@jszczepkowski jszczepkowski added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins unit/integration failed for commit 8266f55. Full PR test history.

The magic incantation to run this job again is @k8s-bot unit test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE Node e2e failed for commit 8266f55. Full PR test history.

The magic incantation to run this job again is @k8s-bot node e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@jszczepkowski
Copy link
Contributor Author

@k8s-bot unit test this
issue #36473

@jszczepkowski
Copy link
Contributor Author

@k8s-bot node e2e test this
issue #36159

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 658d010 into kubernetes:master Nov 9, 2016
@jszczepkowski
Copy link
Contributor Author

Part of kubernetes/enhancements#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/HA lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants