Installing K8s using kOps on local machine - kubernetes

Has anyone ben able to install Kubernetes using kOps on bare metal/ local virtual machine running Ubuntu.

From one of Kops maintainer
As kOps maintainer, I can at least say that there is no active project to support bare-metal anymore. And the code we once had going in that direction was obsolete and removed.
Source: https://github.com/kubernetes/enhancements/issues/360
If you are looking for installing kubernetes clusters in local bare-metal machine, check out Kind. It is looking very promising.

Related

kOps: Should i upgrade node ami images when upgrading kubernetes cluster to a new version?

I am using kOps to perform a manual cluster upgrade (from 1.17 to 1.18) as explained at https://kops.sigs.k8s.io/operations/updates_and_upgrades/#upgrading-kubernetes
I've noticed that kOps does not update the ami-image defined at spec.image at ig nodes, that means after cluster upgrade nodes are going to use the same base OS despite the kubernetes upgrade. But if you install 1.18 from scratch kOps uses the latest image available for that version.
should i update the version and configure it the same as the one kOps would use in case of an installation from scratch?
In 1.18 ami has moved from Debian to Ubuntu, should i take any precautions due to the change of operating system?
if you edit the manifests directly and do "kops update" etc ... then you need to also update the images, another alternative is to let kops do it for you by running "kops upgrade cluster " it will update the remote state and set the correct defaults etc ..
regarding the image change, i don't see any major issues there, what you can do is grab the current ami and do "sort of rollbacks" by replacing the image and updating the cluster ( or applying previous version of the manifest assuming you have s3 revisions on the state )
There was a bug up until kOps 1.18.2 where Ubuntu images were considered "custom" and therefore not upgraded by kops upgrade. See this bug
As of 1.18.2, you should see upgrades for Ubuntu as well.
There is no particular need to take any precaution when switching from Debian to Ubuntu unless you are using kOps hooks that would be Debian. kOps will take care of this change for you.

Kubernetes in docker for Ubuntu

Is there an ubuntu version of Kubernetes in docker for Ubuntu, that works like docker for mac(https://blog.docker.com/2018/01/docker-mac-kubernetes/).
and docker for windows (https://docs.docker.com/docker-for-windows/#kubernetes)
minikube consumes lots of resource, and I want to try out a lighter alternative, which I found docker for mac that supports kubernetes, but my machine is ubuntu 18.04.
As you may know there are a lot of projects that offer K8S solution, Minikube is the closest to an official mini distribution for local testing and development, but if you wanna try lightweight options you can check:
Kind runs Kubernetes clusters in Docker containers. It supports multi-node clusters as well as HA clusters. Because it runs K8s in Docker, kind can run on Windows, Mac, and Linux. Kind may not have developer-friendly features.
K3s is ma project by Rancher as a lightweight Kubernetes offering suitable for edge environments, IoT devices, CI pipelines, and even ARM devices, like Raspberry Pi's. It runs on any Linux distribution without any additional external dependencies or tools. K3s provides lightweight by replacing docker with containerd, and using sqlite3 as the default DB (instead of etcd). This solution consumes 512 MB of RAM and 200 MB of disk space.
K3d
It is based on a k3s which is a lightweight kubernetes distribution (similar to kind).
Microk8s runs upstream Kubernetes as native services on Linux systems supporting snap. A good option if you are running Ubuntu on your Laptop. There is a very good installation tutorial:
And there are plenty more. You can check what solution suits you best.
Check kind it is kubernetes in docker.

Does Kube-proxy come with standard k8s installation on ubuntu or is it separate package?

I am trying to install kubernetes on ubuntu 16.04.
I am able to install other kubernetes components but i dont know if kube-proxy is installed? Should i get separate binary package for it or does it come prepackaged with kubernetes apt-get installation?
In most cases installing kube-proxy onthe node it self is not required as a common pattern is running kube-proxy as a DaemonSet in your kube cluster.
In regular apt-get packages you would normally find kubectl, kubeadm and kubelet. If you use kubeadm to create the cluster it will automatically prepare kube-proxy as well (in the form of a container, as the rest of the elements of the kubernetes control panel). Therefore, you wouldn't need to install it separately.
If you use the official kubernetes tarball and try to manually install the cluster by yourself, you will need to configure kube-proxy just like the rest of the elements, but the binaries will be included in the tarball. This documentation shows the essential options to configure it: https://kubernetes.io/docs/getting-started-guides/scratch/#kube-proxy. Another resource is Kubernetes the hard way: https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/09-bootstrapping-kubernetes-workers.md

Can we install Kubernetes in a complete offline mode with kubeadm?

I need to install a Kubernetes cluster in complete offline mode. I can follow all the instructions at http://kubernetes.io/docs/getting-started-guides/scratch/ and install from binaries but that seems like an involved setup. The installation using kubeadm is pretty easy but I don't see any docs on whether I can install the cluster by downloading the .deb packages locally.
Any pointers to that direction are much appreciated.
I don't think that anyone has documented this yet. The biggest thing needed is to get the right images pre-loaded on every machine in the cluster. After that things should just work.
There was some discussion of this in this PR: https://github.com/kubernetes/kubernetes/pull/36759.
If I had the bandwidth I'd implement a kubeadm list-images so we could do docker save $(kubeadm list-images) | gzip > kube-images.tar.gz. You could manually construct that list by reading code and such.
Can we install Kubernetes in a complete offline mode with kubeadm?
Yes, I've already set up several offline clusters (1.15.x) with ansible and kubeadm. Mainly you need to prepare the following things in a USB drive and bring it to your offline environment.
.deb/.rpm files to install ansible
.deb/.rpm files to install docker
.deb/.rpm files to install kubeadm, kubectl, kubelet
Docker images of kubernetes cluster (You can find that with kubeadm config images list)
Docker images of kubernetes addons (flannel/calico, dashboard, etc)
Your ansible playbooks
The installation steps are as follow:
Install ansible with dpkg or rpm (manully)
Install docker with dpkg or rpm (via ansible tasks)
Install kubeadm, kubectl, kubelet with dpkg or rpm (via ansible tasks)
docker load all the docker images (via ansible tasks)
Run kubeadm init and kubeadm join (via ansible tasks)
There may be lots of details here. Feel free to leave your comments.

Kubernetes 1.2 baremetal production

Is it recommended to deploy Kubernetes 1.2 on a bare-metal Ubuntu/ RedHat production cluster? If so, what is the recommended SDN tool (flanneld or OvS), docker version and etcd version to use?
Here is the getting started guide for Ubuntu. It hasn't been updated since Kubernetes v1.1.8, but it should still be applicable for v1.2.4. That getting started guide uses flannel, but you can also use Calico (Guide). The list of Kubernetes getting started guides might be a good place to start.
docker version need to be 1.2+
you can found flannel/etcd version in the script of download-release.sh