Skip to content

DO NOT MERGE: Add script to smoke test federation #14336

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

Closed
wants to merge 1 commit into from

Conversation

marun
Copy link
Contributor

@marun marun commented May 24, 2017

This PR adds a script to setup and smoke test federation. Example invocation:

test/extended/federation.sh 'Federation secrets.*successfully'


This change is Reviewable

@marun marun requested a review from stevekuznetsov May 24, 2017 21:04
OS_FEDERATION_NAMESPACE="${OS_FEDERATION_NAMESPACE:-federation-system}"
SERVICE_ACCOUNT="system:serviceaccount:${OS_FEDERATION_NAMESPACE}:default"

os::log::info ""
Copy link
Contributor

Choose a reason for hiding this comment

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

We try not to do this -- it will print out

[INFO]

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


os::log::info ""
os::log::info "Deploying federation control plane"
kubefed init "${OS_FEDERATION_NAME}" --dns-provider=google-clouddns \
Copy link
Contributor

Choose a reason for hiding this comment

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

I would do a os::util::ensure::built_binary_exists kubefed before this

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

# TODO enable coredns when documentation is available
os::log::info ""
os::log::info "Disabling the federation services controller to avoid having to configure dnsaas"
kubectl --namespace="${OS_FEDERATION_NAMESPACE}" patch deploy "${OS_FEDERATION_NAME}-controller-manager" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to use oc here?

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


os::log::info ""
os::log::info "Waiting for federation api to become available"
os::cmd::try_until_text "oc get --raw /healthz --config='${ADMIN_KUBECONFIG}' --context=${OS_FEDERATION_NAME}" 'ok' $(( 80 * second )) 0.25
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to

os::test::junit::declare_suite_start "extended/federation"

and

os::test::junit::declare_suite_end

If you're going to use os::cmd

Copy link
Contributor

Choose a reason for hiding this comment

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

Also suggest wrapping the other set-up commands in os::cmd::expect_success so that we can inspect set-up failures as well.

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

# Ensure the controller manager will be able to access cluster configuration stored as
# secrets in the federation namespace.
os::log::info ""
os::log::info "Granting the admin role to the service account of the federation namespace"
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be os::log::debug at most -- probably not really needed.

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


os::log::info ""
os::log::info "Running federation tests"
os::test::extended::focus "$@"
Copy link
Contributor

Choose a reason for hiding this comment

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

How are we selecting the right --ginkgo.focus for federation with this?

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

@marun marun force-pushed the federation-extended-testing branch from d0fd802 to 58fff0c Compare May 25, 2017 18:41
os::test::junit::declare_suite_start "extended/federation"

os::log::info "Deploying federation control plane"
os::cmd::expect_success "kubefed init '${OS_FEDERATION_NAME}' --dns-provider=google-clouddns \
Copy link
Member

Choose a reason for hiding this comment

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

when i follow this procedure against a oc cluster up environment, it is using the quay etcd image and its in a crash loop backoff with the following message:

$ oc logs origin-federation-apiserver-528877188-k3v5z --namespace=federation-system -c etcd
2017-06-08 05:38:01.129093 I | etcdmain: etcd Version: 3.1.7
2017-06-08 05:38:01.129264 I | etcdmain: Git SHA: 43b7507
2017-06-08 05:38:01.129269 I | etcdmain: Go Version: go1.7.5
2017-06-08 05:38:01.129272 I | etcdmain: Go OS/Arch: linux/amd64
2017-06-08 05:38:01.129277 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4
2017-06-08 05:38:01.129616 I | embed: listening for peers on http://localhost:2380
2017-06-08 05:38:01.129724 I | embed: listening for client requests on localhost:2379
2017-06-08 05:38:01.129791 C | etcdmain: cannot access data directory: mkdir /var/etcd/data: permission denied

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per our discussion in standup, oc cluster up can be used with --etcd-persistent-storage=true which ensures /var/etc/data will be writeable.


# Ensure the controller manager will be able to access cluster configuration stored as
# secrets in the federation namespace.
os::log::debug "Granting the admin role to the service account of the federation namespace"
Copy link
Member

Choose a reason for hiding this comment

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

it would be nice if we can create a namespace before calling kubefed so we can pre-grant this.

kubernetes/kubernetes#47159

@marun marun force-pushed the federation-extended-testing branch from 58fff0c to 1ac14a0 Compare June 20, 2017 20:42
@marun marun force-pushed the federation-extended-testing branch from 1ac14a0 to 55bb77a Compare June 20, 2017 20:42
@openshift-merge-robot openshift-merge-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 24, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: marun
We suggest the following additional approver: bparees

Assign the PR to them by writing /assign @bparees in a comment when ready.

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@bparees bparees removed their assignment Jul 25, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: marun
We suggest the following additional approver: smarterclayton

Assign the PR to them by writing /assign @smarterclayton in a comment when ready.

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: marun
We suggest the following additional approver: smarterclayton

Assign the PR to them by writing /assign @smarterclayton in a comment when ready.

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@marun marun changed the title Add script to smoke test federation DO NOT MERGE: Add script to smoke test federation Jul 31, 2017
@0xmichalis
Copy link
Contributor

/hold

Use /hold cancel to remove

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 6, 2017
@0xmichalis 0xmichalis added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Dec 6, 2017
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 6, 2018
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 6, 2018
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants