Skip to content

Commit 5911698

Browse files
authored
Merge pull request #39124 from mburke5678/BZ-2025586
BZ-2025586:Documentation update to reflect changes for capabilities getting dropped when using keyword in the container's securityContext
2 parents 136f006 + e793aef commit 5911698

8 files changed

+81
-47
lines changed

modules/nodes-pods-autoscaling-about.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ and ensure that your application meets these requirements before using
6565
memory-based autoscaling.
6666
====
6767

68-
The following example shows autoscaling for the `image-registry` `DeploymentConfig` object. The initial deployment requires 3 pods. The HPA object increased that minimum to 5 and will increase the pods up to 7 if CPU usage on the pods reaches 75%:
68+
The following example shows autoscaling for the `image-registry` `Deployment` object. The initial deployment requires 3 pods. The HPA object increases the minimum to 5. If CPU usage on the pods reaches 75%, the pods will increase to 7:
6969

7070
[source,terminal]
7171
----
72-
$ oc autoscale dc/image-registry --min=5 --max=7 --cpu-percent=75
72+
$ oc autoscale deployment/image-registry --min=5 --max=7 --cpu-percent=75
7373
----
7474

7575
.Example output
@@ -78,7 +78,7 @@ $ oc autoscale dc/image-registry --min=5 --max=7 --cpu-percent=75
7878
horizontalpodautoscaler.autoscaling/image-registry autoscaled
7979
----
8080

81-
.Sample HPA for the `image-registry` `DeploymentConfig` object with `minReplicas` set to 3
81+
.Sample HPA for the `image-registry` `Deployment` object with `minReplicas` set to 3
8282
[source,yaml]
8383
----
8484
apiVersion: autoscaling/v1
@@ -91,20 +91,19 @@ spec:
9191
minReplicas: 3
9292
scaleTargetRef:
9393
apiVersion: apps.openshift.io/v1
94-
kind: DeploymentConfig
94+
kind: Deployment
9595
name: image-registry
9696
targetCPUUtilizationPercentage: 75
9797
status:
9898
currentReplicas: 5
9999
desiredReplicas: 0
100100
----
101101

102-
103102
. View the new state of the deployment:
104103
+
105104
[source,terminal]
106105
----
107-
$ oc get dc image-registry
106+
$ oc get deployment image-registry
108107
----
109108
+
110109
There are now 5 pods in the deployment:

modules/nodes-pods-autoscaling-creating-cpu.adoc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
// * nodes/nodes-pods-autoscaling-about.adoc
44

55
[id="nodes-pods-autoscaling-creating-cpu_{context}"]
6-
76
= Creating a horizontal pod autoscaler for CPU utilization by using the CLI
87

9-
You can create a horizontal pod autoscaler (HPA) for an existing `Deployment`, `DeploymentConfig`, `ReplicaSet`, `ReplicationController`, or `StatefulSet` object that automatically scales the pods associated with that object to maintain the CPU usage you specify.
8+
Using the {product-title} CLI, you can create a horizontal pod autoscaler (HPA) to automatically scale an existing `Deployment`, `DeploymentConfig`, `ReplicaSet`, `ReplicationController`, or `StatefulSet` object. The HPA scales the pods associated with that object to maintain the CPU usage you specify.
9+
10+
[NOTE]
11+
====
12+
It is recommended to use a `Deployment` object or `ReplicaSet` object unless you need a specific feature or behavior provided by other objects.
13+
====
1014

1115
The HPA increases and decreases the number of replicas between the minimum and maximum numbers to maintain the specified CPU utilization across all pods.
1216

1317
When autoscaling for CPU utilization, you can use the `oc autoscale` command and specify the minimum and maximum number of pods you want to run at any given time and the average CPU utilization your pods should target. If you do not specify a minimum, the pods are given default values from the {product-title} server.
18+
1419
To autoscale for a specific CPU value, create a `HorizontalPodAutoscaler` object with the target CPU and pod limits.
1520

1621
.Prerequisites
@@ -70,11 +75,11 @@ $ oc autoscale <object_type>/<name> \// <1>
7075
<3> Specify the maximum number of replicas when scaling up.
7176
<4> Specify the target average CPU utilization over all the pods, represented as a percent of requested CPU. If not specified or negative, a default autoscaling policy is used.
7277
+
73-
For example, the following command shows autoscaling for the `image-registry` `DeploymentConfig` object. The initial deployment requires 3 pods. The HPA object increased that minimum to 5 and will increase the pods up to 7 if CPU usage on the pods reaches 75%:
78+
For example, the following command shows autoscaling for the `image-registry` `Deployment` object. The initial deployment requires 3 pods. The HPA object increases the minimum to 5. If CPU usage on the pods reaches 75%, the pods will increase to 7:
7479
+
7580
[source,terminal]
7681
----
77-
$ oc autoscale dc/image-registry --min=5 --max=7 --cpu-percent=75
82+
$ oc autoscale deployment/image-registry --min=5 --max=7 --cpu-percent=75
7883
----
7984

