Update configmap design doc
This commit is contained in:
parent
56e6a752c3
commit
fe74e492c8
@ -154,15 +154,15 @@ package api
|
|||||||
type EnvVarSource struct {
|
type EnvVarSource struct {
|
||||||
// other fields omitted
|
// other fields omitted
|
||||||
|
|
||||||
// Specifies a ConfigMap key
|
// Selects a key of a ConfigMap.
|
||||||
ConfigMap *ConfigMapSelector `json:"configMap,omitempty"`
|
ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConfigMapSelector selects a key of a ConfigMap.
|
// Selects a key from a ConfigMap.
|
||||||
type ConfigMapSelector struct {
|
type ConfigMapKeySelector struct {
|
||||||
// The name of the ConfigMap to select a key from.
|
// The ConfigMap to select from.
|
||||||
ConfigMapName string `json:"configMapName"`
|
LocalObjectReference `json:",inline"`
|
||||||
// The key of the ConfigMap to select.
|
// The key to select.
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -249,28 +249,28 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: ETCD_NUM_MEMBERS
|
- name: ETCD_NUM_MEMBERS
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMap:
|
configMapKeyRef:
|
||||||
configMapName: etcd-env-config
|
name: etcd-env-config
|
||||||
key: number-of-members
|
key: number-of-members
|
||||||
- name: ETCD_INITIAL_CLUSTER_STATE
|
- name: ETCD_INITIAL_CLUSTER_STATE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMap:
|
configMapKeyRef:
|
||||||
configMapName: etcd-env-config
|
name: etcd-env-config
|
||||||
key: initial-cluster-state
|
key: initial-cluster-state
|
||||||
- name: ETCD_DISCOVERY_TOKEN
|
- name: ETCD_DISCOVERY_TOKEN
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMap:
|
configMapKeyRef:
|
||||||
configMapName: etcd-env-config
|
name: etcd-env-config
|
||||||
key: discovery-token
|
key: discovery-token
|
||||||
- name: ETCD_DISCOVERY_URL
|
- name: ETCD_DISCOVERY_URL
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMap:
|
configMapKeyRef:
|
||||||
configMapName: etcd-env-config
|
name: etcd-env-config
|
||||||
key: discovery-url
|
key: discovery-url
|
||||||
- name: ETCDCTL_PEERS
|
- name: ETCDCTL_PEERS
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMap:
|
configMapKeyRef:
|
||||||
configMapName: etcd-env-config
|
name: etcd-env-config
|
||||||
key: etcdctl-peers
|
key: etcdctl-peers
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -279,12 +279,12 @@ spec:
|
|||||||
`redis-volume-config` is intended to be used as a volume containing a config file:
|
`redis-volume-config` is intended to be used as a volume containing a config file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-volume-config
|
name: redis-volume-config
|
||||||
data:
|
data:
|
||||||
redis.conf: "pidfile /var/run/redis.pid\nport6379\ntcp-backlog 511\n databases 1\ntimeout 0\n"
|
redis.conf: "pidfile /var/run/redis.pid\nport 6379\ntcp-backlog 511\ndatabases 1\ntimeout 0\n"
|
||||||
```
|
```
|
||||||
|
|
||||||
The following pod consumes the `redis-volume-config` in a volume:
|
The following pod consumes the `redis-volume-config` in a volume:
|
||||||
@ -298,7 +298,7 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
image: kubernetes/redis
|
image: kubernetes/redis
|
||||||
command: "redis-server /mnt/config-map/etc/redis.conf"
|
command: ["redis-server", "/mnt/config-map/etc/redis.conf"]
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 6379
|
- containerPort: 6379
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
Loading…
Reference in New Issue
Block a user