Skip to content

Enable federation for origin clusters #14239

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

Merged
merged 4 commits into from
May 26, 2017

Conversation

marun
Copy link
Contributor

@marun marun commented May 18, 2017

TODO

  • build openshift-specific server image
  • build kubefed that targets the openshift-specific server image
  • update kubefed to report openshift version (e.g. 3.6) instead of kube version (e.g. 1.6)
  • update kubefed init to use rh-specific etcd image
  • test compatibility of kubefed init's PV annotation with openshift

@marun marun requested a review from derekwaynecarr May 18, 2017 08:08
@derekwaynecarr derekwaynecarr self-assigned this May 20, 2017
@derekwaynecarr
Copy link
Member

@marun -- so far looks fine. i thought the second commit would have a dockerfile?

@marun
Copy link
Contributor Author

marun commented May 23, 2017

@stevekuznetsov I can't seem to get ldflags to work, the federation image names end up blank. Help?

@marun marun force-pushed the enable-federation branch from 90e993a to 55bf2a9 Compare May 23, 2017 02:22
hack/common.sh Outdated
@@ -669,6 +669,8 @@ readonly -f os::build::save_version_vars
function os::build::get_product_vars() {
export OS_BUILD_LDFLAGS_IMAGE_PREFIX="${OS_IMAGE_PREFIX:-"openshift/origin"}"
export OS_BUILD_LDFLAGS_DEFAULT_IMAGE_STREAMS="${OS_BUILD_LDFLAGS_DEFAULT_IMAGE_STREAMS:-"centos7"}"
export OS_BUILD_LDFLAGS_FEDERATION_SERVER_IMAGE_NAME="${OS_BUILD_LDFLAGS_FEDERATION_SERVER_IMAGE_openshift:-"openshift/origin-federation"}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be "${OS_BUILD_LDFLAGS_IMAGE_PREFIX}-federation"

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

hack/common.sh Outdated
@@ -716,6 +718,8 @@ function os::build::ldflags() {
ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/vendor/k8s.io/client-go/pkg/version.gitVersion" "${KUBE_GIT_VERSION}"))
ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/vendor/k8s.io/client-go/pkg/version.buildDate" "${buildDate}"))
ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/vendor/k8s.io/client-go/pkg/version.gitTreeState" "clean"))
ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/cmd/kubefed.serverImageName" "${OS_BUILD_LDFLAGS_FEDERATION_SERVER_IMAGE_NAME}"))
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it should work -- maybe it's weird since it's also the entrypoint? @smarterclayton thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've switched to target the pkg instead of the entrypoint. Not that I can test it - the new release build mechanism has hosed what was formerly a working dev setup.

#
# The standard name for this image is openshift/origin-federation
#
FROM openshift/origin-base
Copy link
Contributor

Choose a reason for hiding this comment

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

If you expect the hyperkube binary to be shipped to customers it will be in the RPM so install using yum a la origin-pod.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smarterclayton I'm not sure there's a point in packaging hyperkube, given that this is unlikely to be the method for shipping the federation servers in the future. What's the simplest acceptable solution to getting this image built for 3.6?

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the simplest acceptable solution to getting this image built for 3.6?

To be clear... my comment is prefixed with that "IF" for a reason. If we are shipping this, we need to RPM install it. If we are not, just keep doing what you're doing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is hyperkube a symlink?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is not a symlink.

@marun marun force-pushed the enable-federation branch from 55bf2a9 to a0c834a Compare May 24, 2017 06:08
@marun
Copy link
Contributor Author

marun commented May 24, 2017

@stevekuznetsov Where are the docs for the new build mechanisms? In addition to requiring the manual installation of a bunch of dependencies via yum and imagebuilder via go get, there is apparently a dependency on being able to an authorized pull of the openshift/source image?

openshift/origin-pod: /home/dev/src/os/bin/imagebuilder
openshift/origin-pod: --> Image openshift/origin-source was not found, pulling ...
openshift/origin-pod: unable to pull image (from: openshift/origin-source, tag: latest): unauthorized: authentication required

@detiber
Copy link
Contributor

detiber commented May 24, 2017

@marun I needed to run hack/build-base-images.sh before I could run make release (with the same error you are seeing).

@stevekuznetsov
Copy link
Contributor

stevekuznetsov commented May 24, 2017

@marun you should be able to divorce yourself from any dependencies with our release container:

OS_BUILD_ENV_PRESERVE="_output/local" hack/env OS_ONLY_BUILD_PLATFORMS="linux/amd64" make release

I'll open a PR to see if we can make at least some of those env vars default so you don't have to set them.

@marun
Copy link
Contributor Author

marun commented May 24, 2017

[test]

@marun marun force-pushed the enable-federation branch from a0c834a to cac7f93 Compare May 24, 2017 18:00
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to cac7f93

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1708/) (Base Commit: 483738e)

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

Changes LGTM

@derekwaynecarr
Copy link
Member

LGTM

@derekwaynecarr
Copy link
Member

derekwaynecarr commented May 24, 2017

[merge][severity: bug]

eparis: I'm really sorry if this does break the actual build...

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to cac7f93

@detiber
Copy link
Contributor

detiber commented May 25, 2017

@marun seeing the following error when trying to join clusters to the federation:

I0525 02:24:42.705278       1 clustercontroller.go:122] It's a new cluster, a cluster client will be created
W0525 02:24:42.709866       1 cluster_util.go:121] error in fetching secret: User "system:serviceaccount:federation-system:federation-controller-manager" cannot get secrets in project "federation-system"
...
W0525 02:25:42.716880       1 cluster_util.go:121] error in fetching secret: User "system:serviceaccount:federation-system:federation-controller-manager" cannot get secrets in project "federation-system"
E0525 02:25:42.716908       1 clustercontroller.go:125] Failed to create cluster client, err: timed out waiting for secret: timed out waiting for the condition
I0525 02:25:42.716914       1 clustercontroller.go:163] Failed to Get the status of cluster: jdetiber-fed-us-west1-a

@detiber
Copy link
Contributor

detiber commented May 25, 2017

@marun I was able to resolve by running:

oc adm policy add-role-to-user admin system:serviceaccount:federation-system:federation-controller-manager -n federation-system

I suspect there are more limited permissions rather than admin that I could have added, but this unblocked my testing.

@openshift-bot
Copy link
Contributor

openshift-bot commented May 26, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/801/) (Base Commit: 1d30fc4) (Extended Tests: bug) (Image: devenv-rhel7_6273)

@openshift-bot openshift-bot merged commit 827f454 into openshift:master May 26, 2017
@derekwaynecarr
Copy link
Member

woot!

@smarterclayton
Copy link
Contributor

smarterclayton commented May 26, 2017 via email

@smarterclayton
Copy link
Contributor

Follow up item: the federation image is 800M of unshared layers with the rest of OpenShift (i.e. if you download origin onto a node, to get federation you have to get 800M of additional content). That sucks and we need to fix it in a follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants