News for hackers. Stuff that matters.
Re:The Horrors of Upgrading Etcd Beneath Kubernetes by outworlder on Friday July 06, 2018 @09:51PM (#17476407)
> This may be an unpopular opinion, but I’m not a big fan of containers and K8S.

It is unpopular for a reason.

Disclaimer: if you can run solely on cloud managed services + serveless, please do that and do not even look at the rest of this message. This is a very nice approach, although there are some things you need to setup before calling victory (deployment pipeline is one). And, as you mentioned, there is vendor lock-in.

Now, containers. Look, no-one WANTS containers. Or VMs. Or anything else. We just want to run our stuff. It just so happens that containers are one of the most useful abstractions there are. Unless someone else comes up with a new abstraction, containers it is.

Because a container is at the end of the day, a process. Are you against processes? Or against process isolation in general?

You cannot lift an existing service and run serveless, you need to modify it. In many cases, it is not practical. In other cases, they need to be an actual server-like application and hold a connection. Lambda doesn't help there.

> While what K8s has done for containers is freaking impressive, to me it does not make a lot of sense unless you run your own bare metal servers.

One thing has nothing to do with the other. These are different levels of abstraction, there are challenges when running bare metal servers which are not present in cloud environments. Kubernetes can do so much more in a cloud environment (persistent volume claims, etc). Rolling out network attached storage on bare metal servers is a pain. It is also a pain with Openstack, but at least there is a standard interface there.

> If you’re in the cloud, VMs + autoscalling or fully managed services (eg S3, lambda, etc) make more sense and allow you to focus on your app.

Sorry, I respectfully disagree. I have spent the last two months implementing automation for deploying a cluster on AWS, with auto-scaling, auto-healing, the works, automatically deployed through Jenkins. It is NOT easy, it is not simple, and it is not focusing on my end application, unless you are ignoring all the technical debt you are incurring. And we DO have several k8s clusters, I will be moving that crap to k8s as soon as I can.

Let me make a quick list of what you need:

Prep:

You can use a barebones (ubuntu|redhat|coreos|etc) VM. In which case, provisioning is not complete once the VM is up by the ASG, you need to install the app. If you use an AMI, you now need to build automation to construct these AMIs. Note: if at this stage you are building AMIs by hand, this is a technical debt, which you will have to pay. Alternatively, you can use something like cloud init. If so, see below:

* Create the auto-scaling group * Create the launch configuration * If your AMI is not entirely complete, add user data (or equivalent) here * Set the health checks

And you are done! Right? No.

What about log rotation? Do you have centralized logging? No, tech debt. Go set it up. What about monitoring? Are you using cloudwatch? Prometheus? Go set that up. What about alerting? Not everything requires a VM to be destroyed, you need to set it up. What about upgrades? Are these cattle servers? Then you have to modify your AMI and launch config. Go automate this (tech debt if not) How are you controlling access? Do you have a team? Are they allowed to SSH? Where and how are you storing the keys? How do you invalidate if a key gets compromised? I could go on, but let's keep at this level because the point is to draw a comparison.

With K8s, here's what you do:

Create a container image. Dockerfile, fancy Jenkins script, some other mechanism, I don't care. Create an image, put it in a registry somewhere. Create a YAML file describing your 'deployment'. It can be a few lines of code if you don't care about most of the stuff. If you need external access, you can create a service, which is another YAML If you don't have an existing HTTPS load balancer, point to the k8s workers (trivial with something like ingress on GKE)

And you are done. This automatically gets you:

• Self healing • Scheduling among worker nodes. You can control it or let K8s decide • Bin-packing • Logging (centralized logging requires a one-time step, with fluentd or similar, may be handled by cloud providers) • Similarly, monitoring and alerting require a one-time investment in deploying something like Prometheus, after that is done. Getting prometheus to scrape your pods is very easy to do, easier than deploying in a VM by VM basis • Upgrades: deployments handle that for you. Even replica sets before it, you just needed to apply a new YAML with an updated version • There are no SSH keys to mess around. K8s has certificate-based user access control, with an optional RBAC • The SSH equivalent is kubectl exec • Service discovery: you have DNS records for all local services created for you. The cluster will direct you to the correct node. • Scaling is trivial, but most importantly, quick. kubectl scale deployment --replicas=X. It only takes whatever time is required to download the image and run it. You don't have to spin up a whole operating system • Optional: you can have horizontal pod auto-scaling, so your services can scale up and down automatically.

It is not perfect, but it can be a game changer. I cannot imagine how we would be running our operation without K8s. Actually I can: version 1.0 of the app was a bunch of VMs, one for each service. It was nightmarish. Now the push, company-wide, is to move everything to K8s. All VMs, all data stores, all of it. And it has absolutely nothing to do with hype, it has everything to do with proven advantages, compared to most of other alternatives.

I guess you could also do Mesos. They have a similar concept, only it's not K8s.

Note that SOMETHING needs to run the K8s cluster itself. That something is precisely your auto-scaling groups and VM images. It is less painful with a container-optimized OS (like CoreOS or whatever Google uses)

Re:The Horrors of Upgrading Etcd Beneath Kubernetes by vel0city on Saturday July 07, 2018 @01:44AM (#17477246)
This is so true. I'm glad my team embraced containerization of applications internally, deployments before were a nightmare compared to being able to pulling the new image and running it running it or now updating the deployment to the target version of the application. When we need to debug a specific version, we can get the exact image of the application and its entire environment, not just checkout the revision that should be deployed.
Re:The Horrors of Upgrading Etcd Beneath Kubernetes by tannhaeuser on Saturday July 07, 2018 @03:19AM (#17477491)
There's something to be said though about turning entire productive development teams into chasers for cloud tech stuff. I've witnessed teams at startups who were quite focussed on their product to spend many sprints almost entirely on integration into k8s and other orchestration software. You could see minor k8s topics (like "minikube crashing on developer's box") popping up to slowly fill the entire backlog. I guess k8s just makes for an excellent excuse for procrastination. Then once you get your apps running, you need a whole staff of k8s experts to keep it running. It ends up being very, very expensive in terms of HR costs in my experience.

I'm getting k8s's goal to become a cross-cloud orchestration framework, and I'm as much of a standardization fan as could be. I just doubt the overreaching goals for k8s are worth it in the majority of cases, and have seen better business value in Mesos (though Marathon isn't where it could be) because you can realistically run it on your own premises.

I guess k8s is Google's vision for a self-service cloud platform that offloads everything to configuration details on a uniform matrix of nodes, and in particular such that Google doesn't need to provide customer support. I just don't see the benefit for the customer, considering we've been running POSIX workloads for almost 50 years now.

Re:The Horrors of Upgrading Etcd Beneath Kubernetes by arpa on Saturday July 07, 2018 @12:56AM (#17477096)
Thank you! Every time k8s is mentioned we get comments like the OP: misinformed get off my lawn/hacky bash scripts/just give the infra people a zip file to do the needful, because containers are wrong and k8s is alpha at best opinion. And it hurts to see people be willfuly ignorant and be without physical keyboard, and it also is tiring to try and show them they're wrong. Thank you for this comment. You did good.
Re:The Horrors of Upgrading Etcd Beneath Kubernetes by shoo on Saturday July 07, 2018 @12:23AM (#17476989)
thank you for writing this up.

> I have spent the last two months implementing automation for deploying a cluster on AWS, with auto-scaling, auto-healing, the works, automatically deployed through Jenkins. It is NOT easy, it is not simple, and it is not focusing on my end application, unless you are ignoring all the technical debt you are incurring.

yes, i can appreciate that having a system automatically handle even some of this necessary plumbing in a reasonable and standardised way is attractive.

Re:The Horrors of Upgrading Etcd Beneath Kubernetes by mirceal on Saturday July 07, 2018 @12:11AM (#17476951)
A container is not a process. The fact that you say this makes me wonder if you understand what K8s and how it works.

K8s is not going to solve the issues you outline above (logs, proper monitoring, etc). Even worse, you’re gonna have a bad time migrating them to a proper solution.

Re:The Horrors of Upgrading Etcd Beneath Kubernetes by vel0city on Saturday July 07, 2018 @01:49AM (#17477259)
While k8s does not in and of itself solve some of the issues pointed out above, it does centralize a lot of these problems. These centralized problems are then often easily addressed by the cloud providers actually running the k8 cluster. GKE automatically sends log data and metrics through fluentd to their Stackdriver platform including error alerting. If something even prints something that looks like a stack trace to stdout or stderr, Stackdriver sends alerts and creates an issue for us.
Re:The Horrors of Upgrading Etcd Beneath Kubernetes by shaklee3 on Saturday July 07, 2018 @12:53AM (#17477085)
To the first degree, it is. The way people use containers is typically one binary starting up, which equates to one process in Linux. Sure, docker et al have overhead, but that's constant overhead, and much of the hard work is done in cgroups.
Re:The Horrors of Upgrading Etcd Beneath Kubernetes by arpa on Saturday July 07, 2018 @12:49AM (#17477070)
You just might be wrong here, friend.