Skip to content

OSDOCS-11830 Split Networking content for ROSA with HCP #88279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

laubai
Copy link
Contributor

@laubai laubai commented Feb 10, 2025

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 10, 2025
Copy link

openshift-ci bot commented Feb 10, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@laubai
Copy link
Contributor Author

laubai commented Feb 10, 2025

/test all

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 10, 2025
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Feb 10, 2025

🤖 Tue Jun 03 09:22:55 - Prow CI generated the docs preview:
https://88279--ocpdocs-pr.netlify.app
Complete list of updated preview URLs: artifacts/updated_preview_urls.txt

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from 594734d to 967e87d Compare February 10, 2025 12:48
@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 10, 2025
@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch 2 times, most recently from d420027 to 4037186 Compare February 10, 2025 13:00
@laubai
Copy link
Contributor Author

laubai commented Feb 10, 2025

/test all

* For troubleshooting routes with externally managed certificates, check the {product-title} router pod logs for errors, see xref:../../support/troubleshooting/investigating-pod-issues.adoc[Investigating pod issues].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] OpenShiftAsciiDoc.XrefContainsAnchorID: The xref is missing an anchor ID.

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from 4037186 to 14951d8 Compare February 17, 2025 05:05
@laubai
Copy link
Contributor Author

laubai commented Feb 17, 2025

/test all

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from 14951d8 to 93aa8de Compare February 24, 2025 03:52
@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch 3 times, most recently from 755a062 to 7f1540c Compare March 20, 2025 06:24
@laubai
Copy link
Contributor Author

laubai commented Mar 20, 2025

/test all

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from 7f1540c to 5842b2e Compare March 20, 2025 08:46
@laubai
Copy link
Contributor Author

laubai commented Mar 20, 2025

/test all

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from 5842b2e to 99917d2 Compare March 25, 2025 01:01
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 25, 2025
@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from 99917d2 to 412d771 Compare March 25, 2025 09:08
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 25, 2025
@laubai
Copy link
Contributor Author

laubai commented Mar 25, 2025

/test all

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch 2 times, most recently from 3efb15e to 0855f95 Compare March 26, 2025 07:48
@laubai
Copy link
Contributor Author

laubai commented Apr 16, 2025

/test all

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from 84d5fac to c52a497 Compare April 17, 2025 06:33
@openshift-ci openshift-ci bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 17, 2025
@laubai
Copy link
Contributor Author

laubai commented Apr 17, 2025

/test all

1 similar comment
@laubai
Copy link
Contributor Author

laubai commented Apr 29, 2025

/test all

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from c52a497 to ca5c547 Compare April 29, 2025 06:36
@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from ca5c547 to cd8b108 Compare May 7, 2025 03:22
@laubai
Copy link
Contributor Author

laubai commented May 22, 2025

/test all

@laubai laubai marked this pull request as ready for review May 27, 2025 04:35
@laubai laubai changed the title [WIP] OSDOCS-11830 Split Networking content for ROSA with HCP OSDOCS-11830 Split Networking content for ROSA with HCP May 27, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 27, 2025
@@ -93,12 +112,12 @@ $ aws ec2 create-tags \
--region ${REGION}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command fails with the above Variable:

An error occurred (InvalidID) when calling the CreateTags operation: The ID 'subnet-09731120e976e8580 subnet-0c18738ade8ebe7e7 subnet-06b27cfc96002f754' is not valid

This will only happen for customers using Z shell (zsh) instead of Bourne Again Shell (bash), but zsh is the default for any Macbook user which could cause some confusion for a lot of people following this guide. Unfortunately, there's not a clean answer for this. We have three options:

  1. Make a big highlight warning saying that the user must use the bash shell
  2. Turn this section into a little bash script that we ask the customer to create and then run rather than putting the commands into the shell directly (I think this is the simplest)
  3. Rewrite the commands to try and be shell agnostic (this is also tricky)

If we go with option 2, then we'd change this section to be:

Create a small script to tag your subnets:

cat <<EOF > "${SCRATCH}/tag-subnets.sh"
#!/bin/bash

aws ec2 create-tags \
     --resources ${PUBLIC_SUBNET_IDS} \
     --tags Key=kubernetes.io/role/elb,Value='' \
     --region ${REGION}

aws ec2 create-tags \
     --resources ${PRIVATE_SUBNET_IDS} \
     --tags Key=kubernetes.io/role/internal-elb,Value='' \
     --region ${REGION}

EOF

Execute the script. The reason for this step is due to differences in bash versus zsh

bash ${SCRATCH}/tag-subnets.sh

Copy link
Contributor Author

@laubai laubai Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree option 2 makes sense here but I think for the most part we do assume a Bash shell for better and worse; will check with the rest of the openshift team re. execution environment.

Alternatively, could we recommend something generic like "If you use a zsh terminal instead of a bash terminal, prefix all commands in this doc with bash to ensure the appropriate environment is used"?

@@ -93,12 +112,12 @@ $ aws ec2 create-tags \
--region ${REGION}
----

