=== spaok_ is now known as spaok [09:23] * D4RKS1D3 morning [14:52] cory_fu: is there a tactic like 'ignore' that would ignore things in downstream layers? ie, my base layer has a HEY.md that i don't want propogated to charms that include my base layer. [14:52] kwmonroe: Yes. It's called ignore [14:52] Or maybe exclude [14:52] There's both, one in each direction [14:52] ah - sweet. ignore ignores stuff upstream; i didn't know about exclude [14:54] kwmonroe: Actually, that might not do quite what you want. I think exclude ignores things from the current layer, but I don't think there's a way to say "exclude this forever more" [14:55] Because the assumption is that downstream layers should be able to override anything they want [14:55] Oh wait, that's exactly what you want. Exclude this file from the current layer [14:56] cory_fu: as much as i enjoy you talking in circles, i think i'll just do some charm build tests myself. [14:56] :p [16:09] hi, i needed some help understanding the leadership layer [16:10] stub: are you free? just have a couple of questions [16:10] sure. whats up? [16:11] stub: I wanted to know who / how it is decided who is the leader, and does every unit get to be leader like some sort of round robin? [16:12] The Juju controller decides who is the leader. [16:12] IIRC the first unit that asks is given leadership [16:13] The lead unit remains the leader as long as it maintains the leadership lease [16:13] stub: oh, is there a way I can ask via code? Cause my use case requires that every unit be leader [16:13] If the lead unit fails to renew the lease every 30 seconds, Juju will let the next unit that asks be the new leader [16:14] You want to maintain your own leader, rather than using the Juju appointed one. Call it something different, like principal or master to avoid confusion [16:15] Have the juju leader choose which of your units should be the principal [16:16] stub: could you point me to resources on how to ask / give up leadership? [16:17] in code that is [16:18] stub: [16:18] sorry, that was not intentional [16:19] The leader needs to select the primary unit. If the primary unit needs to give up its role, it needs to signal the leader via the peer relation [16:20] Its going to get complicated if you need that, so your best option may be an alternative approach [16:20] Can you describe your use case? [16:20] stub: yeah [16:21] this charm is the OVN charm for kubernetes (to replace flannel) [16:21] so the OVN unit which is subordinate to worker, requests certificates from OVN unit which is subordinate to master [16:21] then, the OVN master unit responds with a certificate, which is then received by the other OVN worker unit [16:22] so, this has to happen for every OVN unit subordinate to k8s worker, there being only one master [16:23] * stub tries to remember if peer relations work for subordinates [16:24] stub: If i remember right, subordinate relations are normal relations with just 'subordinate: true' [16:25] I think you want a peer relation for this, and don't want to use leadership [16:26] oh alright, I was implementing it through peer relations, but ran in to some problem, so though of changing the approach to this [16:26] Which subordinate is the master subordinate is controlled by the primary charm [16:26] I think you just want each of your subordinates to publish on their peer relation if they are subordinate to the master, or subordinate to a worker. [16:27] A worker subordinate can iterate over all the remote units in the peer relation to discover the one that is subordinate to the master [16:28] stub: hmm yeah, will do it this way then, probably a small error I am facing [16:28] cool, thanks a lot for the help :-) [16:29] The worker likely doesn't even need to discover the master. It can just publish the request to the peer relation, and which ever unit happens to be subordinate to the master can respond. [16:30] yeah! This is kind of how I am doing it i think [16:30] (which is a little nicer, as peer relations tend to be eventually consistent - you might end up with two units claiming to be master for instance, in which case you need to back off and try again later) [16:30] cool, if you too are thinking about the same approach, it must mean it works [16:30] great! [19:07] raising the bar for you cory_fu: http://paste.ubuntu.com/25241863/ [19:12] :)