8085
** To scale for a specific CPU value, create a YAML file similar to the following for an existing object:
@@ -91,7 +96,7 @@ metadata:
9196
spec:
9297
scaleTargetRef:
9398
apiVersion: v1 <3>
94-
kind: ReplicaSet <4>
99+
kind: Deployment <4>
95100
name: example <5>
96101
minReplicas: 1 <6>
97102
maxReplicas: 10 <7>
@@ -106,9 +111,9 @@ spec:
106111
<1> Use the `autoscaling/v2beta2` API.
107112
<2> Specify a name for this horizontal pod autoscaler object.
108113
<3> Specify the API version of the object to scale:
114+
* For a `Deployment`, `ReplicaSet`, `Statefulset` object, use `apps/v1`.
109115
* For a `ReplicationController`, use `v1`.
110116
* For a `DeploymentConfig`, use `apps.openshift.io/v1`.
111-
* For a `Deployment`, `ReplicaSet`, `Statefulset` object, use `apps/v1`.
112117
<4> Specify the type of object. The object must be a `Deployment`, `DeploymentConfig`/`dc`, `ReplicaSet`/`rs`, `ReplicationController`/`rc`, or `StatefulSet`.
113118
<5> Specify the name of the object to scale. The object must exist.
114119
<6> Specify the minimum number of replicas when scaling down.
@@ -135,7 +140,7 @@ $ oc get hpa cpu-autoscale
135140
.Example output
136141
[source,terminal]
137142
----
138-
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
139-
cpu-autoscale ReplicationController/example 173m/500m 1 10 1 20m
143+
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
144+
cpu-autoscale Deployment/example 173m/500m 1 10 1 20m
140145
----
141146

modules/nodes-pods-autoscaling-creating-memory.adoc

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66

77
= Creating a horizontal pod autoscaler object for memory utilization by using the CLI
88

9-
You can create a horizontal pod autoscaler (HPA) for an existing `DeploymentConfig` object or `ReplicationController` object
10-
that automatically scales the pods associated with that object to maintain the average memory utilization you specify,
11-
either a direct value or a percentage of requested memory.
9+
Using the {product-title} CLI, you can create a horizontal pod autoscaler (HPA) to automatically scale an existing
10+
`Deployment`, `DeploymentConfig`, `ReplicaSet`, `ReplicationController`, or `StatefulSet` object. The HPA
11+
scales the pods associated with that object to maintain the average memory utilization you specify, either a direct value or a percentage
12+
of requested memory.
13+
14+
[NOTE]
15+
====
16+
It is recommended to use a `Deployment` object or `ReplicaSet` object unless you need a specific feature or behavior provided by other objects.
17+
====
1218

1319
The HPA increases and decreases the number of replicas between the minimum and maximum numbers to maintain
1420
the specified memory utilization across all pods.
@@ -36,13 +42,14 @@ Labels: <none>
3642
Annotations: <none>
3743
API Version: metrics.k8s.io/v1beta1
3844
Containers:
39-
Name: scheduler
40-
Usage:
41-
Cpu: 2m
42-
Memory: 41056Ki
43-
Name: wait-for-host-port
45+
Name: wait-for-host-port
4446
Usage:
47+
Cpu: 0
4548
Memory: 0
49+
Name: scheduler
50+
Usage:
51+
Cpu: 8m
52+
Memory: 45440Ki
4653
Kind: PodMetrics
4754
Metadata:
4855
Creation Timestamp: 2020-02-14T22:21:14Z
@@ -58,9 +65,8 @@ To create a horizontal pod autoscaler for memory utilization:
5865

5966
. Create a YAML file for one of the following:
6067

