News for hackers. Stuff that matters.
Re:A Tutorial Introduction to Kubernetes by djsumdog on Thursday July 05, 2018 @09:22AM (#17463027)
I gave up on my own Kubernetes writeup a while back. I just had a lot of trouble with basic networking configuration, logging, etc.

I've been at one shop with a large scale DC/OS installation. You can run a k8s scheduler on DC/OS, but by default it uses Marathon. DC/OS has it's own problems for sure, and both tools require a full time team of at least 3 people (we had 8~10) and there are a lot of things that will probably need to be customized for your shop (which labels to use, scripts to setup your ingress/egress points in AWS, HAproxy configuration or marathon-lb configuration .. which is just a haproxy container/wrapper), but I think I still prefer marathon.

I briefly played with nomad and which I had spent more time with it. I know people from at least one startup around where I live using it in production. It seems to be a bit more minimal and potentially more sane.

The thing I hate about all of these is there is no 1 to n scaling. For a simple project, I can't just setup one node with a minimal scheduler. DC/OS is going to cost you ~$120 a month for one non-redundant node:

https://penguindreams.org/blog/installing-mesosphere-dcos-on...

I hear people talk about minicube, but that's not something you can expand from one node to 100 right? You still have to build out a real k8s cluster at some point. All of these tools are just frontends around a scheduling and container engine (typically Docker and VMs) that track which containers are running where and track networking between nodes (and you often still have to chose and configure that networking layer .. weavenet, flannel, etc).

I know someone will probably mention Rancer, and I should probably look at it again, but last time I looked I felt it was all point-n-click GUI and not enough command line flags (or at least not enough documented CLI) to really be used in an infrastructure as code fashion.

I feel like there's still a big missing piece of the docker ecosystem, a really simple scheduler that can easily be stood up on new nodes and attach them to an existing cluster, and has a simply way of handling public IPs for web apps/haproxy containers. I know you can do this with K8s, DC/OS, etc. But there is a lot of prep work that has to be done first.

Re:A Tutorial Introduction to Kubernetes by atombender on Thursday July 05, 2018 @04:11PM (#17466393)
> All of these tools are just frontends around a scheduling and container engine ...

Well, that's a gross simplification of what Kubernetes is. (I don't know about Marathon.)

Kubernetes is a "choreographer" of cluster operations. At its core it's a consistent object store that contains a description of the state you want your cluster to be in. Various controllers monitor this store and try to "reconcile" the real world with the desired state. Operations include things like creating persistent volumes, setting up networking rules, and, of course, running applications. To say that it's a frontend for a container engine is a bit misleading, since Kubernetes can control so much more.

It's a nicely layered system — a "pod" describes the desired state of a single instance of an app, a "replica set" describes the desired state of a set of pods, a "deployment" describes the desired incremental rollout of a replica set, and so on. It's also a design that scales down to a single node (hence the popularity of Minikube as well as Docker for Mac, which includes Kubernetes), as well as up.

It's also a design that means that with a few exceptions, your configuration can target any Kubernetes cluster, not a specific cloud vendor. Without a single modification, I can deploy my app to the local Kubernetes on my laptop, or to our production cluster on Google Cloud. While migrating to Docker/Kubernetes took nearly a year, migrating away from GCP would take us probably less than a week (most of it involving pointing DNS to new load balancers, and moving persistent volumes over).

Beyond Google Kubernetes Engine and various other clouds (Azure is apparently very good), there's a bunch of tools now that do the heavy lifting of creating a cluster somewhere. Kubeadm and Kops are both popular.

Re:A Tutorial Introduction to Kubernetes by ashayh on Thursday July 05, 2018 @01:26PM (#17465083)
| The thing I hate about all of these is there is no 1 to n scaling.

Have you tried GKE? https://cloud.google.com/kubernetes-engine/

It abstracts away all the work of setting up a close to production HA cluster, so you can jump quickly into developing & deploying your app. You can start with 1 node and ask GKE to scale to N when you want it.

Re:A Tutorial Introduction to Kubernetes by justinsaccount on Thursday July 05, 2018 @11:07AM (#17463818)
> For a simple project, I can't just setup one node with a minimal scheduler.

kubeadm can do that:

https://github.com/kelseyhightower/kubeadm-single-node-clust...

it basically comes down to bootstrapping it like normal and then removing the 'node-role.kubernetes.io/master' taint so that things can run on the master node.

The one area in kubeadm that is still being worked on is bootstrapping a HA cluster, but if you don't mind having a single master node, you can easily bootstrap a cluster and then add nodes to it later.

Re:A Tutorial Introduction to Kubernetes by frozenice on Thursday July 05, 2018 @02:35PM (#17465638)
I'm re-evaluating k8s again - tried it one or two years ago and hit some roadblocks for my use-case.

Kelsey's tutorial is a bit outdated (Oct 2 2017 with k8s v1.8, v1.11 just got released). Here is a link to the official kubeadm guide for Creating a single master cluster with kubeadm:

https://kubernetes.io/docs/setup/independent/create-cluster-...

It basically is just running

  kubeadm init
on a server / VM (after installing docker and kubeadm, of course). Add a pod network add-on (Calico seems to work well, 2 commands to install), remove the mentioned taint and optionally join more worker nodes (also a single kubeadm command). Every step is in the guide, just copy & paste. ;)

Note: This is no production-ready cluster (it has a single master), also you should have some basic understanding of k8s, which the OP provides. I also highly recommend to dig around kubernetes.io/docs - good material there.

I started with kubeadm some days before the release of k8s v1.11, which made some stuff I wrote obsolete, oh well... :) I really like the new kubeadm phase stuff, though.

There is also an official guide for Creating Highly Available Clusters with kubeadm (it's updated for v1.11) which I just went through:

https://kubernetes.io/docs/setup/independent/high-availabili...

I opted for the "stacked masters" approach (run HA etcd right on the k8s master nodes), wrote some ansible tasks to automate to boring stuff like copying configs/certs etc., and am currently (re-)exploring add-ons and advanced functionality (helm, network policies, ingress controller, ceph via helm, ...).

Let's see how far I get this time!

Re:A Tutorial Introduction to Kubernetes by yebyen on Thursday July 05, 2018 @10:27PM (#17468434)
> some days before the release of k8s v1.11, which made some stuff I wrote obsolete, oh well... :)

I've been through this! Did you decide not to publish it, because it's been outdated?

Let someone review this, I'd love to read it, and getting feedback will be cathartic I promise! Post the link source!

Re:A Tutorial Introduction to Kubernetes by colonelpopcorn on Thursday July 05, 2018 @09:43AM (#17463182)
I have yet to see a good tutorial that shows an automated build of a kubernetes cluster. Yeah, you can use GKE, but that gets to be prohibitively expensive.
Re:A Tutorial Introduction to Kubernetes by dim0r on Thursday July 05, 2018 @10:56AM (#17463725)
Mist.io provides a Cloudify blueprint that can be used to deploy and scale Kubernetes clusters on any supported cloud. It's using kubeadm under the hood.

https://docs.mist.io/article/119-kubernetes-getting-started-...

Disclosure: I'm one of the founders

Re:A Tutorial Introduction to Kubernetes by imtringued on Friday July 06, 2018 @06:05AM (#17470201)
Re:A Tutorial Introduction to Kubernetes by nickthemagicman on Thursday July 05, 2018 @10:36AM (#17463558)
You aren't able to use a managed service? K8s and Docker alone are alot to deal with much less setting up your own cluster.