Skip to content

Commit 8ebeb66

Browse files
authored
Merge pull request #81465 from laubai/osdocs-11879-cluster-admin-details
OSDOCS#11879: Create cluster-admin during cluster deployment
2 parents 1088d53 + d09597d commit 8ebeb66

6 files changed

+78
-36
lines changed

modules/rosa-classic-cluster-terraform-file-creation.adoc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Module included in the following assemblies:
22
//
33
// * rosa_install_access_delete_clusters/rosa-classic-creating-a-cluster-quickly-terraform.adoc
4-
//
54

65
:_content-type: PROCEDURE
76

@@ -102,11 +101,25 @@ module "rosa-classic" {
102101
multi_az = var.multi_az
103102
create_account_roles = true
104103
create_operator_roles = true
105-
104+
# Optional: Configure a cluster administrator user <.>
105+
#
106+
# Option 1: Default cluster-admin user
107+
# Create an administrator user (cluster-admin) and automatically
108+
# generate a password by uncommenting the following parameter:
109+
# create_admin_user = true
110+
# Generated administrator credentials are displayed in terminal output.
111+
#
112+
# Option 2: Specify administrator username and password
113+
# Create an administrator user and define your own password
114+
# by uncommenting and editing the values of the following parameters:
115+
# admin_credentials_username = <username>
116+
# admin_credentials_password = <password>
117+
106118
depends_on = [time_sleep.wait_60_seconds]
107119
}
108120
EOF
109121
----
122+
<.> Optional: Create an administrator user during cluster creation by uncommenting the appropriate parameters and editing their values.
110123

111124
. Create the `variables.tf` file by running the following command:
112125
+

modules/rosa-create-objects.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ a|--cluster-name <cluster_name>
204204
|--controlplane-iam-role <arn>
205205
|The ARN of the IAM role to attach to control plane instances.
206206

207+
|--create-cluster-admin
208+
|Optional. As part of cluster creation, create a local administrator user (`cluster-admin`) for your cluster. This automatically configures an htpasswd identity provider for the `cluster-admin` user. Optionally, use the `--cluster-admin-user` and `--cluster-admin-password` options to specify the username and password for the administrator user. Omitting these options automatically generates the credentials and displays their values as terminal output.
209+
210+
|--cluster-admin-user
211+
|Optional. Specifies the user name of the cluster administrator user created when used in conjunction with the `--create-cluster-admin` option.
212+
213+
|--cluster-admin-password
214+
|Optional. Specifies the password of the cluster administrator user created when used in conjunction with the `--create-cluster-admin` option.
215+
207216
|--disable-scp-checks
208217
|Indicates whether cloud permission checks are disabled when attempting to install a cluster.
209218

