
// Module included in the following assemblies:
//
// * rosa_cli/rosa-manage-objects-cli.adoc

[id="rosa-edit-objects_{context}"]
= Edit objects


This section describes the `edit` commands for clusters and resources.

[id="rosa-edit-cluster_{context}"]
== edit cluster

Allows edits to an existing cluster.

.Syntax
[source,terminal]
----
$ rosa edit cluster --cluster=<cluster_name> | <cluster_id> [arguments]
----

.Arguments
[cols="30,70"]
|===
|Option |Definition

|--additional-allowed-principals <arn>
|A comma-separated list of additional allowed principal ARNs to be added to the Hosted Control Plane's VPC endpoint service to enable additional VPC endpoint connection requests to be automatically accepted.

|--cluster
|Required: The name or ID (string) of the cluster to edit.

|--private
|Restricts a primary API endpoint to direct, private connectivity.

|--enable-delete-protection=true
|Enables the delete protection feature.

|--enable-delete-protection=false
|Disables the delete protection feature.


|===

.Optional arguments inherited from parent commands
[cols="30,70"]
|===
|Option |Definition

|--help
|Shows help for this command.

|--debug
|Enables debug mode.

|--interactive
|Enables interactive mode.

|--profile
|Specifies an AWS profile (string) from your credentials file.
|===

.Examples
Edit a cluster named `mycluster` to make it private.

[source,terminal]
----
$ rosa edit cluster --cluster=mycluster --private
----

Edit all cluster options interactively on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit cluster --cluster=mycluster --interactive
----

[id="rosa-edit-ingress_{context}"]
== edit ingress

Edits the default application router for a cluster.

[NOTE]
====
For information about editing non-default application routers, see _Additional resources_.
====
.Syntax
[source,terminal]
----
$ rosa edit ingress --cluster=<cluster_name> | <cluster_id> [arguments]
----

.Arguments
[cols="30,70"]
|===
|Option |Definition

|--cluster
|Required: The name or ID (string) of the cluster to which the ingress will be added.

|--cluster-routes-hostname
|Components route hostname for OAuth, console, and download.

|--cluster-routes-tls-secret-ref
|Components route TLS secret reference for OAuth, console, and download.

|--excluded-namespaces
|Excluded namespaces for ingress. Format is a comma-separated list `value1, value2...`. If no values are specified, all namespaces will be exposed.

|--label-match
|The label match (string) for ingress. The format must be a comma-delimited list of key=value pairs. If no label is specified, all routes are exposed on both routers.

|--lb-type
|Type of Load Balancer. Options are `classic`, `nlb`.

|--namespace-ownership-policy
|Namespace Ownership Policy for ingress. Options are `Strict` and `InterNamespaceAllowed`. Default is `Strict`.

|--private
|Restricts the application route to direct, private connectivity.

|--route-selector
|Route Selector for ingress. Format is a comma-separated list of key=value. If no label is specified, all routes will be exposed on both routers. For legacy ingress support these are inclusion labels, otherwise they are treated as exclusion label.

|--wildcard-policy
|Wildcard Policy for ingress. Options are `WildcardsDisallowed` and `WildcardsAllowed`. Default is `WildcardsDisallowed`.
|===

.Optional arguments inherited from parent commands
[cols="30,70"]
|===
|Option |Definition

|--help
|Shows help for this command.

|--debug
|Enables debug mode.

|--interactive
|Enables interactive mode.

|--profile
|Specifies an AWS profile (string) from your credentials file.
|===

.Examples

Make an additional ingress with the ID `a1b2` as a private connection on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit ingress --private --cluster=mycluster a1b2
----

Update the router selectors for the additional ingress with the ID `a1b2` on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit ingress --label-match=foo=bar --cluster=mycluster a1b2
----

Update the default ingress using the sub-domain identifier `apps` on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit ingress --private=false --cluster=mycluster apps
----

Update the load balancer type of the `apps2` ingress.

[source,terminal]
----
$ rosa edit ingress --lb-type=nlb --cluster=mycluster apps2
----

[id="rosa-edit-kubeletconfig_{context}"]
== edit kubeletconfig

Edit a custom `KubeletConfig` object in a
ifdef::temp-ifdef[]
cluster.
endif::[]
ifdef::temp-ifdef[]
machine pool.
endif::[]

.Syntax
[source,terminal]
----
$ rosa edit kubeletconfig --cluster=<cluster_name|cluster_id> --name=<kubeletconfig_name> --pod-pids-limit=<number> [flags]
----

.Flags
[cols="30,70"]
|===
|Option |Definition

a|-c, --cluster <cluster_name>\|<cluster_id>
|Required. The name or ID of the cluster for which the `KubeletConfig` object will be edited.

|-i, --interactive
|Enable interactive mode.

|--pod-pids-limit <number>
a|Required. The maximum number of PIDs for each node in the 
ifdef::temp-ifdef[]
cluster.
endif::[]
ifdef::temp-ifdef[]
machine pool associated with the `KubeletConfig` object.
endif::[]

|--name
a| 
ifdef::temp-ifdef[]
Optional.
endif::[]
ifdef::temp-ifdef[]
Required.
endif::[]
Specifies a name for the `KubeletConfig` object.

