Merge pull request #37953 from liggitt/automount

Automatic merge from submit-queue (batch tested with PRs 37137, 41506, 41239, 41511, 37953)

Add field to control service account token automounting

Fixes https://github.com/kubernetes/kubernetes/issues/16779

* adds an `automountServiceAccountToken *bool` field to `ServiceAccount` and `PodSpec`
* if set in both the service account and pod, the pod wins
* if unset in both the service account and pod, we automount for backwards compatibility

```release-note
An `automountServiceAccountToken *bool` field was added to ServiceAccount and PodSpec objects. If set to `false` on a pod spec, no service account token is automounted in the pod. If set to `false` on a service account, no service account token is automounted for that service account unless explicitly overridden in the pod spec.
```
This commit is contained in:
Kubernetes Submit Queue
2017-02-15 20:05:13 -08:00
committed by GitHub
26 changed files with 1616 additions and 1097 deletions

View File

@@ -6383,6 +6383,13 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
Format: "",
},
},
"automountServiceAccountToken": {
SchemaProps: spec.SchemaProps{
Description: "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.",
Type: []string{"boolean"},
Format: "",
},
},
"nodeName": {
SchemaProps: spec.SchemaProps{
Description: "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.",
@@ -8285,6 +8292,13 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
},
},
},
"automountServiceAccountToken": {
SchemaProps: spec.SchemaProps{
Description: "AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.",
Type: []string{"boolean"},
Format: "",
},
},
},
},
},