Docker Cookbook


Exploring the Kubernetes API | 159



Download 6,31 Mb.
Pdf ko'rish
bet133/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   129   130   131   132   133   134   135   136   ...   260
Bog'liq
Docker Cookbook

5.12 Exploring the Kubernetes API | 159


}
}
You can then retrieve the full JSON specification of each API by using a 
curl
com‐
mand of this type:
$ curl http://localhost:8080/swaggerapi/api/v1
This might be useful if you want to write your own Kubernetes client. However,
Swagger also exposes a web UI that makes exploring the API straightforward. Assum‐
ing you can reach the API server from a web browser, you can open the UI at a
http://:8080/swagger-ui/
, and should be presented with the
Swagger UI as shown in 
Figure 5-3
.
Figure 5-3. Swagger UI to explore Kubernetes API
Discussion
Exploring the API with Swagger and 
curl
is useful to get a better understanding of
Kubernetes, including the schema used for pods, replication controllers, and services.
However, it is more practical to use the 
kubectl
client that comes with every release.
The usage is well documented and allows you to perform most API functions:
$ ./kubectl
kubectl controls the Kubernetes cluster manager.
Find more information at https://github.com/GoogleCloudPlatform/kubernetes.
Usage:
kubectl [flags]
kubectl [command]
160 | Chapter 5: Kubernetes


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
replace Replace a resource by filename or stdin.
patch Update field(s) of a resource by stdin.
delete Delete a resource by filename, stdin, resource and name, ...
namespace SUPERCEDED: Set and view the current Kubernetes namespace
logs Print the logs for a container in a pod.
rolling-update Perform a rolling update of the given ReplicationController.
scale Set a new size for a Replication Controller.
exec Execute a command in a container.
port-forward Forward one or more local ports to a pod.
proxy Run a proxy to the Kubernetes API server
run Run a particular image on the cluster.
stop Gracefully shut down a resource by name or filename.
expose Take a replicated application and expose it as Kubernetes
Service
label Update the labels on a resource
config config modifies kubeconfig files
cluster-info Display cluster info
api-versions Print available API versions.
version Print the client and server version information.
help Help about any command

As you explore the Kubernetes API, you might enjoy a few interest‐
ing routes as well, like 
/ping/
and 
/validate
:
$ curl http://localhost:8080/ping/
{
"paths": [
"/api",
"/api/v1",
"/healthz",
"/healthz/ping",
"/logs/",
"/metrics",
"/resetMetrics",
"/swagger-ui/",
"/swaggerapi/",
"/ui/",
"/version"
]
}

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   129   130   131   132   133   134   135   136   ...   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