61-
** To scale for a specific memory value, create a `HorizontalPodAutoscaler` object similar to the following for an existing `ReplicationController` object or replication controller:
68+
** To scale for a specific memory value, create a `HorizontalPodAutoscaler` object similar to the following for an existing object:
6269
+
63-
.Example output
6470
[source,yaml,options="nowrap"]
6571
----
6672
apiVersion: autoscaling/v2beta2 <1>
@@ -71,7 +77,7 @@ metadata:
7177
spec:
7278
scaleTargetRef:
7379
apiVersion: v1 <3>
74-
kind: ReplicationController <4>
80+
kind: Deployment <4>
7581
name: example <5>
7682
minReplicas: 1 <6>
7783
maxReplicas: 10 <7>
@@ -97,9 +103,11 @@ spec:
97103
<1> Use the `autoscaling/v2beta2` API.
98104
<2> Specify a name for this horizontal pod autoscaler object.
99105
<3> Specify the API version of the object to scale:
100-
* For a replication controller, use `v1`,
101-
* For a `DeploymentConfig` object, use `apps.openshift.io/v1`.
102-
<4> Specify the kind of object to scale, either `ReplicationController` or `DeploymentConfig`.
106+
* For a `Deployment`, `ReplicaSet`, or `Statefulset` object, use `apps/v1`.
107+
* For a `ReplicationController`, use `v1`.
108+
* For a `DeploymentConfig`, use `apps.openshift.io/v1`.
109+
<4> Specify the type of object. The object must be a `Deployment`, `DeploymentConfig`,
110+
`ReplicaSet`, `ReplicationController`, or `StatefulSet`.
103111
<5> Specify the name of the object to scale. The object must exist.
104112
<6> Specify the minimum number of replicas when scaling down.
105113
<7> Specify the maximum number of replicas when scaling up.
@@ -109,9 +117,8 @@ spec:
109117
<11> Specify `averageValue` and a specific memory value.
110118
<12> Optional: Specify a scaling policy to control the rate of scaling up or down.
111119

112-
** To scale for a percentage, create a `HorizontalPodAutoscaler` object similar to the following:
120+
** To scale for a percentage, create a `HorizontalPodAutoscaler` object similar to the following for an existing object:
113121
+
114-
.Example output
115122
[source,yaml,options="nowrap"]
116123
----
117124
apiVersion: autoscaling/v2beta2 <1>
@@ -122,12 +129,12 @@ metadata:
122129
spec:
123130
scaleTargetRef:
124131
apiVersion: apps.openshift.io/v1 <3>
125-
kind: DeploymentConfig <4>
132+
kind: Deployment <4>
126133
name: example <5>
127134
minReplicas: 1 <6>
128135
maxReplicas: 10 <7>
129136
metrics: <8>
130-
- type: Resource
137+
- type: Deployment
131138
resource:
132139
name: memory <9>
133140
target:
@@ -148,9 +155,11 @@ spec:
148155
<1> Use the `autoscaling/v2beta2` API.
149156
<2> Specify a name for this horizontal pod autoscaler object.
150157
<3> Specify the API version of the object to scale:
151-
* For a replication controller, use `v1`,
152-
* For a `DeploymentConfig` object, use `apps.openshift.io/v1`.
153-
<4> Specify the kind of object to scale, either `ReplicationController` or `DeploymentConfig`.
158+
* For a ReplicationController, use `v1`.
159+
* For a DeploymentConfig, use `apps.openshift.io/v1`.
160+
* For a Deployment, ReplicaSet, Statefulset object, use `apps/v1`.
161+
<4> Specify the type of object. The object must be a `Deployment`, `DeploymentConfig`,
162+
`ReplicaSet`, `ReplicationController`, or `StatefulSet`.
154163
<5> Specify the name of the object to scale. The object must exist.
155164
<6> Specify the minimum number of replicas when scaling down.
156165
<7> Specify the maximum number of replicas when scaling up.
@@ -191,8 +200,8 @@ $ oc get hpa hpa-resource-metrics-memory
191200
.Example output
192201
[source,terminal]
193202
----
194-
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
195-
hpa-resource-metrics-memory ReplicationController/example 2441216/500Mi 1 10 1 20m
203+
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
204+
hpa-resource-metrics-memory Deployment/example 2441216/500Mi 1 10 1 20m
196205
----
197206
+
198207
[source,terminal]
@@ -208,7 +217,7 @@ Namespace: default
208217
Labels: <none>
209218
Annotations: <none>
210219
CreationTimestamp: Wed, 04 Mar 2020 16:31:37 +0530
211-
Reference: ReplicationController/example
220+
Reference: Deployment/example
212221
Metrics: ( current / target )
213222
resource memory on pods: 2441216 / 500Mi
214223
Min replicas: 1

modules/nodes-pods-autoscaling-creating-web-console.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[id="nodes-pods-autoscaling-creating-web-console_{context}"]
66
= Creating a horizontal pod autoscaler by using the web console
77

8-
From the web console, you can create a horizontal pod autoscaler (HPA) that specifies the minimum and maximum number of pods you want to run on a deployment. You can also define the amount of CPU or memory usage that your pods should target..
8+
From the web console, you can create a horizontal pod autoscaler (HPA) that specifies the minimum and maximum number of pods you want to run on a `Deployment` or `DeploymentConfig` object. You can also define the amount of CPU or memory usage that your pods should target.
99

1010
[NOTE]
1111
====

modules/security-context-constraints-about.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ CRI-O has the following default list of capabilities that are allowed for each c
166166
* `NET_BIND_SERVICE`
167167
* `KILL`
168168

169-
The containers use the capabilities from this default list, but pod manifest authors can alter it by requesting additional capabilities or removing some of the default behaviors. Use the `allowedCapabilities`, `defaultAddCapabilities`, and `requiredDropCapabilities` parameters to control such requests from the pods and to dictate which capabilities can be requested, which ones must be added to each container, and which ones must be forbidden.
169+
The containers use the capabilities from this default list, but pod manifest authors can alter the list by requesting additional capabilities or removing some of the default behaviors. Use the `allowedCapabilities`, `defaultAddCapabilities`, and `requiredDropCapabilities` parameters to control such requests from the pods and to specify which capabilities can be requested, which ones must be added to each container, and which ones must be forbidden, or dropped, from each container.
170+
171+
[NOTE]
172+
====
173+
You can drop all capabilites from containers by setting the `requiredDropCapabilities` parameter to `ALL`.
174+
====
170175

171176
[id="authorization-SCC-strategies_{context}"]
172177
== Security context constraints strategies

modules/security-context-constraints-creating.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ groups:
3838
- my-admin-group
3939
----
4040
+
41-
Optionally, you can specify drop capabilities for an SCC by setting the
41+
Optionally, you can drop specific capabilities for an SCC by setting the
4242
`requiredDropCapabilities` field with the desired values. Any specified
43-
capabilities are dropped from the container. For example, to create an SCC
44-
with the `KILL`, `MKNOD`, and `SYS_CHROOT` required drop capabilities, add
43+
capabilities are dropped from the container. To drop all capabilities, specify `ALL`. For example, to create an SCC
44+
that drops the `KILL`, `MKNOD`, and `SYS_CHROOT` capabilities, add
4545
the following to the SCC object:
4646
+
4747
[source,yaml]
@@ -52,6 +52,12 @@ requiredDropCapabilities:
5252
- SYS_CHROOT
5353
----
5454
+
55+
[NOTE]
56+
+
57+
====
58+
You cannot list a capability in both `allowedCapabilities` and `requiredDropCapabilities`.
59+
====
60+
+
5561
CRI-O supports the same list of capability values that are found in the link:https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities[Docker documentation].
5662

5763
. Create the SCC by passing in the file:

modules/security-context-constraints-example.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ metadata:
3737
name: privileged
3838
priority: null
3939
readOnlyRootFilesystem: false
40-
requiredDropCapabilities: [] <5>
40+
requiredDropCapabilities: <5>
41+
- KILL
42+
- MKNOD
43+
- SETUID
44+
- SETGID
4145
runAsUser: <6>
4246
type: RunAsAny
4347
seLinuxContext: <7>
@@ -61,7 +65,7 @@ allows any capabilities.
6165
<3> The `FSGroup` strategy, which dictates the allowable values for the
6266
security context.
6367
<4> The groups that can access this SCC.
64-
<5> A list of capabilities that are be dropped from a pod.
68+
<5> A list of capabilities to drop from a pod. Or, specify `ALL`
6569
<6> The `runAsUser` strategy type, which dictates the allowable values for the
6670
Security Context.
6771
//could use the available strategies

nodes/pods/nodes-pods-autoscaling.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ As a developer, you can use a horizontal pod autoscaler (HPA) to
99
specify how {product-title} should automatically increase or decrease the scale of
1010
a replication controller or deployment configuration, based on metrics collected
1111
from the pods that belong to that replication controller or deployment
12-
configuration.
13-
12+
configuration. You can create an HPA for any `Deployment`, `DeploymentConfig`,
13+
`ReplicaSet`, `ReplicationController`, or `StatefulSet` object.
14+
15+
[NOTE]
16+
====
17+
It is recommended to use a `Deployment` object or `ReplicaSet` object unless you need a specific feature or behavior provided by other objects. For more information on
18+
these objects, see xref:../../applications/deployments/what-deployments-are.adoc#what-deployments-are[Understanding Deployment and DeploymentConfig objects].
19+
====
1420

1521
// The following include statements pull in the module files that comprise
1622
// the assembly. Include any combination of concept, procedure, or reference

0 commit comments

Comments
 (0)