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

Enable petsets in origin #9972

Merged
merged 8 commits into from
Aug 4, 2016
Merged

Conversation

smarterclayton
Copy link
Contributor

[test]

@smarterclayton
Copy link
Contributor Author

Has a mostly green run, would like to get this in @liggitt

@deads2k
Copy link
Contributor

deads2k commented Jul 21, 2016

That integration flake is killing us.

@deads2k deads2k self-assigned this Jul 21, 2016
app: mysql
annotations:
pod.alpha.kubernetes.io/initialized: "true"
pod.alpha.kubernetes.io/init-containers: '[
Copy link
Contributor

Choose a reason for hiding this comment

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

SCC checks these, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k
Copy link
Contributor

deads2k commented Jul 21, 2016

Update our hack script for tests to pull in this example each time so we don't lose it

Name: PetSetControllerRoleName,
},
Rules: []authorizationapi.PolicyRule{
// PetSetController.podCache.ListWatch
Copy link
Contributor

Choose a reason for hiding this comment

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

This means its not using a shared informer. Either you wired it wrong or we need an upstream fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It didn't require this to work, I'm again just following the pattern in this file which is agnostic of shared informer.

@smarterclayton
Copy link
Contributor Author

Update our hack script for tests to pull in this example each time so we don't lose it

I think I'm going to curate the examples list and focus on one or two that work, and point people to upstream.

@smarterclayton
Copy link
Contributor Author

I'm going to enable these for read write for admin/edit now, rather than later, because there may not be a later and I don't want to hold QE up. Admins can always deny them if they have a problem.

@deads2k
Copy link
Contributor

deads2k commented Jul 21, 2016

I'm going to enable these for read write for admin/edit now, rather than later, because there may not be a later and I don't want to hold QE up. Admins can always deny them if they have a problem.

You know we're only getting to do this because he's on vacation. I think you should now merge something crazy of mine :)

@liggitt
Copy link
Contributor

liggitt commented Jul 21, 2016

I hate you both

@smarterclayton
Copy link
Contributor Author

I don't anticipate pet set problems, and if we get the "insecure role" I'll move them there.

@smarterclayton
Copy link
Contributor Author

Trying the examples out is mostly a DNS problem at this point (the upstream DNS code is opaquely tested, so I'm not even sure what format they are expecting, or whether they don't even work on centos for some reason).

@smarterclayton
Copy link
Contributor Author

DNS is broken in Kubernetes (ish), sorting out in 29420

@smarterclayton
Copy link
Contributor Author

Good news! DNS was broken on our side. Fixing. And adding mor tests.

@deads2k
Copy link
Contributor

deads2k commented Jul 26, 2016

@smarterclayton What are the precise rules on hostname annotations? If you enable them here, it may have an impact on the service serving cert signer.

@liggitt There were issues with the first upstream implementations of this hostname thing. Is it good now?

@smarterclayton
Copy link
Contributor Author

Rules are they have to be set on the pod. So create/update on pods allows you to add public DNS names under the controlling service.

@smarterclayton
Copy link
Contributor Author

I'm not aware of any security issues w.r.t. hostname annotation upstream in the current design.

@smarterclayton smarterclayton force-pushed the petset branch 3 times, most recently from 0e46f68 to 2e1f4d0 Compare July 27, 2016 01:56
@smarterclayton
Copy link
Contributor Author

Hells yeah! going to make status work real quick.

On Tue, Jul 26, 2016 at 11:17 PM, OpenShift Bot notifications@github.com
wrote:

continuous-integration/openshift-jenkins/test SUCCESS (
https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6957/)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9972 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABG_py2Wi9XqtOUZEQ4BceQPCu8lhgbpks5qZs3NgaJpZM4JRYA_
.

@smarterclayton
Copy link
Contributor Author

