/srv/irclogs.ubuntu.com/2017/11/17/#juju.txt

kwmonroe+1 R_P_S, i appreciate the lesson!00:41
sirajREGISTER sirajsaadi itssiraj@gmail.com05:41
sirajsorry05:41
=== frankban|afk is now known as frankban
sirajsadiis juju charm are stable?08:58
EdSMorning Juju people :) I have just run into ssh WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! when using juju ssh. I'm unsure what's happened here, how do I fix this issue? If it makes any difference I've deployed into a MAAS self hosted setup.09:15
EdSFollowing up on my issue earlier, I think that this remote host error is benign, but somehow the known hosts from a previous cluster have been retained. Any ideas where Juju keeps ssh known hosts?11:07
=== petevg is now known as petevg_afk
jamesbensonkwmonroe: thanks for the vote of confidence :-)15:17
jamesbensonstokachu : thanks for commenting on the post this morning to help push it along :-)15:18
bdxkwmonroe: one of the fights I always end up fighting seems to be "juju automatically exposes ports to the wan that I dont want exposed on the wan"15:24
bdxwhether it be company policy, or red tape for a client15:24
bdxjust a bad practice none the less15:25
kwmonroeroger that bdx.  but can't we all just get along on the internet?  don't hack me bruh, i'm just over here trying to make a living.15:25
bdxaha15:26
bdxyeah15:26
bdxtell that to walmart15:26
kwmonroelol15:26
cory_fubdx: I landed a change to the Endpoint PR yesterday evening that might impact you.  Specifically, I removed the context collection, because it made it inconsistent to use interfaces with different implementations.  Not sure if you were using that or not15:27
kwmonroebdx: what ports get auto exposed?  i get 22.. maybe 17070 for cloud-hosted controllers.. others?  or is it the case that 'juju expose' opens things too much?15:28
bdxkwmonroe: http://paste.ubuntu.com/25981632/15:28
bdxnotice whats on the private (nat) subnet and whats on the igw subnet15:28
bdxcory_fu: that definitely will, checking omp15:28
kwmonroeyeah, ack bdx.  btw, i see you've got some sense in that deployment.  no artful nonsense in there ;)15:29
bdxright, https://github.com/jamesbeedy/redis-snap15:30
bdxlike the redis 4.0.2 too huh15:30
cory_fubdx: It's a little bit more verbose, but you can use endpoint_from_name('endpoint_name') as a drop-in replacement.  Also, we're formalizing recommending everyone import things directly from the top level (`from charms.reactive import endpoint_from_name`) rather than depending on the internal organization which we might need to change as we refactor things.15:31
bdxI see, yeah silly me, I missed that srry :P15:32
stokachujamesbenson: np15:39
bdxcory_fu: that was a needed change15:42
cory_fu:)15:42
bdxcory_fu: really nice work there15:42
cory_fuThanks15:43
cory_fuI think it's about ready to land as a beta feature, then we'll need to get a new release cut15:43
bdxthats awesome15:43
bdxplease do15:45
=== frankban is now known as frankban|afk
R_P_Shey, so I have been continuing to follow these instructions, but the kubernetes-master and kubernetes-worker instances are ending up blocked18:33
R_P_Shttps://insights.ubuntu.com/2017/02/08/automate-the-deployment-of-kubernetes-in-existing-aws-infrastructure/18:33
R_P_Skubernetes-master/0*  blocked   executing   6        34.201.56.143             Missing kubernetes resource18:33
R_P_SI found this in a controller log: ARNING juju.resource.resourceadapters charmstore.go:123 attempt 2/3 to download resource "kubernetes" from charm store [channel (stable), charm (cs:~containers/kubernetes-master-11), resource revision (-1)] failed with error (will retry): revision must be a non-negative integer18:36
R_P_Sbut I don't understand why the resource revision is negative in the first place18:36
bdx"but I don't understand why the resource revision is negative in the first place" - there is a fix in place for this I think18:37
bdxR_P_S: thats actually a bug I think18:37
R_P_Swhere exactly is the bug?  Do I need to find a different version for something?18:39
R_P_Sthis affects both the masters and the workers, so I'm guessing this is something underlying?18:39
bdxR_P_S: trying to find it omp18:46
bdxR_P_S: https://bugs.launchpad.net/juju/+bug/172397018:48
mupBug #1723970: unable to attach zero-length resource <papercut> <usability> <juju:Fix Committed by thumper> <https://launchpad.net/bugs/1723970>18:48
bdxlooks like it is in the rc118:48
bdxR_P_S: `sudo snap install juju --edge`18:49
bdxor `sudo snap refresh juju --edge` if you've already got it, which I assume you do18:50
R_P_Sa buig in juju itself?18:50
bdxR_P_S: yea, the fix has already landed though, see ^18:51
R_P_SI guess I need to wipe the apps and redeploy18:52
R_P_SI find it strange that this didn't affect my conjure-up initial test... I wonder if I installed juju via apt for that one18:54
R_P_Sand based on the version, when snap installs version 2.3.x by default, it'll include this fix18:57
bdxR_P_S: not any 2.3, only the one in edge19:00
bdxR_P_S: are you using JAAS?19:00
bdxor you have your own controller(s) deployed?19:01
R_P_SI created my own controller19:01
bdxif you are using jaas it won't matter19:01
bdxok cool19:01
bdxyeah, from my understanding, you will need to redeploy that controller with your newly install 2.3rc1 snap19:01
R_P_Soh damn, the entire controller needs to go?19:02
bdxwell, I think you can upgrade it, but I'm not exactly sure how that works from beta -> rc119:02
R_P_Sok, well, I'll get started on that... in the meantime, I have a couple concept questions19:03
R_P_SI'm confused about expsoing of the workers19:04
R_P_Sthis tutorial doesn't include a load balancer, but I noticed the conjure-up does.  If there's a load balancer, wouldn't it just need to be exposed instead of the workers?19:05
R_P_SI would like to be able to create the workers in a private subnet, so they'd have no external IPs19:06
R_P_Sexposing the workers just seems strange in that there's no way to know which worker a pod is on, so having an external IP seems counterintuitive19:11
bdxR_P_S: yeah19:15
bdxR_P_S: you totally should do that19:16
bdxyou have to setup spaces with your subnets and all19:16
R_P_Ssrry, can't tell which way your statement is going... do or do not expose workers?19:16
R_P_Syes, I've setup workers, and yesterday worked around the bugs surrounding add-subnets19:16
bdxR_P_S: it just depends how you do your ingress19:17
bdxbut yeah, if you are using a proxy infront of the workers for application level ingress19:17
R_P_Snow if I were to expose my workers, does that mean I could technically connect to a service running inside kubernetes on the workers via any one of their IPs and it would just magically route to an appropriate worker if that worker doesn't contain a specific pod?19:18
bdxthen you can totally put subnets behind a nat gateway (by making a new routing table that routes to the nat gateway instead of the igw and using this routing table with your subnets you want to be private)19:18
bdxthen you can (as I do) hide everything in the nat subnets, and just proxy to them from the things that are deployed to igw subnets where the instance gets a wan ip19:19
R_P_Syeah, I built the private subnets in AWS a couple days ago.  we just had public prior to that19:20
R_P_Sso does this mean that the masters could also technically be in the private subnet?19:20
R_P_SI built the private subnets the instant I saw the 0.0.0.0/0 SSH ACLs.  the less instances with publicly accessible IPs, the better19:21
bdxright right19:25
bdxwell it all depends on what the ingress story looks like there19:25
bdxif you are operating behind a vpn, or if you want this  thing to be publicly accessible, etc etc19:26
bdxif nothing needs to talk to the masters from the wan then ....19:27
R_P_Sour security model is fairly basic.  admin access via a bastion host (with port forwarding for gui stuff)19:27
bdxR_P_S: what does "admin access" mean?19:28
bdxlike a host inside the vpn?19:28
bdxadmins get to login to it and use juju from there etc etc?19:28
R_P_Syeah19:28
bdxI see19:28
R_P_Sdoes conjure-up support spaces?  When I first used conjure-up, it didn't even ask about VPCs and actually built it in ec2-classic19:29
stokachuR_P_S: not yet19:29
R_P_Sbefore I defined spaces, it was randomly creating instances in both the public and private subnets19:29
bdxstokachu: can't he just clone the spells repo, and put spaces constraints in the k8s bundle?19:30
stokachubdx: yea19:30
bdxR_P_S: ^^, then use `conjure-up --spells-dir spells/` (I think)19:31
stokachu`conjure-up --spells-dir spells/ --nosync`19:31
R_P_Shrmm... I think I'd like to try and avoid that path for now.  I don't even know where the spells repo is...19:33
R_P_SI'll retry without conjure up using the edge juju19:34
bdxR_P_S: https://github.com/conjure-up/spells19:34
bdxgit clone https://github.com/conjure-up/spells19:34
R_P_SI do feel like that's a rabbit hole, and at this point I am under the gun to complete an evaluation here at work19:36
R_P_Sto quote my manager "everyone uses kubernetes, it can't be that hard, just find the right script to get it up and running" :(19:36
tvansteenburghHAHAHAHA19:37
bdxlol19:37
bdxright19:37
tvansteenburghclearly he must be idling in different slack channels than i am19:37
R_P_Si know :(19:37
R_P_Sto be honest, O19:37
R_P_SI'm consdering this an RGE, and trying to learn as much myself about kubernetes while still delivering19:38
bdxsomehow the whole KOPS thing spread like wildfire19:40
R_P_Sthat was likely my next option if juju completely failed19:40
bdxglad to see conjure-up is the first item in the list of tools to install production grade k8s on the site though19:40
bdxhttps://kubernetes.io/docs/getting-started-guides/aws/19:41
R_P_Sbut despite all the issues with juju, I still seem to be able to muddle my way through, and the conjure-up did technically work, but had a few anti-patterns that just made me weep19:41
bdxstokachu: am I blind, or are the bundles not in the spells repo anymore?19:41
stokachubdx: only if you want custom bundles, otherwise it pulls from charmstore19:41
R_P_Swhich is why I moved away from conjure-up to that tutorial that manually creates the controllers and apps for a kubernetes cluster19:41
bdxstokachu: so a user can manually override the charmstore bundle by using --nosync and supplying their own bundle.yaml in the spell root?19:42
R_P_Sanyways, it's lunchtime... I'll be back at this after lunch19:42
stokachubdx: yep exactly19:43
bdxk, cool, thx19:43
bdxstokachu: can I choose an existing model to deploy to?19:53
bdxstokachu: I got as far as being able to choose my existing controller, but it went straight to review and configure applications19:53
bdxso, the model that I have predefined with the spaces19:54
bdxis moot?19:54
bdxin terms of what conjure-up can do with it19:56
bdxR_P_S: when you get back, https://gist.github.com/jamesbeedy/608a2c819ed852b89de203d7f95cd22e19:58
bdxR_P_S: put ^ in a file called "k8s-bundle-with-spaces.yaml"19:58
bdxthen you can19:58
bdx`juju deploy k8s-bundle-with-spaces.yaml`19:59
bdxR_P_S: assuming you have 2 spaces defined: nat, igw19:59
bdxhere's what my spaces look like http://paste.ubuntu.com/25983157/20:00
bdx3 subnets in each space20:00
bdxwith each subnet having an affinity to an az20:01
bdxpossibly creating spaces could be a pre-deploy step20:03
bdxso that you can use the model that conjure-up create20:03
bdxand adding spaces could just be a step20:03
bdxR_P_S: it will only take about ~5 minutes after you run `juju deploy k8s-bundle-with-spaces.yaml`20:06
R_P_Sthat looks pretty straight forward once I have the model and spaces setup20:11
bdxR_P_S: then you will have a beautiful thing (takes about 10mins for it all to settle actually)20:12
R_P_Salthough for the most part, that just looks like a single file that contains pretty much everything I'd built so far with individual commands20:13
R_P_Slooks like I'd just need to add my instance type constraints20:14
R_P_Scurious about the master... don't we want that to be redundant?20:17
stokachubdx: deploy to existing models isn't supported yet either20:17
stokachuit's on our roadmap though20:17
bdxstokachu: cool20:18
bdxR_P_S: this is what it looks like with the spaces constraints when it all settles http://paste.ubuntu.com/25983232/20:18
bdxR_P_S: yes, add you instance-type constraints where desired20:19
bdxand any other machine constraints20:19
bdxR_P_S: just deploy the bundle I shared with you first20:19
R_P_Syeah, model helps definitely, since I can also put AWS tagging in the models.  I have a jenkins job that emails devops daily if it finds any instances not tagged or incorrectly tagged20:19
bdxtotally20:19
R_P_Ssorry, deploy the bundle shared fisrt?20:20
bdxyea, then add your mods 1 at a time20:20
bdxyou will have much better milage when just getting introduced to all this if you just get the base stack up (which it sounds like you have ) then make these mods 1 at a time20:21
bdxinstead of seeing the end goal (all the mods and constraints and customizations) and trying to get it all in the first go around20:21
R_P_Syeah, I scewed around with the default conjure-up for a while... but I needed to fix some of those base issues with security20:22
bdxright20:22
R_P_SI hope to have this up and running soon, then I can go back to dev and have them break everything inside kubernetes :P20:22
bdx:) good luck20:23
R_P_Swhat are gui-x and gui-y... I've never seen those before20:25
R_P_Soh, those are for those map things20:25
R_P_Sare those required values?20:25
R_P_Sor can I just strip those out?20:26
R_P_Soh, that yaml file is called a bundle... I didn't know that :P20:26
R_P_Sis there a reason the subnet constraints are specified twice?20:31
R_P_Seach app had constraints, but then each machine at the bottom also had the constraints... is the redundancy necessary?20:31
bdxyeah20:32
bdxI think20:32
bdxidk test it out :)20:33
bdxyeah, you can strip the gui-{x,y} if you don't care about the presentation in the gui20:33
bdxthe redundancy is necessary, because you are deploying machines to the desired constraints20:34
bdxso like put this machine in nat space20:34
bdxthen at the application level20:34
bdxyou are saying "I only go to places where these things are true"20:34
R_P_Sah, so the machines are for the first instance, but then the appluications is for increasing the app later type of thing?20:34
bdxexactly20:34
bdx(I think)20:35
bdxhehe20:35
bdxthats my disclaimer to everything20:35
R_P_Sseems a bit odd cause the single juju dieploy command creates the instance and the app with a single set of constraints20:35
bdxright20:35
R_P_Sjuju deploy --constraints "instance-type=t2.medium root-disk=32G spaces=pre-pub" cs:~containers/kubernetes-master-6520:35
bdxtotally, but in the bundle, you have the "to:" stanza20:36
bdxwhich to me indicates you want to deploy to the machine specified there20:37
R_P_Sso that logically separates creation of instances from creation and deployment of apps?20:37
R_P_Sfortunately the lines are identical... vi yy p p p to the rescue :D20:38
bdxR_P_S: you are right20:42
bdxit is redundant20:42
bdxthis gives you the exact same thing https://gist.github.com/jamesbeedy/608a2c819ed852b89de203d7f95cd22e20:42
R_P_Soh, the entire machine section is gone!20:42
bdxyea, and the "to:" directives20:44
bdxstanzas20:44
bdxwhatever20:44
R_P_Sright, just checked the diff, I didn't spot that myself20:44
R_P_SI can't remember if I asked this before... but can I manually modify the security groups after deployment?  or will juju go back at some point in the future and overwrite my changes20:48
bdxjuju will keep persistence on them, people have workarounds for making mods that persist, but the ports that are open on the instances are open for good reason20:49
bdxR_P_S: either  way, for things like that, you have to write the mailing list20:49
R_P_Sat least the private subnet will protect most of the machines from those 0.0.0.0/0 ACLs20:50
bdxyeah, but really, how is juju suppose to know where you are ssh'ing from20:51
R_P_Shah, so I had a typo in there with one of the spaces... one of the instances is hung at pending20:52
R_P_Swell, in terms off SSH, it feels like it could fit into the model.  Using internal IPs with SSH ACLs based on the subnet CIDRs20:53
R_P_Slike a model flag for internal.  Then that would provide basic support for a bastion host VPC model20:54
R_P_Shey, is there any way to recover this bundle with the space typo?  or do I just wipe and rebuild20:54
R_P_Smachine 4 (the LB) is never going to spin up...20:55
bdxR_P_S: there are primitives in juju that exist solely to remediate the idea you have of this "bastion host"20:58
bdxR_P_S: I urge you to ditch that whole gang bang20:59
bdximmediately20:59
R_P_Snot everything is going to be cerated by juju though...  this is just for apps that can be containerized...   the bastion host is meant to help secure the rest of our resources including AWS RDS and non-containerized apps21:01
R_P_SI'm curious to hear more about why you recommend ditching bastion hosts, and what kind of setup you'd do in place?21:06
R_P_Sheh, I just checked wikipedia... and while I use the terms interchangeably, it appeasr that a jump server is a better definition of what I'm trying to build with21:17
R_P_Snow since we don't have a VPN between our office and AWS, it technically still is a bastion host, but I apologize for any confusion between jump vs bastion host21:18
R_P_Shey bdx, I'd like to thank you for all your help.  I'm not sure if I'll be quite done with the with the juju layer, but hopefully everything forward is inside kubernetes now22:16
bdxR_P_S: any time22:17
bdxR_P_S: about the bastion host22:17
bdxjuju lets you operate it from the juju client22:17
bdxand juju treats "users" as first class citizens so as to give you a supported user management system22:17
bdxcontrolling acls and user access via the primitives for user management in juju itself22:18
bdxwill give you much better milage in the long run then using the "bastion host" thing22:18
bdxwhen used correctly, anywhere a juju client is run is essentially a "bastion host" or "jump host"22:19
bdxbecause the security mechanisms in place in juju itself give you identity management (which is basically what you are doing with your bastion host)22:20
bdxyou should take advantage of it, instead of doing the thing you do22:21
bdxjust an idea22:21
bdxdo whatever you please22:21
R_P_SI'd love to be able to ditch the jump host security layer, but experience has taught me to always reduce attack vectors.  I'd love to have confidence in the authorization mechanisms of every service and tool, but the reality is different.22:23
bdxright, so juju takes advantage of things like key based access22:30
bdxit doesn't matter if you are key-based access from your laptop or from the bastion host22:30
bdxits the same thing22:30
bdxthe bastion host is just an unneeded hop .... possibly I just don't see the extra layer of security you get from it22:31
R_P_Sexcept we have ACLs on our jump host to allow only from our office gateways.  our jump host is not accessible publicly22:31
bdxoooo22:31
bdxok then22:31
bdx:)22:31
R_P_Swell, it technically is cause it's got a public IP and we don't have VPN between offices and AWS22:32
R_P_Sbut you'll find 0 ports open if you try hitting that IP from the wild22:32
bdxnice22:32
bdxhttps://jujucharms.com/openvpn/22:32
bdxis what I use22:32
bdxI just deploy ^ to whatever vpc I'm working in22:33
R_P_Shaha, the challenge is not the AWS side of the VPN... the challenge would be the office side22:33
bdxI see22:33
R_P_Sthe offices have... uh... ghetto hardware in places22:33
R_P_Sand I know there are subnet clashes between some VPCs and our internal office address space22:35
R_P_SI inherited some... interesting AWS configs when I joined this company.  Including a production VPC in a /24 with only a single AZ :P22:37
bdxlol22:38
bdxoh man22:38
bdx#beenthere22:38
R_P_SI don't think we had a single SG that referenced another SG prior to my arrival.  everything had an EIP and nothing but IP whitelists everywhere22:40
R_P_SAfter a single point of failure got cryptolocked, management's ears tuned in a bit more on the security front.22:44
bdx"After a single point of failure got cryptolocked, " - this is exactly why not to use the "bastion host"22:53
R_P_Sjump hosts don't need to be SPOF... they can easily be scaled horizontally with minimal state :)22:54
R_P_Sthis SPOF was particularily bad.  it was hosted in godaddy, held a firmware coded IP in customer owned hardware, and we had practically no backups of the thing22:56
R_P_SI really need to write an ansible role for our jump hosts though.  Most of it is just making sure the tools are installed and ready to go.  Then it's just ndividual configuration of things like .bashrc etc23:01

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