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 ...