From 088cfc2c6ff2b9a9ac7807bec56e20e01415a2ca Mon Sep 17 00:00:00 2001 From: Steve Perry Date: Wed, 15 Mar 2017 16:49:02 -0700 Subject: [PATCH] Concepts toc (#2840) * Move Guide topic: Limit range. * Adjust Concepts Overview TOC. --- _data/concepts.yml | 10 +++++----- .../working-with-objects}/annotations.md | 0 .../working-with-objects/kubernetes-objects.md} | 9 +++++++-- .../overview/working-with-objects}/labels.md | 3 +++ .../working-with-objects/nginx-deployment.yaml | 16 ++++++++++++++++ 5 files changed, 31 insertions(+), 7 deletions(-) rename docs/concepts/{object-metadata => overview/working-with-objects}/annotations.md (100%) rename docs/concepts/{abstractions/overview.md => overview/working-with-objects/kubernetes-objects.md} (95%) rename docs/{user-guide => concepts/overview/working-with-objects}/labels.md (99%) create mode 100644 docs/concepts/overview/working-with-objects/nginx-deployment.yaml diff --git a/_data/concepts.yml b/_data/concepts.yml index b885c96bf9..b7d07f1910 100644 --- a/_data/concepts.yml +++ b/_data/concepts.yml @@ -6,10 +6,14 @@ toc: - title: Overview section: - docs/concepts/overview/components.md + - title: Working with Kubernetes Objects + section: + - docs/concepts/overview/working-with-objects/kubernetes-objects.md + - docs/concepts/overview/working-with-objects/labels.md + - docs/concepts/overview/working-with-objects/annotations.md - title: Kubernetes Objects section: - - docs/concepts/abstractions/overview.md - title: Pods section: - docs/concepts/abstractions/pod.md @@ -20,10 +24,6 @@ toc: - docs/concepts/abstractions/controllers/petsets.md - docs/concepts/abstractions/controllers/garbage-collection.md -- title: Object Metadata - section: - - docs/concepts/object-metadata/annotations.md - - title: Workloads section: - title: Pods diff --git a/docs/concepts/object-metadata/annotations.md b/docs/concepts/overview/working-with-objects/annotations.md similarity index 100% rename from docs/concepts/object-metadata/annotations.md rename to docs/concepts/overview/working-with-objects/annotations.md diff --git a/docs/concepts/abstractions/overview.md b/docs/concepts/overview/working-with-objects/kubernetes-objects.md similarity index 95% rename from docs/concepts/abstractions/overview.md rename to docs/concepts/overview/working-with-objects/kubernetes-objects.md index 4e832eaffb..3e24b810f4 100644 --- a/docs/concepts/abstractions/overview.md +++ b/docs/concepts/overview/working-with-objects/kubernetes-objects.md @@ -1,5 +1,9 @@ --- -title: Kubernetes Objects +title: Understanding Kubernetes Objects + +redirect_from: +- "/docs/concepts/abstractions/overview/" +- "/docs/concepts/abstractions/overview.html" --- {% capture overview %} @@ -23,6 +27,7 @@ To work with Kubernetes objects--whether to create, modify, or delete them--you' Every Kubernetes object includes two nested object fields that govern the object's configuration: the object *spec* and the object *status*. The *spec*, which you must provide, describes your *desired state* for the object--the characteristics that you want the object to have. The *status* describes the *actual state* for the object, and is supplied and updated by the Kubernetes system. At any given time, the Kubernetes Control Plane actively manages an object's actual state to match the desired state you supplied. + For example, a Kubernetes Deployment is an object that can represent an application running on your cluster. When you create the Deployment, you might set the Deployment spec to specify that you want three replicas of the application to be running. The Kubernetes system reads the Deployment spec and starts three instances of your desired application--updating the status to match your spec. If any of those instances should fail (a status change), the Kubernetes system responds to the difference between spec and status by making a correction--in this case, starting a replacement instance. For more information on the object spec, status, and metadata, see the [Kubernetes API Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md). @@ -33,7 +38,7 @@ When you create an object in Kubernetes, you must provide the object spec that d Here's an example `.yaml` file that shows the required fields and object spec for a Kubernetes Deployment: -{% include code.html language="yaml" file="nginx-deployment.yaml" ghlink="/docs/concepts/abstractions/nginx-deployment.yaml" %} +{% include code.html language="yaml" file="nginx-deployment.yaml" ghlink="/docs/concepts/overview/working-with-objects/nginx-deployment.yaml" %} One way to create a Deployment using a `.yaml` file like the one above is to use the []`kubectl create`]() command in the `kubectl` command-line interface, passing the `.yaml` file as an argument. Here's an example: diff --git a/docs/user-guide/labels.md b/docs/concepts/overview/working-with-objects/labels.md similarity index 99% rename from docs/user-guide/labels.md rename to docs/concepts/overview/working-with-objects/labels.md index a13e160089..af99f0c364 100644 --- a/docs/user-guide/labels.md +++ b/docs/concepts/overview/working-with-objects/labels.md @@ -2,6 +2,9 @@ assignees: - mikedanese title: Labels and Selectors +redirect_from: +- "/docs/user-guide/labels/" +- "/docs/user-guide/labels.html" --- _Labels_ are key/value pairs that are attached to objects, such as pods. diff --git a/docs/concepts/overview/working-with-objects/nginx-deployment.yaml b/docs/concepts/overview/working-with-objects/nginx-deployment.yaml new file mode 100644 index 0000000000..7a0dd431ef --- /dev/null +++ b/docs/concepts/overview/working-with-objects/nginx-deployment.yaml @@ -0,0 +1,16 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: nginx-deployment +spec: + replicas: 3 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.7.9 + ports: + - containerPort: 80