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

Use Apps api over extensions #2611

Merged
merged 1 commit into from Feb 14, 2019
Merged

Use Apps api over extensions #2611

merged 1 commit into from Feb 14, 2019

Conversation

rootfs
Copy link
Member

@rootfs rootfs commented Feb 4, 2019

Description of your changes:
fix #2601

Which issue is resolved by this Pull Request:
Resolves #

Checklist:

  • Documentation has been updated, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.
  • Comments have been added or updated based on the standards set in CONTRIBUTING.md

@rootfs
Copy link
Member Author

rootfs commented Feb 4, 2019

failed with the following error

failed to run operator. Error starting agent daemonset: error starting agent daemonset: failed to create rook-ceph-agent daemon set. DaemonSet.apps "rook-ceph-agent" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"app":"rook-ceph-agent"}: `selector` does not match template `labels`

@@ -215,7 +215,7 @@ rules:
- update
- delete
- apiGroups:
- extensions
- apps
Copy link
Member

Choose a reason for hiding this comment

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

For the upgrade test, we'll need to revert any changes to this file

Copy link
Member

Choose a reason for hiding this comment

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

I have a change coming in #2522 (hopefully merged today) that will update the rbac needed for the upgrade test. We'll need to do something similar here. This helps us catch what needs to be upgraded by users for the next release.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Spec: apps.DaemonSetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": discoverDaemonsetName,
Copy link
Member

Choose a reason for hiding this comment

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

why do we need the selector for the daemonset now?

Copy link
Member Author

@rootfs rootfs Feb 5, 2019

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

we still need to update selectors in deployments so CI can pass

@BlaineEXE
Copy link
Member

Like Travis said, I'd like to see what the upgrade procedure is to go from 0.9.x to master with these changes, but other than that I think it looks good.

@galexrt
Copy link
Member

galexrt commented Feb 7, 2019

@rootfs Why are we going to use apps/v1beta2 instead of apps/v1?
Rook currently supports K8S >= 1.10 (https://rook.io/docs/rook/master/k8s-pre-reqs.html#minimum-version) meaning that apps/v1 can be used instead of the old beta api.

@rootfs
Copy link
Member Author

rootfs commented Feb 7, 2019

cc @yanniszark for cassandra changes @dyusupov for edgefs changes

@rootfs
Copy link
Member Author

rootfs commented Feb 7, 2019

@rootfs Why are we going to use apps/v1beta2 instead of apps/v1?
Rook currently supports K8S >= 1.10 (https://rook.io/docs/rook/master/k8s-pre-reqs.html#minimum-version) meaning that apps/v1 can be used instead of the old beta api.

I don't have a problem supporting v1 api

Documentation/edgefs-cluster-crd.md Outdated Show resolved Hide resolved
@rootfs rootfs force-pushed the apps-api branch 2 times, most recently from fa2aae2 to 7cbd6b1 Compare February 7, 2019 20:17
@rootfs
Copy link
Member Author

rootfs commented Feb 8, 2019

looks there was a test flake on aws 1.12, other instances went well

@rootfs
Copy link
Member Author

rootfs commented Feb 8, 2019

@travisn @galexrt any more input?

Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

@rootfs #2522 was finally merged last night. Could you rebase on that and then let's discuss the upgrade test. thanks

@@ -403,7 +403,7 @@ subjects:
name: rook-ceph-system
namespace: ` + namespace + `
---
apiVersion: apps/v1beta1
apiVersion: extensions/v1beta1
Copy link
Member

Choose a reason for hiding this comment

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

please revert this change to ceph_manifests_v0.9.go

@rootfs rootfs force-pushed the apps-api branch 2 times, most recently from 0545a07 to 582b493 Compare February 8, 2019 16:26
@@ -1403,10 +1403,8 @@
"github.com/yanniszark/go-nodetool/nodetool",
"k8s.io/api/apps/v1",
"k8s.io/api/apps/v1beta1",
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering why this dependency is still here after switching to apps/v1.
Any idea why it is still a dependency? Is it used by "old" or somewhere in test code?

@yanniszark
Copy link
Contributor

Checking the PR head for files containing "/extensions/v1beta" returned only files from the vendor folder, so everything seems to have been updated.

$ grep -r -l "/extensions/v1beta" .

./Gopkg.lock
./vendor/k8s.io/kubernetes/pkg/apis/core/v1/BUILD
./vendor/k8s.io/kubernetes/pkg/apis/extensions/
...
./vendor/k8s.io/apiserver/pkg/endpoints/discovery/version.go
./vendor/github.com/rook/operator-kit/Gopkg.lock

@galexrt as for why vendor still contains /extensions/v1beta1, I believe it's because it is a transitive dependency of a library we use, most likely client-go (Godeps file).

@rootfs
Copy link
Member Author

rootfs commented Feb 13, 2019

cc @sabbot @dyusupov for edgefs operator changes.

pkg/operator/ceph/cluster/mgr/spec.go Outdated Show resolved Hide resolved
@@ -41,7 +41,7 @@ rules:
- update
- delete
- apiGroups:
- extensions
- apps
Copy link
Member

Choose a reason for hiding this comment

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

This is only used for upgrades from 0.8 to 0.9, so we'll need to revert this. We'll need something similar for the v0.9 to v1.0 upgrade before we release though

@@ -204,7 +204,7 @@ rules:
- update
- delete
- apiGroups:
- extensions
- apps
Copy link
Member

Choose a reason for hiding this comment

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

if there are changes to the rbac i would have expected the upgrade_test.go to need an update, otherwise the rbac will not be updated in the test. See here for an example of updating the rbac for a similar change. The upgrade test is what helps us put the final upgrade documentation ready when it's time for release.

Copy link
Member Author

Choose a reason for hiding this comment

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

added

@@ -155,6 +155,9 @@ func (s *UpgradeSuite) updateClusterRoles() error {
if _, err := s.k8sh.DeleteResource("ClusterRole", "rook-ceph-global"); err != nil {
return err
}
if _, err := s.k8sh.DeleteResource("ClusterRole", "rook-ceph-cluster-mgmt"); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Do we also need to add the rook-ceph-system role? Looks like there is a change there as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

added

Signed-off-by: Huamin Chen <hchen@redhat.com>
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.

Migrate from Kubernetes extensions/v1beta1 to apps/v1
5 participants