|-h, --help
|Shows help for this command.
|===

For more information about setting the PID limit for the cluster, see _Configuring PID limits_.

[id="rosa-edit-machinepool_{context}"]
== edit machinepool

Allows edits to the machine pool in a cluster.

.Syntax
[source,terminal]
----
$ rosa edit machinepool --cluster=<cluster_name_or_id> <machinepool_name> [arguments]
----

.Arguments
[cols="30,70"]
|===
|Option |Definition

|--cluster
|Required: The name or ID (string) of the cluster to edit on which the additional machine pool will be edited.

|--enable-autoscaling
|Enable or disable autoscaling of compute nodes. To enable autoscaling, use this argument with the `--min-replicas` and `--max-replicas` arguments. To disable autoscaling, use `--enable-autoscaling=false` with the `--replicas` argument.

|--labels
|The labels (string) for the machine pool. The format must be a comma-delimited list of key=value pairs. Editing this value only affects newly created nodes of the machine pool, which are created by increasing the node number, and does not affect the existing nodes. This list overwrites any modifications made to node labels on an ongoing basis.

//TODO OSDOCS-10439: Add conditions back when HCP and Classic are published separately
//ifdef::temp-ifdef[]
a|--kubelet-configs <kubeletconfig_name>
| For {hcp-title-first} clusters, the names of any `KubeletConfig` objects to apply to nodes in a machine pool.
//endif::[]

|--max-replicas
|Specifies the maximum number of compute nodes when enabling autoscaling.

|--min-replicas
|Specifies the minimum number of compute nodes when enabling autoscaling.

//OSDOCS-11160: HCP only, but need to wait on separate HCP publishing
//ifdef::temp-ifdef[]
|--max-surge
a| For {hcp-title-first} clusters, the `max-surge` parameter defines the number of new nodes that can be provisioned in excess of the desired number of replicas for the machine pool, as configured using the `--replicas` parameter, or as determined by the autoscaler when autoscaling is enabled. This can be an absolute number (for example, `2`) or a percentage of the machine pool size (for example, `20%`), but must use the same unit as the `max-unavailable` parameter.

The default value is `1`, meaning that the maximum number of nodes in the machine pool during an upgrade is 1 plus the desired number of replicas for the machine pool. In this situation, one excess node can be provisioned before existing nodes need to be made unavailable. The number of nodes that can be provisioned simultaneously during an upgrade is `max-surge` plus `max-unavailable`.

|--max-unavailable
a|For {hcp-title-first} clusters, the `max-unavailable` parameter defines the number of nodes that can be made unavailable in a machine pool during an upgrade, before new nodes are provisioned. This can be an absolute number (for example, `2`) or a percentage of the current replica count in the machine pool (for example, `20%`), but must use the same unit as the `max-surge` parameter.

The default value is `0`, meaning that no outdated nodes are removed before new nodes are provisioned. The valid range for this value is from `0` to the current machine pool size, or from `0%` to `100%`. The total number of nodes that can be upgraded simultaneously during an upgrade is `max-surge` plus `max-unavailable`.
//endif::[]
// end OSDOCS-11160: HCP only, when separate docs are available

|--node-drain-grace-period
|Specifies the node drain grace period when upgrading or replacing the machine pool. (This is for {hcp-title} clusters only.)

|--replicas
|Required when autoscaling is not configured. The number (integer) of machines for this machine pool.

|--taints
|Taints for the machine pool. This string value should be formatted as a comma-separated list of `key=value:ScheduleType`. Editing this value only affect newly created nodes of the machine pool, which are created by increasing the node number, and does not affect the existing nodes. This list overwrites any modifications made to Node taints on an ongoing basis.
|===

.Optional arguments inherited from parent commands
[cols="30,70"]
|===
|Option |Definition

|--help
|Shows help for this command.

|--debug
|Enables debug mode.

|--interactive
|Enables interactive mode.

|--profile
|Specifies an AWS profile (string) from your credentials file.
|===

.Examples

Set 4 replicas on a machine pool named `mp1` on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit machinepool --cluster=mycluster --replicas=4 mp1
----

Enable autoscaling on a machine pool named `mp1` on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit machinepool --cluster=mycluster --enable-autoscaling --min-replicas=3 --max-replicas=5 mp1
----

Disable autoscaling on a machine pool named `mp1` on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit machinepool --cluster=mycluster  --enable-autoscaling=false --replicas=3 mp1
----

Modify the autoscaling range on a machine pool named `mp1` on a cluster named `mycluster`.

[source,terminal]
----
$ rosa edit machinepool --max-replicas=9 --cluster=mycluster mp1
----

On {hcp-title-first} clusters, edit the `mp1` machine pool to add the following behavior during upgrades:

* Allow up to 2 excess nodes to be provisioned during an upgrade.
* Ensure that no more than 3 nodes are unavailable during an upgrade.

[source,terminal]
----
$ rosa edit machinepool --cluster=mycluster mp1 --max-surge=2 --max-unavailable=3
----

Associate a `KubeletConfig` object with an existing `high-pid-pool` machine pool on a {hcp-title} cluster.

[source,terminal]
----
$ rosa edit machinepool -c mycluster --kubelet-configs=set-high-pids high-pid-pool
----