modules/rosa-hcp-cluster-terraform-file-creation.adoc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ terraform {
3838
version = ">= 4.20.0"
3939
}
4040
rhcs = {
41-
version = ">= 1.6.2"
41+
version = ">= 1.6.3"
4242
source = "terraform-redhat/rhcs"
4343
}
4444
}
@@ -85,7 +85,7 @@ resource "time_sleep" "wait_60_seconds" {
8585
8686
module "rosa-hcp" {
8787
source = "terraform-redhat/rosa-hcp/rhcs"
88-
version = "1.6.2"
88+
version = "1.6.3"
8989
cluster_name = local.cluster_name
9090
openshift_version = var.openshift_version
9191
account_role_prefix = local.cluster_name
@@ -97,11 +97,25 @@ module "rosa-hcp" {
9797
aws_subnet_ids = var.create_vpc ? var.private_cluster ? module.vpc[0].private_subnets : concat(module.vpc[0].public_subnets, module.vpc[0].private_subnets) : var.aws_subnet_ids
9898
create_account_roles = true
9999
create_operator_roles = true
100+
# Optional: Configure a cluster administrator user <.>
101+
#
102+
# Option 1: Default cluster-admin user
103+
# Create an administrator user (cluster-admin) and automatically
104+
# generate a password by uncommenting the following parameter:
105+
# create_admin_user = true
106+
# Generated administrator credentials are displayed in terminal output.
107+
#
108+
# Option 2: Specify administrator username and password
109+
# Create an administrator user and define your own password
110+
# by uncommenting and editing the values of the following parameters:
111+
# admin_credentials_username = <username>
112+
# admin_credentials_password = <password>
100113
101114
depends_on = [time_sleep.wait_60_seconds]
102115
}
103116
EOF
104117
----
118+
<.> Optional: Create an administrator user during cluster creation by uncommenting the appropriate parameters and editing their values if required.
105119

106120
. Create the `variables.tf` file by running the following command:
107121
+
@@ -265,4 +279,4 @@ module "vpc" {
265279
EOF
266280
----
267281
+
268-
You are ready to initiate Terraform.
282+
You are ready to initiate Terraform.

modules/rosa-sts-creating-a-cluster-with-customizations-cli.adoc

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ $ rosa create account-roles --interactive \ <1>
5151
----
5252
<1> `interactive` mode enables you to specify configuration options at the interactive prompts. For more information, see _Interactive cluster creation mode reference_.
5353
<2> `manual` mode generates the `aws` CLI commands and JSON files needed to create the account-wide roles and policies. After review, you must run the commands manually to create the resources.
54-
+
5554
--
55+
+
5656
.Example output
5757
[source,terminal,subs="attributes+"]
5858
----
@@ -222,51 +222,53 @@ Any optional fields can be left empty and a default will be selected.
222222
? Domain prefix: <domain_prefix> <1>
223223
? Deploy cluster with Hosted Control Plane (optional): No
224224
? Create cluster admin user: Yes <2>
225-
? Username: user-admin <2>
226-
? Password: [? for help] *************** <2>
227-
? OpenShift version: 4.17.0 <3>
228-
? Configure the use of IMDSv2 for ec2 instances optional/required (optional): <4>
229-
I: Using arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Installer-Role for the Installer role <5>
225+
? Create custom password for cluster admin: No <3>
226+
I: cluster admin user is cluster-admin
227+
I: cluster admin password is password
228+
? OpenShift version: <openshift_version> <4>
229+
? Configure the use of IMDSv2 for ec2 instances optional/required (optional): <5>
230+
I: Using arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Installer-Role for the Installer role <6>
230231
I: Using arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-ControlPlane-Role for the ControlPlane role
231232
I: Using arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Worker-Role for the Worker role
232233
I: Using arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Support-Role for the Support role
233-
? External ID (optional): <6>
234-
? Operator roles prefix: <cluster_name>-<random_string> <7>
234+
? External ID (optional): <7>
235+
? Operator roles prefix: <cluster_name>-<random_string> <8>
235236
? Deploy cluster using pre registered OIDC Configuration ID:
236-
? Tags (optional) <8>
237-
? Multiple availability zones (optional): No <9>
237+
? Tags (optional) <9>
238+
? Multiple availability zones (optional): No <10>
238239
? AWS region: us-east-1
239240
? PrivateLink cluster (optional): No
240241
? Machine CIDR: 10.0.0.0/16
241242
? Service CIDR: 172.30.0.0/16
242243
? Pod CIDR: 10.128.0.0/14
243-
? Install into an existing VPC (optional): Yes <10>
244+
? Install into an existing VPC (optional): Yes <11>
244245
? Subnet IDs (optional):
245246
? Select availability zones (optional): No
246-
? Enable Customer Managed key (optional): No <11>
247+
? Enable Customer Managed key (optional): No <12>
247248
? Compute nodes instance type (optional):
248249
? Enable autoscaling (optional): No
249250
? Compute nodes: 2
250251
? Worker machine pool labels (optional):
251252
? Host prefix: 23
252-
? Additional Security Group IDs (optional): <12>
253+
? Additional Security Group IDs (optional): <13>
253254
? > [*] sg-0e375ff0ec4a6cfa2 ('sg-1')
254255
? > [ ] sg-0e525ef0ec4b2ada7 ('sg-2')
255-
? Enable FIPS support: No <13>
256-
? Encrypt etcd data: No <14>
256+
? Enable FIPS support: No <14>
257+
? Encrypt etcd data: No <15>
257258
? Disable Workload monitoring (optional): No
258259
I: Creating cluster '<cluster_name>'
259260
I: To create this cluster again in the future, you can run:
260-
rosa create cluster --cluster-name <cluster_name> --role-arn arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Installer-Role --support-role-arn arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Support-Role --master-iam-role arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-ControlPlane-Role --worker-iam-role arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Worker-Role --operator-roles-prefix <cluster_name>-<random_string> --region us-east-1 --version 4.17.0 --additional-compute-security-group-ids sg-0e375ff0ec4a6cfa2 --additional-infra-security-group-ids sg-0e375ff0ec4a6cfa2 --additional-control-plane-security-group-ids sg-0e375ff0ec4a6cfa2 --replicas 2 --machine-cidr 10.0.0.0/16 --service-cidr 172.30.0.0/16 --pod-cidr 10.128.0.0/14 --host-prefix 23 <15>
261+
rosa create cluster --cluster-name <cluster_name> --role-arn arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Installer-Role --support-role-arn arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Support-Role --master-iam-role arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-ControlPlane-Role --worker-iam-role arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Worker-Role --operator-roles-prefix <cluster_name>-<random_string> --region us-east-1 --version 4.17.0 --additional-compute-security-group-ids sg-0e375ff0ec4a6cfa2 --additional-infra-security-group-ids sg-0e375ff0ec4a6cfa2 --additional-control-plane-security-group-ids sg-0e375ff0ec4a6cfa2 --replicas 2 --machine-cidr 10.0.0.0/16 --service-cidr 172.30.0.0/16 --pod-cidr 10.128.0.0/14 --host-prefix 23 <16>
261262
I: To view a list of clusters and their status, run 'rosa list clusters'
262263
I: Cluster '<cluster_name>' has been created.
263264
I: Once the cluster is installed you will need to add an Identity Provider before you can login into the cluster. See 'rosa create idp --help' for more information.
264265
...
265266
----
266267
<1> Optional. When creating your cluster, you can customize the subdomain for your cluster on `*.openshiftapps.com` using the `--domain-prefix` flag. The value for this flag must be unique within your organization, cannot be longer than 15 characters, and cannot be changed after cluster creation. If the flag is not supplied, an autogenerated value is created that depends on the length of the cluster name. If the cluster name is fewer than or equal to 15 characters, that name is used for the domain prefix. If the cluster name is longer than 15 characters, the domain prefix is randomly generated to a 15 character string.
267-
<2> When creating your cluster, you can create a local administrator user for your cluster. Selecting `Yes` then prompts you to create a user name and password for the cluster admin. The user name must not contain `/`, `:`, or `%`. The password must be at least 14 characters (ASCII-standard) without whitespaces. This process automatically configures an htpasswd identity provider.
268-
<3> When creating the cluster, the listed `OpenShift version` options include the major, minor, and patch versions, for example `4.17.0`.
269-
<4> Optional: Specify 'optional' to configure all EC2 instances to use both v1 and v2 endpoints of EC2 Instance Metadata Service (IMDS). This is the default value. Specify 'required' to configure all EC2 instances to use IMDSv2 only.
268+
<2> When creating your cluster, you can create a local administrator user (`cluster-admin`) for your cluster. This automatically configures an `htpasswd` identity provider for the `cluster-admin` user.
269+
<3> You can create a custom password for the `cluster-admin` user, or have the system generate a password. If you do not create a custom password, the generated password is displayed in the command line output. If you specify a custom password, the password must be at least 14 characters (ASCII-standard) without any whitespace. When defined, the password is hashed and transported securely.
270+
<4> When creating the cluster, the listed `OpenShift version` options include the major, minor, and patch versions, for example `4.17.0`.
271+
<5> Optional: Specify `optional` to configure all EC2 instances to use both v1 and v2 endpoints of EC2 Instance Metadata Service (IMDS). This is the default value. Specify `required` to configure all EC2 instances to use IMDSv2 only.
270272
+
271273
ifdef::openshift-rosa[]
272274
[IMPORTANT]
@@ -275,15 +277,15 @@ The Instance Metadata Service settings cannot be changed after your cluster is c
275277
====
276278
endif::openshift-rosa[]
277279
+
278-
<5> If you have more than one set of account roles for your cluster version in your AWS account, an interactive list of options is provided.
279-
<6> Optional: Specify an unique identifier that is passed by {product-title} and the OpenShift installer when an account role is assumed. This option is only required for custom account roles that expect an external ID.
280-
<7> By default, the cluster-specific Operator role names are prefixed with the cluster name and a random 4-digit hash. You can optionally specify a custom prefix to replace `<cluster_name>-<hash>` in the role names. The prefix is applied when you create the cluster-specific Operator IAM roles. For information about the prefix, see _Defining an Operator IAM role prefix_.
280+
<6> If you have more than one set of account roles for your cluster version in your {AWS} account, an interactive list of options is provided.
281+
<7> Optional: Specify an unique identifier that is passed by {product-title} and the OpenShift installer when an account role is assumed. This option is only required for custom account roles that expect an external ID.
282+
<8> By default, the cluster-specific Operator role names are prefixed with the cluster name and a random 4-digit hash. You can optionally specify a custom prefix to replace `<cluster_name>-<hash>` in the role names. The prefix is applied when you create the cluster-specific Operator IAM roles. For information about the prefix, see _About custom Operator IAM role prefixes_.
281283
+
282284
[NOTE]
283285
====
284286
If you specified custom ARN paths when you created the associated account-wide roles, the custom path is automatically detected. The custom path is applied to the cluster-specific Operator roles when you create them in a later step.
285287
====
286-
<8> Optional: Specify a tag that is used on all resources created by {product-title} in AWS. Tags can help you manage, identify, organize, search for, and filter resources within AWS. Tags are comma separated, for example: "key value, data input".
288+
<9> Optional: Specify a tag that is used on all resources created by {product-title} in AWS. Tags can help you manage, identify, organize, search for, and filter resources within AWS. Tags are comma separated, for example: `key value, data input`.
287289
+
288290
[IMPORTANT]
289291
====
@@ -292,16 +294,16 @@ Tags that are added by Red{nbsp}Hat are required for clusters to stay in complia
292294

293295
{product-title} does not support adding additional tags outside of ROSA cluster-managed resources. These tags can be lost when AWS resources are managed by the ROSA cluster. In these cases, you might need custom solutions or tools to reconcile the tags and keep them intact.
294296
====
295-
<9> Optional: Multiple availability zones are recommended for production workloads. The default is a single availability zone.
296-
<10> Optional: You can create a cluster in an existing VPC, or ROSA can create a new VPC to use.
297+
<10> Optional: Multiple availability zones are recommended for production workloads. The default is a single availability zone.
298+
<11> Optional: You can create a cluster in an existing VPC, or ROSA can create a new VPC to use.
297299
+
298300
[WARNING]
299301
====
300302
You cannot install a ROSA cluster into an existing VPC that was created by the OpenShift installer. These VPCs are created during the cluster deployment process and must only be associated with a single cluster to ensure that cluster provisioning and deletion operations work correctly.
301303

302304
To verify whether a VPC was created by the OpenShift installer, check for the `owned` value on the `kubernetes.io/cluster/<infra-id>` tag. For example, when viewing the tags for the VPC named `mycluster-12abc-34def`, the `kubernetes.io/cluster/mycluster-12abc-34def` tag has a value of `owned`. Therefore, the VPC was created by the installer and must not be modified by the administrator.
303305
====
304-
<11> Optional: Enable this option if you are using your own AWS KMS key to encrypt the control plane, infrastructure, worker node root volumes, and PVs. Specify the ARN for the KMS key that you added to the account-wide role ARN in the preceding step.
306+
<12> Optional: Enable this option if you are using your own AWS KMS key to encrypt the control plane, infrastructure, worker node root volumes, and PVs. Specify the ARN for the KMS key that you added to the account-wide role ARN in the preceding step.
305307
+
306308
[IMPORTANT]
307309
====
@@ -310,16 +312,16 @@ Only persistent volumes (PVs) created from the default storage class are encrypt
310312
PVs created by using any other storage class are still encrypted, but the PVs are not encrypted with this key unless the storage class is specifically configured to use this key.
311313
====
312314

313-
<12> Optional: You can select additional custom security groups to use in your cluster. You must have already created the security groups and associated them with the VPC you selected for this cluster. You cannot add or edit security groups for the default machine pools after you create the machine pool. For more information, see the requirements for _Security groups_ under _Additional resources_.
314-
<13> Optional: Enable this option if you require your cluster to be FIPS validated. Selecting this option means the encrypt etcd data option is enabled by default and cannot be disabled. You can encrypt etcd data without enabling FIPS support.
315-
<14> Optional: Enable this option if your use case only requires etcd key value encryption in addition to the control plane storage encryption that encrypts the etcd volumes by default. With this option, the etcd key values are encrypted but not the keys.
315+
<13> Optional: You can select additional custom security groups to use in your cluster. You must have already created the security groups and associated them with the VPC you selected for this cluster. You cannot add or edit security groups for the default machine pools after you create the machine pool. For more information, see the requirements for _Security groups_ under _Additional resources_.
316+
<14> Optional: Enable this option if you require your cluster to be FIPS validated. Selecting this option means the encrypt etcd data option is enabled by default and cannot be disabled. You can encrypt etcd data without enabling FIPS support.
317+
<15> Optional: Enable this option if your use case only requires etcd key value encryption in addition to the control plane storage encryption that encrypts the etcd volumes by default. With this option, the etcd key values are encrypted but not the keys.
316318
+
317319
[IMPORTANT]
318320
====
319321
By enabling etcd encryption for the key values in etcd, you will incur a performance overhead of approximately 20%. The overhead is a result of introducing this second layer of encryption, in addition to the default control plane storage encryption that encrypts the etcd volumes. Red{nbsp}Hat recommends that you enable etcd encryption only if you specifically require it for your use case.
320322
====
321323
+
322-
<15> The output includes a custom command that you can run to create another cluster with the same configuration.
324+
<16> The output includes a custom command that you can run to create another cluster with the same configuration.
323325
--
324326
+
325327
As an alternative to using the `--interactive` mode, you can specify the customization options directly when you run the `rosa create cluster` command. Run the `rosa create cluster --help` command to view a list of available CLI options, or see _create cluster_ in _Managing objects with the ROSA CLI_.

modules/rosa-sts-interactive-cluster-creation-mode-options.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ The following table describes the interactive cluster creation mode options:
2626
|Enable the use of Hosted Control Planes.
2727

2828
|`Create cluster admin user`
29-
|Create a cluster administrator user when you create your cluster using the htpasswd identity provider. The username must not contain `/`, `:`, or `%`. The password must be at least 14 characters (ASCII-standard) without whitespaces.
29+
a|Create a local administrator user (`cluster-admin`) for your cluster. This automatically configures a htpasswd identity provider for the `cluster-admin` user.
30+
31+
|`Create custom password for cluster admin`
32+
a|Create a custom password for the `cluster-admin` user, or use a system-generated password. If you create a custom password, the password must be at least 14 characters (ASCII-standard) and contain no whitespace characters. If you do not create a custom password, the system generates a password and displays it in the command line output.
3033

3134
|`Deploy cluster using AWS STS`
3235
|Create an OpenShift cluster that uses the AWS Security Token Service (STS) to allocate temporary, limited-privilege credentials for component-specific AWS Identity and Access Management (IAM) roles. The service enables cluster components to make AWS API calls using secure cloud resource management practices. The default is `Yes`.

0 commit comments

Comments
 (0)