. Add a tag to your private subnets:
. Tag your private subnets to allow changes by internal elastic load balancing roles:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go with the script option above then this bit can go too

--policy-document "file://${SCRATCH}/load-balancer-operator-policy.json")
fi
$ echo $POLICY_ARN
$ aws iam create-policy \
Copy link

@andyrepton andyrepton Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend putting back the check on the POLICY_ARN to see if it exists first. If the policy already exists, the new command will fail and subsequent commands will then fail. This will work:

OPERATOR_POLICY_ARN =$(aws iam list-policies --query \
      "Policies[?PolicyName=='aws-load-balancer-operator-policy'].{ARN:Arn}" \
      --output text)

if [[ -z "${OPERATOR_POLICY_ARN}" ]]; then
  OPERATOR_POLICY_ARN =$(aws  iam create-policy \
  --query Policy.Arn --output text \
  --policy-name aws-load-balancer-operator-policy \
  --policy-document file://${SCRATCH}/operator-permission-policy.json \
  --region ${REGION})
fi

echo $OPERATOR_POLICY_ARN

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this initially because the output didn't ever seem to let the create-policy command succeed, and it didn't tell you anything about a failure - whereas if you just run the create-policy command and it fails, it at least provides you with an error message that you can use for further troubleshooting.

@andyrepton Would it make sense to check for an existing policy up front and tell the user to edit an existing policy if it exists? e.g. "NOTE: If the policy already exists, review and edit the existing policy to include the appropriate permissions. For more information, see Edit IAM policies in the AWS documentation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why we have the echo there at the end, if the command fails then it'll return something other than the ARN. Would it be ok to add a note saying to confirm the ARN looks correct before proceeding?

----
+
. Create a secret for the AWS Load Balancer Operator to assume our newly created AWS IAM role:
Take note of the Operator role ARN in the output. This is referred to as the `$OPERATOR_ROLE_ARN` for the remainder of this process.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend explicitly setting the OPERATOR_ROLE_ARN here, either via something like this:

Export the OPERATOR_ROLE_ARN variable:

export OPERATOR_ROLE_ARN=$your_role_arn

Or in the create role command like was originally there:

OPERATOR_ROLE_ARN=$(aws iam create-role --role-name "${CLUSTER_NAME}-alb-operator" \
  --assume-role-policy-document "file://${SCRATCH}/operator-trust-policy.json" \
  --query Role.Arn --output text)

echo ${OPERATOR_ROLE_ARN}

Otherwise the user may proceed to installing the operator later without ever checking that this variable was set and being confused as to why it isn't working

+
[source,terminal]
----
$ oc new-app -n hello-world --image=docker.io/openshift/hello-openshift
$ aws iam create-policy \
--region "$REGION" \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend changing to ${REGION} to be consistent with the rest of the document

$ aws iam create-policy \
--region "$REGION" \
--policy-name aws-load-balancer-controller-policy \
--policy-document file://${SCRATCH}controller-permission-policy.json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a /, which causes it to fail. I also recommend the same as above, and setting the CONTROLLER_POLICY_ARN to be the output of the command. Suggested edit:

CONTROLLER_POLICY_ARN=$(aws iam list-policies --query \
      "Policies[?PolicyName=='aws-load-balancer-controller-policy'].{ARN:Arn}" \
      --output text)

if [[ -z "${CONTROLLER_POLICY_ARN}" ]]; then
  CONTROLLER_POLICY_ARN=$(aws  iam create-policy \
  --query Policy.Arn --output text \
  --policy-name aws-load-balancer-controller-policy \
  --policy-document file://${SCRATCH}/controller-permission-policy.json \
  --region ${REGION})
fi

echo ${CONTROLLER_POLICY_ARN}

Copy link
Contributor Author

@laubai laubai Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this depends on whether you've set a fully qualified path for ${SCRATCH} or not, will see if I or another writer can re-test

[EDIT] Oh wait you mean after the SCRATCH env var not before it - on it!

port:
number: 80
EOF
$ aws iam create-role --role-name ${CLUSTER_NAME}-albo-controller \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, missing the / on the document file. Suggested change to be consistent with above:

CONTROLLER_ROLE_ARN=$(aws iam create-role --role-name "${CLUSTER_NAME}-albo-controller" \
  --assume-role-policy-document "file://${SCRATCH}/controller-trust-policy.json" \
  --query Role.Arn --output text)

echo ${CONTROLLER_ROLE_ARN}

{
"Effect": "Allow",
"Principal": {
"Federated": "${OIDC_ARN}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OIDC_ARN has not been set in this document. To keep consistency set it the same way as above. Correct line:

"Federated": "arn:aws:iam::${AWS_ACCOUNT_ID}:oidc-provider/${OIDC_ENDPOINT}"

@laubai laubai force-pushed the osdocs-11830-hcp-networking-split branch from cd8b108 to 1b9b084 Compare June 3, 2025 09:15
Copy link

openshift-ci bot commented Jun 3, 2025

@laubai: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link

@hunterkepley hunterkepley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the standing comments, I don't see anything I would change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants