Docker Cookbook


Using Docker in GCE Google-Container Instances | 253



Download 6,31 Mb.
Pdf ko'rish
bet200/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   196   197   198   199   200   201   202   203   ...   260
Bog'liq
Docker Cookbook

8.9 Using Docker in GCE Google-Container Instances | 253


Figure 8-9. Pod manifest in GCE container VM
Discussion
If you connect to the instance directly via 
ssh
, you can list the containers that are
running. You will see a 
google/cadvisor
container used for monitoring and two 
kuber‐
netes/pause:go
containers. The last two act as network proxy to the 
cadvisor
monitor‐
ing container and to the pod exposed ports.
$ gcloud compute ssh cookbook-gce
...
sebastiengoasguen@cookbook-gce:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND ...
1f83bb1197c9 nginx:latest "nginx -g 'daemon of ...
b1e6fed3ee20 google/cadvisor:0.8.0 "/usr/bin/cadvisor" ...
79e879c48e9e kubernetes/pause:go "/pause" ...
0c1a51ab2f94 kubernetes/pause:go "/pause" ...
Chapter 9
covers 
cadvisor
.
8.10 Using Kubernetes in the Cloud via GCE
Problem
You want to use a group of Docker hosts and manage containers on them. You like
the 
Kubernetes
 container orchestration engine but would like to use it as a hosted
cloud service.
254 | Chapter 8: Docker in the Cloud


Solution
Use the Google 
Container Engine
 service. This new service allows you to create a
Kubernetes cluster on-demand using the Google API. A cluster will be composed of a
master node and a set of compute nodes that act as container VMs, similar to what
was described in 
Recipe 8.9
.
Google Container Engine is in Beta. Kubernetes is under heavy
development. Expect frequent changes to the API and use it in pro‐
duction at your own risk. For details on Kubernetes, see 
Chapter 5
.
Update your 
gcloud
SDK to use the container engine preview. If you have not yet
installed the Google SDK, see 
Recipe 8.3
.
$ gcloud components update
Starting a Kubernetes cluster using the Google Container Engine service requires a
single command:
$ gcloud container clusters create cook --num-nodes 1 --machine-type g1-small
Creating cluster cook...done.
Created [https://container.googleapis.com/v1/projects/sylvan-plane-862/zones/ \
us-central1-f/clusters/cook].
kubeconfig entry generated for cook.
NAME ZONE MASTER_VERSION MASTER_IP MACHINE_TYPE STATUS
cook us-central1-f 1.0.3 104.197.33.61 g1-small RUNNING
Your cluster IP addresses, project name, and zone will differ from what is shown here.
What you do see is that a Kubernetes configuration file, 
kubeconfig
, was generated for
you. It is located at 
~/.kube/config
and contains the endpoint of your container cluster
as well as the credentials to use it.
You could also create a cluster through the Google Cloud web console (see
Figure 8-10
).

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   196   197   198   199   200   201   202   203   ...   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