forked from kubernetes/website
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translate /docs/tutorials/configuration/configure-redis-using-configm…
…ap.md in Japanese (kubernetes#15639) * translate redis example * add index * Update content/ja/docs/tutorials/configuration/configure-redis-using-configmap.md Co-Authored-By: nasa9084 <[email protected]> * Update content/ja/docs/tutorials/configuration/configure-redis-using-configmap.md Co-Authored-By: nasa9084 <[email protected]> * Update content/ja/docs/tutorials/configuration/configure-redis-using-configmap.md Co-Authored-By: nasa9084 <[email protected]> * review
- Loading branch information
Kohei Ota
committed
Nov 11, 2019
1 parent
fa89c4b
commit 1c44ed8
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: "設定" | ||
weight: 30 | ||
--- | ||
|
106 changes: 106 additions & 0 deletions
106
content/ja/docs/tutorials/configuration/configure-redis-using-configmap.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
title: ConfigMapを使ったRedisの設定 | ||
content_template: templates/tutorial | ||
--- | ||
|
||
{{% capture overview %}} | ||
|
||
本ページでは、[ConfigMapを使ったコンテナの設定](/docs/tasks/configure-pod-container/configure-pod-configmap/)に基づき、ConfigMapを使ってRedisの設定を行う実践的な例を提供します。 | ||
|
||
{{% /capture %}} | ||
|
||
{{% capture objectives %}} | ||
|
||
* 以下の要素を含む`kustomization.yaml`ファイルを作成する: | ||
* ConfigMapGenerator | ||
* ConfigMapを使ったPodリソースの設定 | ||
* `kubectl apply -k ./`コマンドにてディレクトリ全体を適用する | ||
* 設定が正しく反映されていることを確認する | ||
|
||
{{% /capture %}} | ||
|
||
{{% capture prerequisites %}} | ||
|
||
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} | ||
* この例は、バージョン1.14以上での動作を確認しています。 | ||
* [ConfigMapを使ったコンテナの設定](/docs/tasks/configure-pod-container/configure-pod-configmap/)を読んで理解しておいてください。 | ||
|
||
{{% /capture %}} | ||
|
||
{{% capture lessoncontent %}} | ||
|
||
|
||
## 実践例: ConfigMapを使ったRedisの設定 | ||
|
||
以下の手順に従って、ConfigMapに保存されているデータを使用してRedisキャッシュを設定できます。 | ||
|
||
最初に、`redis-config`ファイルからConfigMapを含む`kustomization.yaml`を作成します: | ||
|
||
{{< codenew file="pods/config/redis-config" >}} | ||
|
||
```shell | ||
curl -OL https://k8s.io/examples/pods/config/redis-config | ||
|
||
cat <<EOF >./kustomization.yaml | ||
configMapGenerator: | ||
- name: example-redis-config | ||
files: | ||
- redis-config | ||
EOF | ||
``` | ||
|
||
Podリソースの設定を`kustomization.yaml`に入れます: | ||
|
||
{{< codenew file="pods/config/redis-pod.yaml" >}} | ||
|
||
```shell | ||
curl -OL https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/config/redis-pod.yaml | ||
|
||
cat <<EOF >>./kustomization.yaml | ||
resources: | ||
- redis-pod.yaml | ||
EOF | ||
``` | ||
|
||
kustomizationディレクトリを反映して、ConfigMapオブジェクトとPodオブジェクトの両方を作成します: | ||
|
||
```shell | ||
kubectl apply -k . | ||
``` | ||
|
||
Examine the created objects by | ||
```shell | ||
> kubectl get -k . | ||
NAME DATA AGE | ||
configmap/example-redis-config-dgh9dg555m 1 52s | ||
|
||
NAME READY STATUS RESTARTS AGE | ||
pod/redis 1/1 Running 0 52s | ||
``` | ||
|
||
この例では、設定ファイルのボリュームは`/redis-master`にマウントされています。 | ||
`path`を使って`redis-config`キーを`redis.conf`という名前のファイルに追加します。 | ||
したがって、redisコンフィグのファイルパスは`/redis-master/redis.conf`です。 | ||
ここが、コンテナイメージがredisマスターの設定ファイルを探す場所です。 | ||
|
||
`kubectl exec`を使ってPodに入り、`redis-cli`ツールを実行して設定が正しく適用されたことを確認してください: | ||
|
||
```shell | ||
kubectl exec -it redis redis-cli | ||
127.0.0.1:6379> CONFIG GET maxmemory | ||
1) "maxmemory" | ||
2) "2097152" | ||
127.0.0.1:6379> CONFIG GET maxmemory-policy | ||
1) "maxmemory-policy" | ||
2) "allkeys-lru" | ||
``` | ||
|
||
{{% /capture %}} | ||
|
||
{{% capture whatsnext %}} | ||
|
||
* [ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/)について学ぶ | ||
|
||
{{% /capture %}} | ||
|
||
|