/srv/irclogs.ubuntu.com/2017/08/04/#juju.txt

=== spaok_ is now known as spaok
* D4RKS1D3 morning09:23
kwmonroecory_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
cory_fukwmonroe: Yes.  It's called ignore14:52
cory_fuOr maybe exclude14:52
cory_fuThere's both, one in each direction14:52
kwmonroeah - sweet.  ignore ignores stuff upstream; i didn't know about exclude14:52
cory_fukwmonroe: 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:54
cory_fuBecause the assumption is that downstream layers should be able to override anything they want14:55
cory_fuOh wait, that's exactly what you want.  Exclude this file from the current layer14:55
kwmonroecory_fu: as much as i enjoy you talking in circles, i think i'll just do some charm build tests myself.14:56
cory_fu:p14:56
ak_devhi, i needed some help understanding the leadership layer16:09
ak_devstub: are you free? just have a couple of questions16:10
stubsure. whats up?16:10
ak_devstub: 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:11
stubThe Juju controller decides who is the leader.16:12
stubIIRC the first unit that asks is given leadership16:12
stubThe lead unit remains the leader as long as it maintains the leadership lease16:13
ak_devstub: oh, is there a way I can ask via code? Cause my use case requires that every unit be leader16:13
stubIf the lead unit fails to renew the lease every 30 seconds, Juju will let the next unit that asks be the new leader16:13
stubYou want to maintain your own leader, rather than using the Juju appointed one. Call it something different, like principal or master to avoid confusion16:14
stubHave the juju leader choose which of your units should be the principal16:15
ak_devstub: could you point me to resources on how to ask / give up leadership?16:16
ak_devin code that is16:17
ak_devstub:16:18
ak_devsorry, that was not intentional16:18
stubThe 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 relation16:19
stubIts going to get complicated if you need that, so your best option may be an alternative approach16:20
stubCan you describe your use case?16:20
ak_devstub: yeah16:20
ak_devthis charm is the OVN charm for kubernetes (to replace flannel)16:21
ak_devso the OVN unit which is subordinate to worker, requests certificates from OVN unit which is subordinate to master16:21
ak_devthen, the OVN master unit responds with a certificate, which is then received by the other OVN worker unit16:21
ak_devso, this has to happen for every OVN unit subordinate to k8s worker, there being only one master16:22
* stub tries to remember if peer relations work for subordinates16:23
ak_devstub: If i remember right, subordinate relations are normal relations with just 'subordinate: true'16:24
stubI think you want a peer relation for this, and don't want to use leadership16:25
ak_devoh alright, I was implementing it through peer relations, but ran in to some problem, so though of changing the approach to this16:26
stubWhich subordinate is the master subordinate is controlled by the primary charm16:26
stubI 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:26
stubA worker subordinate can iterate over all the remote units in the peer relation to discover the one that is subordinate to the master16:27
ak_devstub: hmm yeah, will do it this way then, probably a small error I am facing16:28
ak_devcool, thanks a lot for the help :-)16:28
stubThe 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:29
ak_devyeah! This is kind of how I am doing it i think16:30
stub(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
ak_devcool, if you too are thinking about the same approach, it must mean it works16:30
ak_devgreat!16:30
kwmonroeraising the bar for you cory_fu:  http://paste.ubuntu.com/25241863/19:07
cory_fu:)19:12

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!