How to install kubernetes by kubernetes

6/18/2019

I have kubernetes cluster with one master and 3 worker. I want to create another kubernetes cluster with this kubernetes I mean the other kubernetes cluster (master and worker) should be container forexample I build kubernetes cluster with 1 master and 5 worker.

-- yasin lachini
kubernetes

3 Answers

7/8/2019
  1. apt-get update
  2. apt-get install apt-transport-https ca-certificates curl software-properties-common -y
  3. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  4. apt-get update -y
  5. apt-get install docker.io -y
  6. curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
  7. echo 'deb http://apt.kubernetes.io/ kubernetes-xenial main' | sudo tee /etc/apt/sources.list.d/kubernetes.list
  8. apt-get update -y
  9. apt-get install kubelet kubeadm kubectl -y

    10. kubeadm init

  10. mkdir -p $HOME/.kube

  11. sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

    13. sudo chown $(id -u):$(id -g) $HOME/.kube/config

  12. mkdir -p /root/.kube

  13. sudo cp -i /etc/kubernetes/admin.conf /root/.kube/config

    16. sudo chown $(id -u):$(id -g) /root/.kube/config

  14. kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

    18. kubectl taint nodes --all node-role.kubernetes.io/master-

Use the above commands to install Kubernetes and Make kubernetes run as single node cluster for demo purpose - OS Family - Ubuntu 16.04/18.04

-- DeenaDeepak
Source: StackOverflow

7/2/2019

That is going to be very difficult. What are you using to run Kubernetes (minikube, Google Kubernetes Engine, etc.)

If using minikube (local) minikube makes use of virtualboxs' hypervisor to create new "containers". If you create a cluster, you are already using that hypervisor. What hypervisor would your 'new' cluster use?

Right now, I think you don't make much sense either. you want to deploy a 'new' Kubernetes Cluster as a pod? Where would this pod get its resources? Let's say you used GKE (Google Cloud) and had a really big node (100vCPUs, 1000RAM). Once you're in this node as a pod and you create another cluster (within this pod) (theoretically), would this pod act as the master node? What if this pod goes down? If the master node goes down, the cluster is lost. Pods are ephemeral. It is theoretically possible, but there is absolutely no logical reason one would implement this. This isn't even an answer, but more of a probe for you to help answer our questions, so we can attempt answering yours.

-- DuDoff
Source: StackOverflow

9/16/2019

Since all components in Kubernetes, except Kubelet can be run as pod, you can deploy Kubernetes apiserver, controller,scheduler as a pod in another kubernetes.

You will need to export a SVC exposing API server as a Node port.

IN next step, This Node Port can be used as apiserver URL for second cluster kubelet.

The only challenge you will face, In case you are running calico, ON master node, there could be only one instance of Calico.

So in case you are using operators, your APi server Pod will not be able to reach Operator controller Pod.

-- nimit garg
Source: StackOverflow