[00:41] +1 R_P_S, i appreciate the lesson! [05:41] REGISTER sirajsaadi itssiraj@gmail.com [05:41] sorry === frankban|afk is now known as frankban [08:58] is juju charm are stable? [09:15] Morning 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. [11:07] Following 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? === petevg is now known as petevg_afk [15:17] kwmonroe: thanks for the vote of confidence :-) [15:18] stokachu : thanks for commenting on the post this morning to help push it along :-) [15:24] kwmonroe: 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] whether it be company policy, or red tape for a client [15:25] just a bad practice none the less [15:25] roger 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:26] aha [15:26] yeah [15:26] tell that to walmart [15:26] lol [15:27] bdx: 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 not [15:28] bdx: 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] kwmonroe: http://paste.ubuntu.com/25981632/ [15:28] notice whats on the private (nat) subnet and whats on the igw subnet [15:28] cory_fu: that definitely will, checking omp [15:29] yeah, ack bdx. btw, i see you've got some sense in that deployment. no artful nonsense in there ;) [15:30] right, https://github.com/jamesbeedy/redis-snap [15:30] like the redis 4.0.2 too huh [15:31] bdx: 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:32] I see, yeah silly me, I missed that srry :P [15:39] jamesbenson: np [15:42] cory_fu: that was a needed change [15:42] :) [15:42] cory_fu: really nice work there [15:43] Thanks [15:43] I think it's about ready to land as a beta feature, then we'll need to get a new release cut [15:43] thats awesome [15:45] please do === frankban is now known as frankban|afk [18:33] hey, so I have been continuing to follow these instructions, but the kubernetes-master and kubernetes-worker instances are ending up blocked [18:33] https://insights.ubuntu.com/2017/02/08/automate-the-deployment-of-kubernetes-in-existing-aws-infrastructure/ [18:33] kubernetes-master/0* blocked executing 6 34.201.56.143 Missing kubernetes resource [18:36] I 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 integer [18:36] but I don't understand why the resource revision is negative in the first place [18:37] "but I don't understand why the resource revision is negative in the first place" - there is a fix in place for this I think [18:37] R_P_S: thats actually a bug I think [18:39] where exactly is the bug? Do I need to find a different version for something? [18:39] this affects both the masters and the workers, so I'm guessing this is something underlying? [18:46] R_P_S: trying to find it omp [18:48] R_P_S: https://bugs.launchpad.net/juju/+bug/1723970 [18:48] Bug #1723970: unable to attach zero-length resource [18:48] looks like it is in the rc1 [18:49] R_P_S: `sudo snap install juju --edge` [18:50] or `sudo snap refresh juju --edge` if you've already got it, which I assume you do [18:50] a buig in juju itself? [18:51] R_P_S: yea, the fix has already landed though, see ^ [18:52] I guess I need to wipe the apps and redeploy [18:54] I find it strange that this didn't affect my conjure-up initial test... I wonder if I installed juju via apt for that one [18:57] and based on the version, when snap installs version 2.3.x by default, it'll include this fix [19:00] R_P_S: not any 2.3, only the one in edge [19:00] R_P_S: are you using JAAS? [19:01] or you have your own controller(s) deployed? [19:01] I created my own controller [19:01] if you are using jaas it won't matter [19:01] ok cool [19:01] yeah, from my understanding, you will need to redeploy that controller with your newly install 2.3rc1 snap [19:02] oh damn, the entire controller needs to go? [19:02] well, I think you can upgrade it, but I'm not exactly sure how that works from beta -> rc1 [19:03] ok, well, I'll get started on that... in the meantime, I have a couple concept questions [19:04] I'm confused about expsoing of the workers [19:05] this 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:06] I would like to be able to create the workers in a private subnet, so they'd have no external IPs [19:11] exposing 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 counterintuitive [19:15] R_P_S: yeah [19:16] R_P_S: you totally should do that [19:16] you have to setup spaces with your subnets and all [19:16] srry, can't tell which way your statement is going... do or do not expose workers? [19:16] yes, I've setup workers, and yesterday worked around the bugs surrounding add-subnets [19:17] R_P_S: it just depends how you do your ingress [19:17] but yeah, if you are using a proxy infront of the workers for application level ingress [19:18] now 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] then 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:19] then 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 ip [19:20] yeah, I built the private subnets in AWS a couple days ago. we just had public prior to that [19:20] so does this mean that the masters could also technically be in the private subnet? [19:21] I built the private subnets the instant I saw the 0.0.0.0/0 SSH ACLs. the less instances with publicly accessible IPs, the better [19:25] right right [19:25] well it all depends on what the ingress story looks like there [19:26] if you are operating behind a vpn, or if you want this thing to be publicly accessible, etc etc [19:27] if nothing needs to talk to the masters from the wan then .... [19:27] our security model is fairly basic. admin access via a bastion host (with port forwarding for gui stuff) [19:28] R_P_S: what does "admin access" mean? [19:28] like a host inside the vpn? [19:28] admins get to login to it and use juju from there etc etc? [19:28] yeah [19:28] I see [19:29] does conjure-up support spaces? When I first used conjure-up, it didn't even ask about VPCs and actually built it in ec2-classic [19:29] R_P_S: not yet [19:29] before I defined spaces, it was randomly creating instances in both the public and private subnets [19:30] stokachu: can't he just clone the spells repo, and put spaces constraints in the k8s bundle? [19:30] bdx: yea [19:31] R_P_S: ^^, then use `conjure-up --spells-dir spells/` (I think) [19:31] `conjure-up --spells-dir spells/ --nosync` [19:33] hrmm... I think I'd like to try and avoid that path for now. I don't even know where the spells repo is... [19:34] I'll retry without conjure up using the edge juju [19:34] R_P_S: https://github.com/conjure-up/spells [19:34] git clone https://github.com/conjure-up/spells [19:36] I do feel like that's a rabbit hole, and at this point I am under the gun to complete an evaluation here at work [19:36] to quote my manager "everyone uses kubernetes, it can't be that hard, just find the right script to get it up and running" :( [19:37] HAHAHAHA [19:37] lol [19:37] right [19:37] clearly he must be idling in different slack channels than i am [19:37] i know :( [19:37] to be honest, O [19:38] I'm consdering this an RGE, and trying to learn as much myself about kubernetes while still delivering [19:40] somehow the whole KOPS thing spread like wildfire [19:40] that was likely my next option if juju completely failed [19:40] glad to see conjure-up is the first item in the list of tools to install production grade k8s on the site though [19:41] https://kubernetes.io/docs/getting-started-guides/aws/ [19:41] but 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 weep [19:41] stokachu: am I blind, or are the bundles not in the spells repo anymore? [19:41] bdx: only if you want custom bundles, otherwise it pulls from charmstore [19:41] which is why I moved away from conjure-up to that tutorial that manually creates the controllers and apps for a kubernetes cluster [19:42] stokachu: so a user can manually override the charmstore bundle by using --nosync and supplying their own bundle.yaml in the spell root? [19:42] anyways, it's lunchtime... I'll be back at this after lunch [19:43] bdx: yep exactly [19:43] k, cool, thx [19:53] stokachu: can I choose an existing model to deploy to? [19:53] stokachu: I got as far as being able to choose my existing controller, but it went straight to review and configure applications [19:54] so, the model that I have predefined with the spaces [19:54] is moot? [19:56] in terms of what conjure-up can do with it [19:58] R_P_S: when you get back, https://gist.github.com/jamesbeedy/608a2c819ed852b89de203d7f95cd22e [19:58] R_P_S: put ^ in a file called "k8s-bundle-with-spaces.yaml" [19:58] then you can [19:59] `juju deploy k8s-bundle-with-spaces.yaml` [19:59] R_P_S: assuming you have 2 spaces defined: nat, igw [20:00] here's what my spaces look like http://paste.ubuntu.com/25983157/ [20:00] 3 subnets in each space [20:01] with each subnet having an affinity to an az [20:03] possibly creating spaces could be a pre-deploy step [20:03] so that you can use the model that conjure-up create [20:03] and adding spaces could just be a step [20:06] R_P_S: it will only take about ~5 minutes after you run `juju deploy k8s-bundle-with-spaces.yaml` [20:11] that looks pretty straight forward once I have the model and spaces setup [20:12] R_P_S: then you will have a beautiful thing (takes about 10mins for it all to settle actually) [20:13] although for the most part, that just looks like a single file that contains pretty much everything I'd built so far with individual commands [20:14] looks like I'd just need to add my instance type constraints [20:17] curious about the master... don't we want that to be redundant? [20:17] bdx: deploy to existing models isn't supported yet either [20:17] it's on our roadmap though [20:18] stokachu: cool [20:18] R_P_S: this is what it looks like with the spaces constraints when it all settles http://paste.ubuntu.com/25983232/ [20:19] R_P_S: yes, add you instance-type constraints where desired [20:19] and any other machine constraints [20:19] R_P_S: just deploy the bundle I shared with you first [20:19] yeah, 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 tagged [20:19] totally [20:20] sorry, deploy the bundle shared fisrt? [20:20] yea, then add your mods 1 at a time [20:21] you 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 time [20:21] instead of seeing the end goal (all the mods and constraints and customizations) and trying to get it all in the first go around [20:22] yeah, I scewed around with the default conjure-up for a while... but I needed to fix some of those base issues with security [20:22] right [20:22] I hope to have this up and running soon, then I can go back to dev and have them break everything inside kubernetes :P [20:23] :) good luck [20:25] what are gui-x and gui-y... I've never seen those before [20:25] oh, those are for those map things [20:25] are those required values? [20:26] or can I just strip those out? [20:26] oh, that yaml file is called a bundle... I didn't know that :P [20:31] is there a reason the subnet constraints are specified twice? [20:31] each app had constraints, but then each machine at the bottom also had the constraints... is the redundancy necessary? [20:32] yeah [20:32] I think [20:33] idk test it out :) [20:33] yeah, you can strip the gui-{x,y} if you don't care about the presentation in the gui [20:34] the redundancy is necessary, because you are deploying machines to the desired constraints [20:34] so like put this machine in nat space [20:34] then at the application level [20:34] you are saying "I only go to places where these things are true" [20:34] ah, so the machines are for the first instance, but then the appluications is for increasing the app later type of thing? [20:34] exactly [20:35] (I think) [20:35] hehe [20:35] thats my disclaimer to everything [20:35] seems a bit odd cause the single juju dieploy command creates the instance and the app with a single set of constraints [20:35] right [20:35] juju deploy --constraints "instance-type=t2.medium root-disk=32G spaces=pre-pub" cs:~containers/kubernetes-master-65 [20:36] totally, but in the bundle, you have the "to:" stanza [20:37] which to me indicates you want to deploy to the machine specified there [20:37] so that logically separates creation of instances from creation and deployment of apps? [20:38] fortunately the lines are identical... vi yy p p p to the rescue :D [20:42] R_P_S: you are right [20:42] it is redundant [20:42] this gives you the exact same thing https://gist.github.com/jamesbeedy/608a2c819ed852b89de203d7f95cd22e [20:42] oh, the entire machine section is gone! [20:44] yea, and the "to:" directives [20:44] stanzas [20:44] whatever [20:44] right, just checked the diff, I didn't spot that myself [20:48] I 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 changes [20:49] juju 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 reason [20:49] R_P_S: either way, for things like that, you have to write the mailing list [20:50] at least the private subnet will protect most of the machines from those 0.0.0.0/0 ACLs [20:51] yeah, but really, how is juju suppose to know where you are ssh'ing from [20:52] hah, so I had a typo in there with one of the spaces... one of the instances is hung at pending [20:53] well, in terms off SSH, it feels like it could fit into the model. Using internal IPs with SSH ACLs based on the subnet CIDRs [20:54] like a model flag for internal. Then that would provide basic support for a bastion host VPC model [20:54] hey, is there any way to recover this bundle with the space typo? or do I just wipe and rebuild [20:55] machine 4 (the LB) is never going to spin up... [20:58] R_P_S: there are primitives in juju that exist solely to remediate the idea you have of this "bastion host" [20:59] R_P_S: I urge you to ditch that whole gang bang [20:59] immediately [21:01] not 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 apps [21:06] I'm curious to hear more about why you recommend ditching bastion hosts, and what kind of setup you'd do in place? [21:17] heh, 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 with [21:18] now 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 host [22:16] hey 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 now [22:17] R_P_S: any time [22:17] R_P_S: about the bastion host [22:17] juju lets you operate it from the juju client [22:17] and juju treats "users" as first class citizens so as to give you a supported user management system [22:18] controlling acls and user access via the primitives for user management in juju itself [22:18] will give you much better milage in the long run then using the "bastion host" thing [22:19] when used correctly, anywhere a juju client is run is essentially a "bastion host" or "jump host" [22:20] because the security mechanisms in place in juju itself give you identity management (which is basically what you are doing with your bastion host) [22:21] you should take advantage of it, instead of doing the thing you do [22:21] just an idea [22:21] do whatever you please [22:23] I'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:30] right, so juju takes advantage of things like key based access [22:30] it doesn't matter if you are key-based access from your laptop or from the bastion host [22:30] its the same thing [22:31] the bastion host is just an unneeded hop .... possibly I just don't see the extra layer of security you get from it [22:31] except we have ACLs on our jump host to allow only from our office gateways. our jump host is not accessible publicly [22:31] oooo [22:31] ok then [22:31] :) [22:32] well, it technically is cause it's got a public IP and we don't have VPN between offices and AWS [22:32] but you'll find 0 ports open if you try hitting that IP from the wild [22:32] nice [22:32] https://jujucharms.com/openvpn/ [22:32] is what I use [22:33] I just deploy ^ to whatever vpc I'm working in [22:33] haha, the challenge is not the AWS side of the VPN... the challenge would be the office side [22:33] I see [22:33] the offices have... uh... ghetto hardware in places [22:35] and I know there are subnet clashes between some VPCs and our internal office address space [22:37] I inherited some... interesting AWS configs when I joined this company. Including a production VPC in a /24 with only a single AZ :P [22:38] lol [22:38] oh man [22:38] #beenthere [22:40] I 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 everywhere [22:44] After a single point of failure got cryptolocked, management's ears tuned in a bit more on the security front. [22:53] "After a single point of failure got cryptolocked, " - this is exactly why not to use the "bastion host" [22:54] jump hosts don't need to be SPOF... they can easily be scaled horizontally with minimal state :) [22:56] this 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 thing [23:01] I 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 etc