Ok, petset is now no longer in an embarrassing state in Origin. DNS is now conformant with Kube (tim's tests do not test what he thinks they test), the galera example worked for me with no modification except adding host path volumes to my system, and oc status is not terrible:

oc status
In project default on server https://10.1.2.2:8443

svc/galera (headless):3306
  petset/mysql manages erkules/galera:basic created 5 days ago - 3 pods

svc/kubernetes - 172.30.0.1 ports 443, 53->8053, 53->8053

I made a structural change to the graph to prepare for more than one controller (replaced ManagedByRC with ManagedByControllers, cleaned up some abstractions slightly) although I did not add petset vs RC fighting. I'll open an issue to replace our complicated "this manages this" with "this is covered by this controller" as the idle PR covers.

@smarterclayton
Copy link
Contributor Author

[test]

ManagedByRCEdgeKind = "ManagedByRC"
// ManagedByControllerEdgeKind goes from Pod to ReplicationController when the Pod satisfies the ReplicationController's label selector
// TODO: rename to ManagedByController, make generic to controller ref
ManagedByControllerEdgeKind = "ManagedByRC"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's change the constant now.

@deads2k
Copy link
Contributor

deads2k commented Aug 4, 2016

This pull got a lot bigger while my back was turned.

},
// PetSetController.podClient
{
Verbs: sets.NewString("get", "create", "delete", "update"),
Copy link
Contributor

Choose a reason for hiding this comment

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

api group

@deads2k
Copy link
Contributor

deads2k commented Aug 4, 2016

minor comments, didn't review the dns bits, lgtm otherwise.

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to cc58509

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 4, 2016
@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7527/)

}
}

matchHostname := len(segments) > 3 && !hasAllPrefixedSegments(segments[3:4], "_")
Copy link
Contributor

Choose a reason for hiding this comment

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

The godoc at the top of this function should be updated to clarify that we now either return a hash of the IP or a hostname value. Additionally, it would be very useful to people looking at/reviewing this code in the future if there were comments added before each "branch point"/conditional indicating which subquery they were matching (for instance, AFAICT, this one might read "matchHostname indicates we are matching ...endpoints, and not _endpoints...svc")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do a follow up PR with comments - saw this after I hit the big red. Keep commenting please.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also: nit: I think this would be clearer as !strings.HasPrefix(segments[3], "_") (the use of the single-element slice here seems ad bit odd to me...)

@smarterclayton
Copy link
Contributor Author

[merge] talked through DNS stuff with Jordan and will get more review later.

@openshift-bot
Copy link
Contributor

openshift-bot commented Aug 4, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7527/) (Image: devenv-rhel7_4758)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to cc58509

@openshift-bot openshift-bot merged commit e52a190 into openshift:master Aug 4, 2016
@@ -187,20 +187,29 @@ func TestDNS(t *testing.T) {
expect: []*net.IP{&headlessIP},
},
{ // specific port of a headless service
dnsQuestionName: "unknown-port-2345.e1.headless.default.svc.cluster.local.",
dnsQuestionName: "_http._tcp.headless.default.svc.cluster.local.",
Copy link
Contributor

@DirectXMan12 DirectXMan12 Aug 5, 2016

Choose a reason for hiding this comment

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

It looks like none of these exercise the _<protocol>.<svc>.<ns>.svc case (wildcard port match), so there should probably be such a test here. Furthermore, it looks like none of these test the .endpoints.cluster.local queries, and that seems like it would be valuable to test here 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.

Those are tested in the extended DNS test and the test-cmd DNS test.

On Thu, Aug 4, 2016 at 11:02 PM, Solly Ross notifications@github.com
wrote:

In test/integration/dns_test.go
#9972 (comment):

@@ -187,20 +187,29 @@ func TestDNS(t _testing.T) {
expect: []_net.IP{&headlessIP},
},
{ // specific port of a headless service

  •       dnsQuestionName: "unknown-port-2345.e1.headless.default.svc.cluster.local.",
    
  •       dnsQuestionName: "_http._tcp.headless.default.svc.cluster.local.",
    

It looks like none of these exercise the _...svc case
(wildcard port match), so there should probably be such a test here.
Furthermore, it looks like none of these test the .endpoints queries, and
that seems like it would be valuable to test here as well.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/openshift/origin/pull/9972/files/cc585097d4706f1d49fb9a451760f38e9863a794#r73636324,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABG_pymEzpOhGu0rsHQnD2TGkhSFO4LAks5qcqeugaJpZM4JRYA_
.

@DirectXMan12
Copy link
Contributor

Overall, I think the DNS stuff in general looks ok, but it seems like there are a couple of paths missing from the integration tests, and the DNS code really needs better commenting. The flow of the DNS code is somewhat convoluted (not particularly because of this PR, just in general), so I think comments to the effect of // now, we can only have x.y.z and a.b.z queries, so try those would be fairly useful in making this easier to read.

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

Successfully merging this pull request may close these issues.

6 participants