Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
62f7220d
Commit
62f7220d
authored
Nov 19, 2015
by
Paul Morie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proposal: config data volume source
parent
b1255027
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
1 deletion
+69
-1
config_data.md
docs/proposals/config_data.md
+69
-1
No files found.
docs/proposals/config_data.md
View file @
62f7220d
...
...
@@ -173,7 +173,36 @@ type ConfigDataSelector struct {
### Volume Source
The volume source will be addressed in a follow-up PR.
A new
`ConfigDataVolumeSource`
type of volume source containing the
`ConfigData`
object will be
added to the
`VolumeSource`
struct in the API:
```
go
package
api
type
VolumeSource
struct
{
// other fields omitted
ConfigData
*
ConfigDataVolumeSource
`json:"configData,omitempty"`
}
// ConfigDataVolumeSource represents a volume that holds configuration data
type
ConfigDataVolumeSource
struct
{
// A list of config data keys to project into the volume in files
Files
[]
ConfigDataVolumeFile
`json:"files"`
}
// ConfigDataVolumeFile represents a single file containing config data
type
ConfigDataVolumeFile
struct
{
ConfigDataSelector
`json:",inline"`
// The relative path name of the file to be created.
// Must not be absolute or contain the '..' path. Must be utf-8 encoded.
// The first item of the relative path must not start with '..'
Path
string
`json:"path"`
}
```
**Note:**
The update logic used in the downward API volume plug-in will be extracted and re-used in
the volume plug-in for
`ConfigData`
.
## Examples
...
...
@@ -237,6 +266,45 @@ spec:
key
:
etcdctl_peers
```
### Consuming `ConfigData` as Volumes
`redis-volume-config`
is intended to be used as a volume containing a config file:
```
yaml
apiVersion
:
extensions/v1beta1
kind
:
ConfigData
metadata
:
name
:
redis-volume-config
data
:
redis.conf
:
"
pidfile
/var/run/redis.pid
\n
port6379
\n
tcp-backlog
511
\n
databases
1
\n
timeout
0
\n
"
```
The following pod consumes the
`redis-volume-config`
in a volume:
```
yaml
apiVersion
:
v1
kind
:
Pod
metadata
:
name
:
config-volume-example
spec
:
containers
:
-
name
:
redis
image
:
kubernetes/redis
command
:
"
redis-server
/mnt/config-data/etc/redis.conf"
ports
:
-
containerPort
:
6379
volumeMounts
:
-
name
:
config-data-volume
mountPath
:
/mnt/config-data
volumes
:
-
name
:
config-data-volume
configData
:
files
:
-
path
:
"
etc/redis.conf"
configDataName
:
redis-volume-config
key
:
redis.conf
```
### Future Improvements
In the future, we may add the ability to specify an init-container that can watch the volume
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment