Docker Cookbook


Creating a Multinode Kubernetes Cluster with Vagrant | 135



Download 6,31 Mb.
Pdf ko'rish
bet117/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   113   114   115   116   117   118   119   120   ...   260
Bog'liq
Docker Cookbook

5.3 Creating a Multinode Kubernetes Cluster with Vagrant | 135


Each virtual machine started with Vagrant will use 1GB of RAM, so
make sure you have enough memory.
Downloading the Vagrant box being used (about 316MB), and provisioning the vir‐
tual machines using 
SaltStack
will take a bit of time. Once it is done, the nodes will
have gone through a validation step, and you should see a similar output on 
stdout
:
...
Kubernetes cluster is running. The master is running at:
https://10.245.1.2
The user name and password to use is located in ~/.kubernetes_vagrant_auth.
... calling validate-cluster
Found 2 nodes.
NAME LABELS STATUS
1 10.245.1.3 kubernetes.io/hostname=10.245.1.3 Ready
2 10.245.1.4 kubernetes.io/hostname=10.245.1.4 Ready
Validate output:
NAME STATUS MESSAGE ERROR
etcd-0 Healthy {"health": "true"} nil
controller-manager Healthy ok nil
scheduler Healthy ok nil
Cluster validation succeeded
Done, listing cluster services:
Kubernetes master is running at https://10.245.1.2
KubeDNS is running at https://10.245.1.2/api/v1/proxy/namespaces/kube-system/ \
services/kube-dns
KubeUI is running at https://10.245.1.2/api/v1/proxy/namespaces/kube-system/ \
services/kube-ui
The 
vagrant status
command lists your running VMs:
$ vagrant status
Current machine states:
master running (virtualbox)
minion-1 running (virtualbox)
minion-2 running (virtualbox)
At this point, you have a working Kubernetes cluster running locally within virtual
machines.
136 | Chapter 5: Kubernetes


Discussion
The Vagrant box used to create this cluster is based on Fedora 21 and uses 
systemd
. If
you connect to these VMs, you can list the 
systemd
units that are running and make
up the Kubernetes system. The networking between the containers uses Open
vSwitch to set up a tunnel mesh.
On the master node, you find two services running—the 
Addon
object manager
along with the 
kubelet
. The 
kubelet
then runs the rest of the Kubernetes server pro‐
cesses under Docker. This includes an instance of 
etcd
, the 
API
server, the 
Controller
manager
, and the 
Scheduler
:
workstation$ vagrant ssh master
Last login: Tue Aug 4 23:53:35 2015 from 10.0.2.2
[vagrant@kubernetes-master ~]$ sudo systemctl list-units | grep kube
kube-addons.service loaded active running Kubernetes Addon Object Manager
kubelet.service loaded active running Kubernetes Kubelet Server
[vagrant@kubernetes-master ~]$ sudo docker ps | grep -e 'k8s_kube\|k8s_etcd' | \
awk '{print $1 " " $2}'
23963ff9ed00 gcr.io/google_containers/etcd:2.0.12
be59784f7885 gcr.io/google_containers/kube-apiserver:f8f32e739d4797f77dc3f85c...
ab3bea447298 gcr.io/google_containers/kube-scheduler:2c6e421dc8d78201f68d4cfa...
f41749ff028d gcr.io/google_containers/kube-controller-manager:4d46d90bb861fdd...
On the minions, you find two more Kubernetes-related services: the 
Kube-Proxy
server and the 
Kubelet
server. Docker is, of course, also running:
workstation$ vagrant ssh minion-1
Last login: Tue Aug 4 23:52:47 2015 from 10.0.2.2
[vagrant@kubernetes-minion-1 ~]$ sudo systemctl list-units kube*
UNIT LOAD ACTIVE SUB DESCRIPTION
kube-proxy.service loaded active running Kubernetes Kube-Proxy Server
kubelet.service loaded active running Kubernetes Kubelet Server
To interact with the cluster, you can use the 
kubectl.sh
script on your localhost. This
script allows you to manage all Kubernetes resources that make up container-
scheduling tasks. Here is a snippet of the 
kubectl
help:
workstation$ ./cluster/kubectl.sh
kubectl controls the Kubernetes cluster manager.
Find more information at https://github.com/GoogleCloudPlatform/kubernetes.
Usage:
kubectl [flags]
kubectl [command]
Available Commands:
get Display one or many resources
describe Show details of a specific resource or group of resources
create Create a resource by filename or stdin

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   113   114   115   116   117   118   119   120   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish