Skip to Content
Kubernetes Cookbook - Second Edition
book

Kubernetes Cookbook - Second Edition

by Hideto Saito, Hui-Chuan Chloe Lee, Ke-Jou Carol Hsu
May 2018
Intermediate to advanced
554 pages
13h 51m
English
Packt Publishing
Content preview from Kubernetes Cookbook - Second Edition

How to do it...

In this section, we will show you how to manage resources through the RESTful API. Generally, the command line pattern of curl will cover the following ideas:

  • The operation: curl without an indicating operation will fire GET by default. To specify your operation, add one with the X flag.
  • The body data: Like creating a Kubernetes resource through kubectl, we apply resource configuration with the d flag. The value with symbol @ can attach a file. Additionally, the h flag helps to add request headers; here we need to add content type in the JSON format.
  • The URL: There are various paths after the endpoint, based on different functions.

Let's create a deployment using the following JSON configuration file:

$ cat nginx-deployment.json ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes Cookbook

Kubernetes Cookbook

Sébastien Goasguen, Michael Hausenblas
DevOps with Kubernetes - Second Edition

DevOps with Kubernetes - Second Edition

Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu

Publisher Resources

ISBN: 9781788837606Supplemental Content