Skip to content

Commit

Permalink
Merge pull request #39446 from fraenkel/env_secrets
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 39446, 40023, 36853)

Create environment variables from secrets

Allow environment variables to be populated from entire secrets.

**Release note**:
```release-note
Populate environment variables from a secrets.
```
  • Loading branch information
Kubernetes Submit Queue committed Jan 20, 2017
2 parents 7392f56 + 5048c01 commit 2d4d2f9
Show file tree
Hide file tree
Showing 28 changed files with 2,160 additions and 1,019 deletions.
13 changes: 13 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -35499,6 +35499,10 @@
"prefix": {
"description": "An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.",
"type": "string"
},
"secretRef": {
"description": "The Secret to select from",
"$ref": "#/definitions/v1.SecretEnvSource"
}
}
},
Expand Down Expand Up @@ -38203,6 +38207,15 @@
}
}
},
"v1.SecretEnvSource": {
"description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.",
"properties": {
"name": {
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
"type": "string"
}
}
},
"v1.SecretKeySelector": {
"description": "SecretKeySelector selects a key of a Secret.",
"required": [
Expand Down
14 changes: 14 additions & 0 deletions api/swagger-spec/apps_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,10 @@
"configMapRef": {
"$ref": "v1.ConfigMapEnvSource",
"description": "The ConfigMap to select from"
},
"secretRef": {
"$ref": "v1.SecretEnvSource",
"description": "The Secret to select from"
}
}
},
Expand All @@ -2270,6 +2274,16 @@
}
}
},
"v1.SecretEnvSource": {
"id": "v1.SecretEnvSource",
"description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.",
"properties": {
"name": {
"type": "string",
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
}
}
},
"v1.EnvVar": {
"id": "v1.EnvVar",
"description": "EnvVar represents an environment variable present in a Container.",
Expand Down
14 changes: 14 additions & 0 deletions api/swagger-spec/batch_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,10 @@
"configMapRef": {
"$ref": "v1.ConfigMapEnvSource",
"description": "The ConfigMap to select from"
},
"secretRef": {
"$ref": "v1.SecretEnvSource",
"description": "The Secret to select from"
}
}
},
Expand All @@ -2275,6 +2279,16 @@
}
}
},
"v1.SecretEnvSource": {
"id": "v1.SecretEnvSource",
"description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.",
"properties": {
"name": {
"type": "string",
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
}
}
},
"v1.EnvVar": {
"id": "v1.EnvVar",
"description": "EnvVar represents an environment variable present in a Container.",
Expand Down
14 changes: 14 additions & 0 deletions api/swagger-spec/extensions_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8634,6 +8634,10 @@
"configMapRef": {
"$ref": "v1.ConfigMapEnvSource",
"description": "The ConfigMap to select from"
},
"secretRef": {
"$ref": "v1.SecretEnvSource",
"description": "The Secret to select from"
}
}
},
Expand All @@ -8647,6 +8651,16 @@
}
}
},
"v1.SecretEnvSource": {
"id": "v1.SecretEnvSource",
"description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.",
"properties": {
"name": {
"type": "string",
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
}
}
},
"v1.EnvVar": {
"id": "v1.EnvVar",
"description": "EnvVar represents an environment variable present in a Container.",
Expand Down
14 changes: 14 additions & 0 deletions api/swagger-spec/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -18726,6 +18726,10 @@
"configMapRef": {
"$ref": "v1.ConfigMapEnvSource",
"description": "The ConfigMap to select from"
},
"secretRef": {
"$ref": "v1.SecretEnvSource",
"description": "The Secret to select from"
}
}
},
Expand All @@ -18739,6 +18743,16 @@
}
}
},
"v1.SecretEnvSource": {
"id": "v1.SecretEnvSource",
"description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.",
"properties": {
"name": {
"type": "string",
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
}
}
},
"v1.EnvVar": {
"id": "v1.EnvVar",
"description": "EnvVar represents an environment variable present in a Container.",
Expand Down
46 changes: 45 additions & 1 deletion docs/api-reference/apps/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,43 @@ <h3 id="_v1_httpgetaction">v1.HTTPGetAction</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_secretenvsource">v1.SecretEnvSource</h3>
<div class="paragraph">
<p>SecretEnvSource selects a Secret to populate the environment variables with.</p>
</div>
<div class="paragraph">
<p>The contents of the target Secret&#8217;s Data field will represent the key-value pairs as environment variables.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Name of the referent. More info: <a href="http://kubernetes.io/docs/user-guide/identifiers#names">http://kubernetes.io/docs/user-guide/identifiers#names</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_statusdetails">v1.StatusDetails</h3>
Expand Down Expand Up @@ -2555,6 +2592,13 @@ <h3 id="_v1_envfromsource">v1.EnvFromSource</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_configmapenvsource">v1.ConfigMapEnvSource</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">secretRef</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Secret to select from</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_secretenvsource">v1.SecretEnvSource</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -4967,7 +5011,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-18 15:32:06 UTC
Last updated 2017-01-19 19:02:01 UTC
</div>
</div>
</body>
Expand Down
46 changes: 45 additions & 1 deletion docs/api-reference/batch/v1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,43 @@ <h3 id="_v1_httpgetaction">v1.HTTPGetAction</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_secretenvsource">v1.SecretEnvSource</h3>
<div class="paragraph">
<p>SecretEnvSource selects a Secret to populate the environment variables with.</p>
</div>
<div class="paragraph">
<p>The contents of the target Secret&#8217;s Data field will represent the key-value pairs as environment variables.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Name of the referent. More info: <a href="http://kubernetes.io/docs/user-guide/identifiers#names">http://kubernetes.io/docs/user-guide/identifiers#names</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_statusdetails">v1.StatusDetails</h3>
Expand Down Expand Up @@ -2466,6 +2503,13 @@ <h3 id="_v1_envfromsource">v1.EnvFromSource</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_configmapenvsource">v1.ConfigMapEnvSource</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">secretRef</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Secret to select from</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_secretenvsource">v1.SecretEnvSource</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -4899,7 +4943,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-18 15:32:28 UTC
Last updated 2017-01-19 19:02:17 UTC
</div>
</div>
</body>
Expand Down
46 changes: 45 additions & 1 deletion docs/api-reference/extensions/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,43 @@ <h3 id="_v1_gitrepovolumesource">v1.GitRepoVolumeSource</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_secretenvsource">v1.SecretEnvSource</h3>
<div class="paragraph">
<p>SecretEnvSource selects a Secret to populate the environment variables with.</p>
</div>
<div class="paragraph">
<p>The contents of the target Secret&#8217;s Data field will represent the key-value pairs as environment variables.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Name of the referent. More info: <a href="http://kubernetes.io/docs/user-guide/identifiers#names">http://kubernetes.io/docs/user-guide/identifiers#names</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_capabilities">v1.Capabilities</h3>
Expand Down Expand Up @@ -2406,6 +2443,13 @@ <h3 id="_v1_envfromsource">v1.EnvFromSource</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_configmapenvsource">v1.ConfigMapEnvSource</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">secretRef</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Secret to select from</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_secretenvsource">v1.SecretEnvSource</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -7516,7 +7560,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-18 15:32:45 UTC
Last updated 2017-01-19 19:02:29 UTC
</div>
</div>
</body>
Expand Down
Loading

0 comments on commit 2d4d2f9

Please sign in to comment.