Skip to content

Commit

Permalink
Merge pull request #7343 from pweil-/security-context-types
Browse files Browse the repository at this point in the history
Security context - types, kubelet, admission
  • Loading branch information
pmorie committed May 5, 2015
2 parents b9ea2c3 + 5e5b904 commit 1625e23
Show file tree
Hide file tree
Showing 50 changed files with 2,544 additions and 644 deletions.
57 changes: 53 additions & 4 deletions api/swagger-spec/v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -7501,7 +7501,7 @@
"properties": {
"capabilities": {
"$ref": "v1beta1.Capabilities",
"description": "capabilities for container; cannot be updated"
"description": "capabilities for container; cannot be updated; deprecated; See SecurityContext"
},
"command": {
"type": "array",
Expand Down Expand Up @@ -7563,7 +7563,7 @@
},
"privileged": {
"type": "boolean",
"description": "whether or not the container is granted privileged status; defaults to false; cannot be updated"
"description": "whether or not the container is granted privileged status; defaults to false; cannot be updated; deprecated; See SecurityContext"
},
"readinessProbe": {
"$ref": "v1beta1.LivenessProbe",
Expand All @@ -7573,6 +7573,10 @@
"$ref": "v1beta1.ResourceRequirements",
"description": "Compute Resources required by this container; cannot be updated"
},
"securityContext": {
"$ref": "v1beta1.SecurityContext",
"description": "security options the pod should run with"
},
"terminationMessagePath": {
"type": "string",
"description": "path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log; cannot be updated"
Expand Down Expand Up @@ -7623,7 +7627,8 @@
"description": "restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"
},
"terminationGracePeriodSeconds": {
"$ref": "int64",
"type": "integer",
"format": "int64",
"description": "optional duration in seconds the pod needs to terminate gracefully; may be decreased in delete request; value must be non-negative integer; the value zero indicates delete immediately; if this value is not set, the default grace period will be used instead; the grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal; set this value longer than the expected cleanup time for your process"
},
"uuid": {
Expand Down Expand Up @@ -7700,7 +7705,8 @@
"description": "an optional prefix to use to generate a unique name; has the same validation rules as name; optional, and is applied only name if is not specified"
},
"gracePeriodSeconds": {
"$ref": "int64",
"type": "integer",
"format": "int64",
"description": "the duration in seconds to wait before deleting this object; defaults to a per object value if not specified; zero means delete immediately"
},
"id": {
Expand Down Expand Up @@ -9817,6 +9823,27 @@
"id": "v1beta1.RestartPolicyOnFailure",
"properties": {}
},
"v1beta1.SELinuxOptions": {
"id": "v1beta1.SELinuxOptions",
"properties": {
"level": {
"type": "string",
"description": "the level label to apply to the container"
},
"role": {
"type": "string",
"description": "the role label to apply to the container"
},
"type": {
"type": "string",
"description": "the type label to apply to the container"
},
"user": {
"type": "string",
"description": "the user label to apply to the container"
}
}
},
"v1beta1.Secret": {
"id": "v1beta1.Secret",
"properties": {
Expand Down Expand Up @@ -9945,6 +9972,28 @@
}
}
},
"v1beta1.SecurityContext": {
"id": "v1beta1.SecurityContext",
"properties": {
"capabilities": {
"$ref": "v1beta1.Capabilities",
"description": "the linux capabilites that should be added or removed"
},
"privileged": {
"type": "boolean",
"description": "run the container in privileged mode"
},
"runAsUser": {
"type": "integer",
"format": "int64",
"description": "the user id that runs the first process in the container"
},
"seLinuxOptions": {
"$ref": "v1beta1.SELinuxOptions",
"description": "options that control the SELinux labels applied"
}
}
},
"v1beta1.Service": {
"id": "v1beta1.Service",
"required": [
Expand Down
61 changes: 55 additions & 6 deletions api/swagger-spec/v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7501,7 +7501,7 @@
"properties": {
"capabilities": {
"$ref": "v1beta2.Capabilities",
"description": "capabilities for container; cannot be updated"
"description": "capabilities for container; cannot be updated; deprecated; See SecurityContext"
},
"command": {
"type": "array",
Expand Down Expand Up @@ -7563,7 +7563,7 @@
},
"privileged": {
"type": "boolean",
"description": "whether or not the container is granted privileged status; defaults to false; cannot be updated"
"description": "whether or not the container is granted privileged status; defaults to false; cannot be updated; deprecated; See SecurityContext"
},
"readinessProbe": {
"$ref": "v1beta2.LivenessProbe",
Expand All @@ -7573,6 +7573,10 @@
"$ref": "v1beta2.ResourceRequirements",
"description": "Compute Resources required by this container; cannot be updated"
},
"securityContext": {
"$ref": "v1beta2.SecurityContext",
"description": "security options the pod should run with"
},
"terminationMessagePath": {
"type": "string",
"description": "path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log; cannot be updated"
Expand Down Expand Up @@ -7623,7 +7627,8 @@
"description": "restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"
},
"terminationGracePeriodSeconds": {
"$ref": "int64",
"type": "integer",
"format": "int64",
"description": "optional duration in seconds the pod needs to terminate gracefully; may be decreased in delete request; value must be non-negative integer; the value zero indicates delete immediately; if this value is not set, the default grace period will be used instead; the grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal; set this value longer than the expected cleanup time for your process"
},
"uuid": {
Expand Down Expand Up @@ -7700,7 +7705,8 @@
"description": "an optional prefix to use to generate a unique name; has the same validation rules as name; optional, and is applied only name if is not specified"
},
"gracePeriodSeconds": {
"$ref": "int64",
"type": "integer",
"format": "int64",
"description": "the duration in seconds to wait before deleting this object; defaults to a per object value if not specified; zero means delete immediately"
},
"id": {
Expand Down Expand Up @@ -9231,10 +9237,10 @@
"v1beta2.PersistentVolumeSpec": {
"id": "v1beta2.PersistentVolumeSpec",
"required": [
"glusterfs",
"persistentDisk",
"awsElasticBlockStore",
"hostPath"
"hostPath",
"glusterfs"
],
"properties": {
"accessModes": {
Expand Down Expand Up @@ -9806,6 +9812,27 @@
"id": "v1beta2.RestartPolicyOnFailure",
"properties": {}
},
"v1beta2.SELinuxOptions": {
"id": "v1beta2.SELinuxOptions",
"properties": {
"level": {
"type": "string",
"description": "the level label to apply to the container"
},
"role": {
"type": "string",
"description": "the role label to apply to the container"
},
"type": {
"type": "string",
"description": "the type label to apply to the container"
},
"user": {
"type": "string",
"description": "the user label to apply to the container"
}
}
},
"v1beta2.Secret": {
"id": "v1beta2.Secret",
"properties": {
Expand Down Expand Up @@ -9934,6 +9961,28 @@
}
}
},
"v1beta2.SecurityContext": {
"id": "v1beta2.SecurityContext",
"properties": {
"capabilities": {
"$ref": "v1beta2.Capabilities",
"description": "the linux capabilites that should be added or removed"
},
"privileged": {
"type": "boolean",
"description": "run the container in privileged mode"
},
"runAsUser": {
"type": "integer",
"format": "int64",
"description": "the user id that runs the first process in the container"
},
"seLinuxOptions": {
"$ref": "v1beta2.SELinuxOptions",
"description": "options that control the SELinux labels applied"
}
}
},
"v1beta2.Service": {
"id": "v1beta2.Service",
"required": [
Expand Down
67 changes: 58 additions & 9 deletions api/swagger-spec/v1beta3.json
Original file line number Diff line number Diff line change
Expand Up @@ -8458,7 +8458,7 @@
},
"capabilities": {
"$ref": "v1beta3.Capabilities",
"description": "capabilities for container; cannot be updated"
"description": "capabilities for container; cannot be updated; deprecated; See SecurityContext."
},
"command": {
"type": "array",
Expand Down Expand Up @@ -8503,7 +8503,7 @@
},
"privileged": {
"type": "boolean",
"description": "whether or not the container is granted privileged status; defaults to false; cannot be updated"
"description": "whether or not the container is granted privileged status; defaults to false; cannot be updated; deprecated; See SecurityContext."
},
"readinessProbe": {
"$ref": "v1beta3.Probe",
Expand All @@ -8513,6 +8513,10 @@
"$ref": "v1beta3.ResourceRequirements",
"description": "Compute Resources required by this container; cannot be updated"
},
"securityContext": {
"$ref": "v1beta3.SecurityContext",
"description": "security options the pod should run with"
},
"terminationMessagePath": {
"type": "string",
"description": "path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log; cannot be updated"
Expand Down Expand Up @@ -8689,7 +8693,8 @@
"description": "version of the schema the object should have"
},
"gracePeriodSeconds": {
"$ref": "int64",
"type": "integer",
"format": "int64",
"description": "the duration in seconds to wait before deleting this object; defaults to a per object value if not specified; zero means delete immediately"
},
"kind": {
Expand Down Expand Up @@ -9888,7 +9893,8 @@
"description": "restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"
},
"terminationGracePeriodSeconds": {
"$ref": "int64",
"type": "integer",
"format": "int64",
"description": "optional duration in seconds the pod needs to terminate gracefully; may be decreased in delete request; value must be non-negative integer; the value zero indicates delete immediately; if this value is not set, the default grace period will be used instead; the grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal; set this value longer than the expected cleanup time for your process"
},
"volumes": {
Expand Down Expand Up @@ -10200,6 +10206,27 @@
}
}
},
"v1beta3.SELinuxOptions": {
"id": "v1beta3.SELinuxOptions",
"properties": {
"level": {
"type": "string",
"description": "the level label to apply to the container"
},
"role": {
"type": "string",
"description": "the role label to apply to the container"
},
"type": {
"type": "string",
"description": "the type label to apply to the container"
},
"user": {
"type": "string",
"description": "the user label to apply to the container"
}
}
},
"v1beta3.Secret": {
"id": "v1beta3.Secret",
"properties": {
Expand Down Expand Up @@ -10264,6 +10291,28 @@
}
}
},
"v1beta3.SecurityContext": {
"id": "v1beta3.SecurityContext",
"properties": {
"capabilities": {
"$ref": "v1beta3.Capabilities",
"description": "the linux capabilites that should be added or removed"
},
"privileged": {
"type": "boolean",
"description": "run the container in privileged mode"
},
"runAsUser": {
"type": "integer",
"format": "int64",
"description": "the user id that runs the first process in the container"
},
"seLinuxOptions": {
"$ref": "v1beta3.SELinuxOptions",
"description": "options that control the SELinux labels applied"
}
}
},
"v1beta3.Service": {
"id": "v1beta3.Service",
"properties": {
Expand Down Expand Up @@ -10480,15 +10529,15 @@
"id": "v1beta3.Volume",
"required": [
"name",
"gcePersistentDisk",
"awsElasticBlockStore",
"gitRepo",
"secret",
"nfs",
"glusterfs",
"iscsi",
"hostPath",
"emptyDir",
"gcePersistentDisk",
"iscsi"
"secret",
"glusterfs",
"emptyDir"
],
"properties": {
"awsElasticBlockStore": {
Expand Down
2 changes: 1 addition & 1 deletion cluster/aws/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ DNS_DOMAIN="kubernetes.local"
DNS_REPLICAS=1

# Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ResourceQuota
2 changes: 1 addition & 1 deletion cluster/azure/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ ELASTICSEARCH_LOGGING_REPLICAS=1
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-true}"

# Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ResourceQuota
2 changes: 1 addition & 1 deletion cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ DNS_DOMAIN="kubernetes.local"
DNS_REPLICAS=1

# Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ResourceQuota,
2 changes: 1 addition & 1 deletion cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ DNS_SERVER_IP="10.0.0.10"
DNS_DOMAIN="kubernetes.local"
DNS_REPLICAS=1

ADMISSION_CONTROL=NamespaceAutoProvision,LimitRanger,ResourceQuota
ADMISSION_CONTROL=NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ResourceQuota
2 changes: 1 addition & 1 deletion cluster/vagrant/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ MASTER_USER=vagrant
MASTER_PASSWD=vagrant

# Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ResourceQuota

# Optional: Install node monitoring.
ENABLE_NODE_MONITORING=true
Expand Down
1 change: 1 addition & 0 deletions cmd/kube-apiserver/app/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ import (
_ "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/namespace/exists"
_ "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/namespace/lifecycle"
_ "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/resourcequota"
_ "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/securitycontext/scdeny"
)
2 changes: 1 addition & 1 deletion hack/local-up-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ echo "Starting etcd"
kube::etcd::start

# Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota
ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ResourceQuota

APISERVER_LOG=/tmp/kube-apiserver.log
sudo -E "${GO_OUT}/kube-apiserver" \
Expand Down

0 comments on commit 1625e23

Please sign in to comment.