@@ -33,7 +33,7 @@ will constantly work to ensure that object exists. By creating an object, you're
33
33
telling the Kubernetes system what you want your cluster's workload to look like; this is your
34
34
cluster's * desired state* .
35
35
36
- To work with Kubernetes objects-- whether to create, modify, or delete them-- you'll need to use the
36
+ To work with Kubernetes objects— whether to create, modify, or delete them— you'll need to use the
37
37
[ Kubernetes API] ( /docs/concepts/overview/kubernetes-api/ ) . When you use the ` kubectl ` command-line
38
38
interface, for example, the CLI makes the necessary Kubernetes API calls for you. You can also use
39
39
the Kubernetes API directly in your own programs using one of the
@@ -71,15 +71,18 @@ For more information on the object spec, status, and metadata, see the
71
71
When you create an object in Kubernetes, you must provide the object spec that describes its
72
72
desired state, as well as some basic information about the object (such as a name). When you use
73
73
the Kubernetes API to create the object (either directly or via ` kubectl ` ), that API request must
74
- include that information as JSON in the request body. ** Most often, you provide the information to
75
- ` kubectl ` in a .yaml file.** ` kubectl ` converts the information to JSON when making the API
76
- request.
74
+ include that information as JSON in the request body.
75
+ Most often, you provide the information to ` kubectl ` in file known as a _ manifest_ .
76
+ By convention, manifests are YAML (you could also use JSON format).
77
+ Tools such as ` kubectl ` convert the information from a manifest into JSON or another supported
78
+ serialization format when making the API request over HTTP.
77
79
78
- Here's an example ` .yaml ` file that shows the required fields and object spec for a Kubernetes Deployment:
80
+ Here's an example manifest that shows the required fields and object spec for a Kubernetes
81
+ Deployment:
79
82
80
83
{{% code_sample file="application/deployment.yaml" %}}
81
84
82
- One way to create a Deployment using a ` .yaml ` file like the one above is to use the
85
+ One way to create a Deployment using a manifest file like the one above is to use the
83
86
[ ` kubectl apply ` ] ( /docs/reference/generated/kubectl/kubectl-commands#apply ) command
84
87
in the ` kubectl ` command-line interface, passing the ` .yaml ` file as an argument. Here's an example:
85
88
@@ -95,7 +98,8 @@ deployment.apps/nginx-deployment created
95
98
96
99
### Required fields
97
100
98
- In the ` .yaml ` file for the Kubernetes object you want to create, you'll need to set values for the following fields:
101
+ In the manifest (YAML or JSON file) for the Kubernetes object you want to create, you'll need to set values for
102
+ the following fields:
99
103
100
104
* ` apiVersion ` - Which version of the Kubernetes API you're using to create this object
101
105
* ` kind ` - What kind of object you want to create
@@ -159,6 +163,10 @@ If you're new to Kubernetes, read more about the following:
159
163
* [ Controllers] ( /docs/concepts/architecture/controller/ ) in Kubernetes.
160
164
* [ kubectl] ( /docs/reference/kubectl/ ) and [ kubectl commands] ( /docs/reference/generated/kubectl/kubectl-commands ) .
161
165
166
+ [ Kubernetes Object Management] ( /docs/concepts/overview/working-with-objects/object-management/ )
167
+ explains how to use ` kubectl ` to manage objects.
168
+ You might need to [ install kubectl] ( /docs/tasks/tools/#kubectl ) if you don't already have it available.
169
+
162
170
To learn about the Kubernetes API in general, visit:
163
171
164
172
* [ Kubernetes API overview] ( /docs/reference/using-api/ )
0 commit comments