From e672160dfa8c0a9d26c32e7b3974ae142302a2b7 Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Fri, 23 Jun 2017 13:19:51 -0700 Subject: [PATCH 1/9] Removed -fs from troubleshooting command --- docs/tasks/administer-cluster/configure-upgrade-etcd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tasks/administer-cluster/configure-upgrade-etcd.md b/docs/tasks/administer-cluster/configure-upgrade-etcd.md index a72aae3f08ba7..b4ede41ddac1a 100644 --- a/docs/tasks/administer-cluster/configure-upgrade-etcd.md +++ b/docs/tasks/administer-cluster/configure-upgrade-etcd.md @@ -35,7 +35,7 @@ see _some doc_. Performance and stability of the cluster is sensitive to network and disk IO. Any resource starvation can lead to heartbeat timeout, causing instability of the cluster. An unstable etcd indicates that no leader is elected. Under such circumstances, a cluster cannot make any changes to its current state, which implies no new pods can be scheduled. -* Keeping stable etcd clusters is critical to the stability of Kubernetes clusters. Therefore, run etcd clusters on dedicated machines or isolated environments for [guaranteed resource requirements](https://github.com/coreos/etcd/blob/master/Documentation/op-guide/hardware.md#hardware-recommendations). +* Keeping stable etcd clusters is critical to the stability of Kubernetes clusters. Therefore, run etcd clusters on dedicated machines or isolated environments for [guaranteed resource requirements](https://github.com/coreos/etcd/blob/master/Documentation/op-guide/hardware.md#hardware-recommendations). ## Resource requirements @@ -403,5 +403,5 @@ test key. On your master VM (or somewhere with firewalls configured such that you can talk to your cluster's etcd), try: ```shell -curl -fs -X PUT "http://${host}:${port}/v2/keys/_test" +curl -X PUT "http://${host}:${port}/v2/keys/_test" ``` From 8ecabd6d106647631819441be8bf7e834f0dbb54 Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:12:04 -0700 Subject: [PATCH 2/9] Add YAML file for configmaps in concepts --- .../concepts/configuration/concept-configmap.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docs/concepts/configuration/concept-configmap.yaml diff --git a/docs/concepts/configuration/concept-configmap.yaml b/docs/concepts/configuration/concept-configmap.yaml new file mode 100644 index 0000000000000..53316368d42bf --- /dev/null +++ b/docs/concepts/configuration/concept-configmap.yaml @@ -0,0 +1,15 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + creationTimestamp: 2016-02-18T19:14:38Z + name: example-config + namespace: default +data: + # example of a simple property defined using --from-literal + example.property.1: hello + example.property.2: world + # example of a complex property defined using --from-file + example.property.file: |- + property.1=value-1 + property.2=value-2 + property.3=value-3 From 3d535f59170a4b5cb290975871f167217484e7ab Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:12:28 -0700 Subject: [PATCH 3/9] Add new topic for configmaps in concepts --- .../configuration/understanding-configmaps.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/concepts/configuration/understanding-configmaps.md diff --git a/docs/concepts/configuration/understanding-configmaps.md b/docs/concepts/configuration/understanding-configmaps.md new file mode 100644 index 0000000000000..202f7266b7be1 --- /dev/null +++ b/docs/concepts/configuration/understanding-configmaps.md @@ -0,0 +1,34 @@ +--- +title: Understanding ConfigMaps +--- + +{% capture overview %} + +A `ConfigMap` lets you separate configuration data for a container image from the container image itself. Decoupling configuration artifacts from image content keeps your containerized applications portable. + +{% endcapture %} + +{% capture body %} + +## ConfigMaps + +The [ConfigMap API resource](/docs/api-reference/v1.6/#configmap-v1-core) stores configuration data as key-value pairs. The data can be consumed in pods or provide the configurations for system components, such as controllers. ConfigMap is similar to [Secrets](/docs/concepts/configuration/secret/), but provides a means of working with strings that don't contain sensitive information. Users and system components alike can store configuration data in a ConfigMap. + +**Note:** ConfigMaps should reference properties files, not replace them. + +A ConfigMap is similar to a Linux `/etc` directory and its contents. For example, if you create a [Kubernetes Volume](/docs/concepts/storage/volumes/) from a ConfigMap, each data item in the ConfigMap is represented by an individual file in the volume. + +A ConfigMap's `data` field contains the configuration data. Assigning `data` values can be simple, defining individual properties using `--from-literal`. Assignments can also be complex, defining multiple properties from configuration files or JSON blobs using `--from-file`. The following example demonstrates simple and complex methods: + +{% include code.html language="yaml" file="concept-configmap.yaml" ghlink="/docs/concepts/configuration/concept-configmap.yaml" %} + +{% endcapture %} + +{% capture whatsnext %} + +* See [Using ConfigMap Data in Pods](/docs/tasks/configure-pod-container/configure-pod-configmap). +* Follow a real world example of [Configuring Redis using a ConfigMap](/docs/tutorials/configuration/configure-redis-using-configmap/). + +{% endcapture %} + +{% include templates/task.md %} From c27fc13f56453dff6e6b8b8f1f9641cbad8ace53 Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:15:35 -0700 Subject: [PATCH 4/9] Add configuration entry for understanding configmaps --- _data/concepts.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_data/concepts.yml b/_data/concepts.yml index 1e03af5f84d35..ca76a2348a1df 100644 --- a/_data/concepts.yml +++ b/_data/concepts.yml @@ -53,6 +53,7 @@ toc: - docs/concepts/configuration/manage-compute-resources-container.md - docs/concepts/configuration/assign-pod-node.md - docs/concepts/configuration/secret.md + - docs/concepts/configuration/understanding-configmaps.md - title: Services, Load Balancing, and Networking section: @@ -86,5 +87,3 @@ toc: section: - docs/concepts/policy/resource-quotas.md - docs/concepts/policy/pod-security-policy.md - - From 71bd80d7bccd090d0aa1829ae9e4db6cc4dc590c Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:16:44 -0700 Subject: [PATCH 5/9] Move Understanding Configmaps to a separate concept file --- .../configure-pod-container/configmap.md | 55 ++++--------------- 1 file changed, 12 insertions(+), 43 deletions(-) diff --git a/docs/tasks/configure-pod-container/configmap.md b/docs/tasks/configure-pod-container/configmap.md index abccc6bf197e1..c8bb5aa536ac8 100644 --- a/docs/tasks/configure-pod-container/configmap.md +++ b/docs/tasks/configure-pod-container/configmap.md @@ -11,7 +11,7 @@ redirect_from: {% capture overview %} -This page shows you how to configure an application using a ConfigMap. +This page shows you how to configure an application using a ConfigMap. {% endcapture %} @@ -24,7 +24,7 @@ This page shows you how to configure an application using a ConfigMap. {% capture steps %} -## Use kubectl to create a ConfigMap +## Use kubectl to create a ConfigMap Use the `kubectl create configmap` command to create configmaps from [directories](#creating-configmaps-from-directories), [files](#creating-configmaps-from-files), or [literal values](#creating-configmaps-from-literal-values): @@ -33,17 +33,17 @@ kubectl create configmap ``` where \ is the name you want to assign to the ConfigMap and \ is the directory, file, or literal value to draw the data from. - + The data source corresponds to a key-value pair in the ConfigMap, where -* key = the file name or the key you provided on the command line, and +* key = the file name or the key you provided on the command line, and * value = the file contents or the literal value you provided on the command line. - + You can use [`kubectl describe`](docs/user-guide/kubectl/v1.6/#describe) or [`kubectl get`](docs/user-guide/kubectl/v1.6/#get) to retrieve information about a ConfigMap. The former shows a summary of the ConfigMap, while the latter returns the full contents of the ConfigMap. ### Create ConfigMaps from directories -You can use `kubectl create configmap` to create a ConfigMap from multiple files in the same directory. +You can use `kubectl create configmap` to create a ConfigMap from multiple files in the same directory. For example: @@ -110,10 +110,10 @@ metadata: You can use `kubectl create configmap` to create a ConfigMap from an individual file, or from multiple files. -For example, +For example, ```shell -kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties +kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties ``` would produce the following ConfigMap: @@ -131,9 +131,9 @@ game.properties: 158 bytes ``` You can pass in the `--from-file` argument multiple times to create a ConfigMap from multiple data sources. - + ```shell -kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties --from-file=docs/user-guide/configmap/kubectl/ui.properties +kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties --from-file=docs/user-guide/configmap/kubectl/ui.properties ``` ```shell @@ -158,8 +158,8 @@ kubectl create configmap game-config-3 --from-file== ``` where `` is the key you want to use in the ConfigMap and `` is the location of the data source file you want the key to represent. - -For example: + +For example: ```shell kubectl create configmap game-config-3 --from-file=game-special-key=docs/user-guide/configmap/kubectl/game.properties @@ -219,37 +219,6 @@ metadata: {% endcapture %} -{% capture discussion %} - -## Understanding ConfigMaps - -ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable. -The ConfigMap API resource stores configuration data as key-value pairs. The data can be consumed in pods or provide the configurations for system components such as controllers. ConfigMap is similar to [Secrets](/docs/concepts/configuration/secret/), but provides a means of working with strings that don't contain sensitive information. Users and system components alike can store configuration data in ConfigMap. - -Note: ConfigMaps should reference properties files, not replace them. Think of the ConfigMap as representing something similar to the a Linux `/etc` directory and its contents. For example, if you create a [Kubernetes Volume](/docs/concepts/storage/volumes/) from a ConfigMap, each data item in the ConfigMap is represented by an individual file in the volume. - -The ConfigMap's `data` field contains the configuration data. As shown in the example below, this can be simple -- like individual properties defined using `--from-literal` -- or complex -- like configuration files or JSON blobs defined using `--from-file`. - -```yaml -kind: ConfigMap -apiVersion: v1 -metadata: - creationTimestamp: 2016-02-18T19:14:38Z - name: example-config - namespace: default -data: - # example of a simple property defined using --from-literal - example.property.1: hello - example.property.2: world - # example of a complex property defined using --from-file - example.property.file: |- - property.1=value-1 - property.2=value-2 - property.3=value-3 -``` - -{% endcapture %} - {% capture whatsnext %} * See [Using ConfigMap Data in Pods](/docs/tasks/configure-pod-container/configure-pod-configmap). * Follow a real world example of [Configuring Redis using a ConfigMap](/docs/tutorials/configuration/configure-redis-using-configmap/). From e96354d9ba0e94c4746f4b760f8e3853f41281e4 Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:29:26 -0700 Subject: [PATCH 6/9] Revert "Move Understanding Configmaps to a separate concept file" This reverts commit 71bd80d7bccd090d0aa1829ae9e4db6cc4dc590c. --- .../configure-pod-container/configmap.md | 55 +++++++++++++++---- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/docs/tasks/configure-pod-container/configmap.md b/docs/tasks/configure-pod-container/configmap.md index c8bb5aa536ac8..abccc6bf197e1 100644 --- a/docs/tasks/configure-pod-container/configmap.md +++ b/docs/tasks/configure-pod-container/configmap.md @@ -11,7 +11,7 @@ redirect_from: {% capture overview %} -This page shows you how to configure an application using a ConfigMap. +This page shows you how to configure an application using a ConfigMap. {% endcapture %} @@ -24,7 +24,7 @@ This page shows you how to configure an application using a ConfigMap. {% capture steps %} -## Use kubectl to create a ConfigMap +## Use kubectl to create a ConfigMap Use the `kubectl create configmap` command to create configmaps from [directories](#creating-configmaps-from-directories), [files](#creating-configmaps-from-files), or [literal values](#creating-configmaps-from-literal-values): @@ -33,17 +33,17 @@ kubectl create configmap ``` where \ is the name you want to assign to the ConfigMap and \ is the directory, file, or literal value to draw the data from. - + The data source corresponds to a key-value pair in the ConfigMap, where -* key = the file name or the key you provided on the command line, and +* key = the file name or the key you provided on the command line, and * value = the file contents or the literal value you provided on the command line. - + You can use [`kubectl describe`](docs/user-guide/kubectl/v1.6/#describe) or [`kubectl get`](docs/user-guide/kubectl/v1.6/#get) to retrieve information about a ConfigMap. The former shows a summary of the ConfigMap, while the latter returns the full contents of the ConfigMap. ### Create ConfigMaps from directories -You can use `kubectl create configmap` to create a ConfigMap from multiple files in the same directory. +You can use `kubectl create configmap` to create a ConfigMap from multiple files in the same directory. For example: @@ -110,10 +110,10 @@ metadata: You can use `kubectl create configmap` to create a ConfigMap from an individual file, or from multiple files. -For example, +For example, ```shell -kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties +kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties ``` would produce the following ConfigMap: @@ -131,9 +131,9 @@ game.properties: 158 bytes ``` You can pass in the `--from-file` argument multiple times to create a ConfigMap from multiple data sources. - + ```shell -kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties --from-file=docs/user-guide/configmap/kubectl/ui.properties +kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties --from-file=docs/user-guide/configmap/kubectl/ui.properties ``` ```shell @@ -158,8 +158,8 @@ kubectl create configmap game-config-3 --from-file== ``` where `` is the key you want to use in the ConfigMap and `` is the location of the data source file you want the key to represent. - -For example: + +For example: ```shell kubectl create configmap game-config-3 --from-file=game-special-key=docs/user-guide/configmap/kubectl/game.properties @@ -219,6 +219,37 @@ metadata: {% endcapture %} +{% capture discussion %} + +## Understanding ConfigMaps + +ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable. +The ConfigMap API resource stores configuration data as key-value pairs. The data can be consumed in pods or provide the configurations for system components such as controllers. ConfigMap is similar to [Secrets](/docs/concepts/configuration/secret/), but provides a means of working with strings that don't contain sensitive information. Users and system components alike can store configuration data in ConfigMap. + +Note: ConfigMaps should reference properties files, not replace them. Think of the ConfigMap as representing something similar to the a Linux `/etc` directory and its contents. For example, if you create a [Kubernetes Volume](/docs/concepts/storage/volumes/) from a ConfigMap, each data item in the ConfigMap is represented by an individual file in the volume. + +The ConfigMap's `data` field contains the configuration data. As shown in the example below, this can be simple -- like individual properties defined using `--from-literal` -- or complex -- like configuration files or JSON blobs defined using `--from-file`. + +```yaml +kind: ConfigMap +apiVersion: v1 +metadata: + creationTimestamp: 2016-02-18T19:14:38Z + name: example-config + namespace: default +data: + # example of a simple property defined using --from-literal + example.property.1: hello + example.property.2: world + # example of a complex property defined using --from-file + example.property.file: |- + property.1=value-1 + property.2=value-2 + property.3=value-3 +``` + +{% endcapture %} + {% capture whatsnext %} * See [Using ConfigMap Data in Pods](/docs/tasks/configure-pod-container/configure-pod-configmap). * Follow a real world example of [Configuring Redis using a ConfigMap](/docs/tutorials/configuration/configure-redis-using-configmap/). From 758a3bbcb23d2ca4dddd751093d68d7d7b2cf17a Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:29:50 -0700 Subject: [PATCH 7/9] Revert "Add configuration entry for understanding configmaps" This reverts commit c27fc13f56453dff6e6b8b8f1f9641cbad8ace53. --- _data/concepts.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_data/concepts.yml b/_data/concepts.yml index ca76a2348a1df..1e03af5f84d35 100644 --- a/_data/concepts.yml +++ b/_data/concepts.yml @@ -53,7 +53,6 @@ toc: - docs/concepts/configuration/manage-compute-resources-container.md - docs/concepts/configuration/assign-pod-node.md - docs/concepts/configuration/secret.md - - docs/concepts/configuration/understanding-configmaps.md - title: Services, Load Balancing, and Networking section: @@ -87,3 +86,5 @@ toc: section: - docs/concepts/policy/resource-quotas.md - docs/concepts/policy/pod-security-policy.md + + From 596bee595c24d0258f13084f3909cb0821209be4 Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:30:01 -0700 Subject: [PATCH 8/9] Revert "Add new topic for configmaps in concepts" This reverts commit 3d535f59170a4b5cb290975871f167217484e7ab. --- .../configuration/understanding-configmaps.md | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 docs/concepts/configuration/understanding-configmaps.md diff --git a/docs/concepts/configuration/understanding-configmaps.md b/docs/concepts/configuration/understanding-configmaps.md deleted file mode 100644 index 202f7266b7be1..0000000000000 --- a/docs/concepts/configuration/understanding-configmaps.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Understanding ConfigMaps ---- - -{% capture overview %} - -A `ConfigMap` lets you separate configuration data for a container image from the container image itself. Decoupling configuration artifacts from image content keeps your containerized applications portable. - -{% endcapture %} - -{% capture body %} - -## ConfigMaps - -The [ConfigMap API resource](/docs/api-reference/v1.6/#configmap-v1-core) stores configuration data as key-value pairs. The data can be consumed in pods or provide the configurations for system components, such as controllers. ConfigMap is similar to [Secrets](/docs/concepts/configuration/secret/), but provides a means of working with strings that don't contain sensitive information. Users and system components alike can store configuration data in a ConfigMap. - -**Note:** ConfigMaps should reference properties files, not replace them. - -A ConfigMap is similar to a Linux `/etc` directory and its contents. For example, if you create a [Kubernetes Volume](/docs/concepts/storage/volumes/) from a ConfigMap, each data item in the ConfigMap is represented by an individual file in the volume. - -A ConfigMap's `data` field contains the configuration data. Assigning `data` values can be simple, defining individual properties using `--from-literal`. Assignments can also be complex, defining multiple properties from configuration files or JSON blobs using `--from-file`. The following example demonstrates simple and complex methods: - -{% include code.html language="yaml" file="concept-configmap.yaml" ghlink="/docs/concepts/configuration/concept-configmap.yaml" %} - -{% endcapture %} - -{% capture whatsnext %} - -* See [Using ConfigMap Data in Pods](/docs/tasks/configure-pod-container/configure-pod-configmap). -* Follow a real world example of [Configuring Redis using a ConfigMap](/docs/tutorials/configuration/configure-redis-using-configmap/). - -{% endcapture %} - -{% include templates/task.md %} From 6822ece7cf1e7ac578c02f727cf514a0d9634486 Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Jun 2017 16:30:13 -0700 Subject: [PATCH 9/9] Revert "Add YAML file for configmaps in concepts" This reverts commit 8ecabd6d106647631819441be8bf7e834f0dbb54. --- .../concepts/configuration/concept-configmap.yaml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 docs/concepts/configuration/concept-configmap.yaml diff --git a/docs/concepts/configuration/concept-configmap.yaml b/docs/concepts/configuration/concept-configmap.yaml deleted file mode 100644 index 53316368d42bf..0000000000000 --- a/docs/concepts/configuration/concept-configmap.yaml +++ /dev/null @@ -1,15 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - creationTimestamp: 2016-02-18T19:14:38Z - name: example-config - namespace: default -data: - # example of a simple property defined using --from-literal - example.property.1: hello - example.property.2: world - # example of a complex property defined using --from-file - example.property.file: |- - property.1=value-1 - property.2=value-2 - property.3=value-3