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

Federation apiobject cluster #23847

Merged
merged 5 commits into from Apr 27, 2016
Merged

Federation apiobject cluster #23847

merged 5 commits into from Apr 27, 2016

Conversation

jianhuiz
Copy link
Contributor

@jianhuiz jianhuiz commented Apr 4, 2016

add federation api group
add cluster api object and registry
generate cluster client moved to #24117
update scripts to generate files for /federation
#19313 #23653 #23554

@nikhiljindal @quinton-hoole, @deepak-vij, @XiaoningDing, @alfred-huangjian @mfanjie @huangyuqi @colhom

@k8s-bot
Copy link

k8s-bot commented Apr 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in hack/jenkins/job-configs/kubernetes-jenkins-pull/ instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

2 similar comments
@k8s-bot
Copy link

k8s-bot commented Apr 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in hack/jenkins/job-configs/kubernetes-jenkins-pull/ instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Apr 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in hack/jenkins/job-configs/kubernetes-jenkins-pull/ instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Apr 4, 2016
@ghost ghost assigned ghost and nikhiljindal and unassigned zmerlynn and ghost Apr 4, 2016
)

type Interface interface {
Discovery() discovery.DiscoveryInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, @jianhuiz , in cluster-controller and scheduler, we will use this client interface to operate resource. Except cluster and sub-replicaset , we also need relicaset operation. So would you like to define the interface like this?

type Interface interface {
    Discovery() discovery.DiscoveryInterface
    Core() unversionedcore.CoreInterface
    Federation() unversionedfederation.FederationInterface
}

@mfanjie

@huangyuqi
Copy link
Contributor

@jianhuiz ,
In kubernetes, client always has a cache interface https://github.com/kubernetes/kubernetes/tree/master/pkg/client/cache, used to storing resource in kubernetes controller and scheduler.
So, for unity, a cache interface need be added in federated client, right?
@mfanjie

@mfanjie
Copy link

mfanjie commented Apr 11, 2016

I agreed on both comments from @huangyuqi, same request here from scheduler, in addition, I had an email to @jianhuiz, we need to define the annotation somewhere in apiobject component, most likely in types.go

var ClusterSelectorKey = "kubernetes.io/cluster-names"
var TargetClusterKey = "kubernetes.io/target-cluster"
var FederationReplicaSetKey = "kubernetes.io/created-by”

@nikhiljindal
Copy link
Contributor

We should move the client changes to a separate PR. @caesarxuchao will be the best reviewer for that.

Lets get the APIserver parts correct in this PR.

@k8s-bot ok to test.

cc @kubernetes/sig-api-machinery @kubernetes/sig-cluster-federation

@@ -45,10 +46,11 @@ const pkgBase = "k8s.io/kubernetes/pkg"
var (
functionDest = flag.StringP("funcDest", "f", "-", "Output for conversion functions; '-' means stdout")
groupVersion = flag.StringP("version", "v", "api/v1", "groupPath/version for conversion.")
gvPath = flag.StringP("path", "p", "", "path to the api group version directory, relative path to pkg/apis")
Copy link
Contributor

Choose a reason for hiding this comment

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

How about naming it apiTypesPath?

@nikhiljindal
Copy link
Contributor

Most of the api machinery changes look good (have added a few comments)

Have added a few comments on the API as well.
@quinton-hoole and @bgrant0607 might have more comments on the API.

@nikhiljindal
Copy link
Contributor

unit tests failed on Jenkins with the following error:

Verifying ./hack/../hack/verify-govet.sh
federation/registry/cluster/etcd/etcd_test.go:35: k8s.io/kubernetes/pkg/registry/generic.RESTOptions composite literal uses unkeyed fields
FAILED   ./hack/../hack/verify-govet.sh 128s


func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, federation.GroupName)
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this to:
RestOptions{Storage: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1}.
hack/verify-govet.sh is failing because of this

@nikhiljindal
Copy link
Contributor

Code changes LGTM.
Ready to merge as soon as tests pass.

@nikhiljindal
Copy link
Contributor

Great. tests pass now!
Can you squash your commits? You dont need to squash all commits. Its fine to keep the big ones. Probably squash the fixup ones?

@k8s-bot
Copy link

k8s-bot commented Apr 27, 2016

GCE e2e build/test passed for commit 3bdd413.

@nikhiljindal
Copy link
Contributor

LGTM, thanks!

@nikhiljindal nikhiljindal added lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-merge and removed needs-ok-to-merge labels Apr 27, 2016
@k8s-github-robot
Copy link

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

@k8s-bot
Copy link

k8s-bot commented Apr 27, 2016

GCE e2e build/test passed for commit 3bdd413.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit b7e4672 into kubernetes:master Apr 27, 2016
// ClusterReady means the cluster is ready to accept workloads.
ClusterReady ClusterConditionType = "Ready"
// ClusterOffline means the cluster is temporarily down or not reachable
ClusterOffline ClusterConditionType = "Offline"
Copy link
Member

Choose a reason for hiding this comment

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

What's the difference between Ready and Offline? And why do they have have the opposite sense? For instance, this isn't this "Online"?

If Offline is about reachability, it should be called Reachable.

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 believe when a cluster is ready, then other conditions should be generally false or absent.

When Ready becomes false, there could be one or more conditions that indicate the reason for that.

Offline is about reachability (#19313 Cluster which I can change it to Unreachable if you prefer.

There may be more conditions (reason field also maybe) in the future to indicate the status of an unready cluster (like NodeOutOfDisk for NodeCondition)

k8s-github-robot pushed a commit that referenced this pull request May 2, 2016
Automatic merge from submit-queue

Federation client for cluster

generate v1alpha1 and unversioned client for federation/clusters

#23653, requires #23847, #23998

@nikhiljindal @quinton-hoole @caesarxuchao
@nikhiljindal nikhiljindal mentioned this pull request May 5, 2016
20 tasks
k8s-github-robot pushed a commit that referenced this pull request May 18, 2016
Automatic merge from submit-queue

Federation kubectl for clusters

add federation/clusters resource to kubectl
#23653, requires #23847

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24016)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet