Skip to content
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

OSDOCS#6222: Adding custom security groups in AWS #60921

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

mjpytlak
Copy link
Contributor

@mjpytlak mjpytlak commented Jun 6, 2023

Version(s):
4.14+

Issue:
This issue addresses osdocs-6222.

Link to docs preview:

QE review:

  • QE has approved this change.

@mjpytlak mjpytlak added this to the Planned for 4.14 GA milestone Jun 6, 2023
@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 6, 2023
@mjpytlak mjpytlak added branch/enterprise-4.14 and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 6, 2023
additionalSecurityGroupIDs:
- sg-1
- sg-2
replicas: 3
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to make sure that feature also can work with the edge compute pool with Local Zones.
https://docs.openshift.com/container-platform/4.13/installing/installing_aws/installing-aws-localzone.html

@barbacbd can you see any restriction on that?

Copy link

Choose a reason for hiding this comment

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

I have not seen a restriction but I can look. Technically the placement in the install config allows the security groups to be added to any AWS machine type, but I haven't run specific tests for those cases.

Choose a reason for hiding this comment

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

@mtulio as far as local zones go, security groups don't require anything special. The security groups just need to be attached to the VPC with the local zone subnet. Also we would require that these local zone subnets are provided in the subnets field of the install config.

Choose a reason for hiding this comment

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

@mtulio as far as edge computing, what concerns do you have? Security groups can be shared by many resources as they are just rules.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mtulio as far as edge computing, what concerns do you have? Security groups can be shared by many resources as they are just rules.

Yes, SGs can be assigned to any supported resource between the same VPC.

My concern was on the install side, I just wanna make sure the configuration below can be used - considering edge compute pool uses the same flow of worker, I expect only sg-5 and sg-6 in MachineSet manifests for Local Zones, just confirming it.

compute:
- hyperthreading: Enabled
  name: worker
  platform:
    aws:
      additionalSecurityGroupIDs:
        - sg-1 <1>
        - sg-2
  replicas: 3
- hyperthreading: Enabled
  name: edge
  platform:
    aws:
      additionalSecurityGroupIDs:
        - sg-5
        - sg-6

Choose a reason for hiding this comment

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

Confirmed! The new machineset does show that it is for edge nodes and it has the security group that I mentioned in the install config and not the one used for the workers

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

ocpdocs-previewbot commented Jun 6, 2023

🤖 Updated build preview is available at:
https://60921--docspreview.netlify.app

Build log: https://circleci.com/gh/ocpdocs-previewbot/openshift-docs/20502

@barbacbd
Copy link

barbacbd commented Jun 6, 2023

/cc @barbacbd

@openshift-ci openshift-ci bot requested a review from barbacbd June 6, 2023 23:52
= Applying existing security groups to the cluster
By default, the installation program creates and attaches security groups to control plane and compute machines. The rules associated with the default security groups cannot be modified.

If you are deploying an {product-title} cluster to an existing AWS Virtual Private Cloud (VPC), you can apply additional existing AWS security groups (custom security groups) to your control plane and compute machines. Applying custom security groups can help you meet the security needs of your organization, in such cases where you need to control the incoming and outgoing traffic of your control plane and compute machines.
Copy link

Choose a reason for hiding this comment

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

Suggested change
If you are deploying an {product-title} cluster to an existing AWS Virtual Private Cloud (VPC), you can apply additional existing AWS security groups (custom security groups) to your control plane and compute machines. Applying custom security groups can help you meet the security needs of your organization, in such cases where you need to control the incoming and outgoing traffic of your control plane and compute machines.
If you are deploying an {product-title} cluster to an existing AWS Virtual Private Cloud (VPC), you can apply additional existing AWS security groups (custom security groups) to your control plane and compute machines. Applying custom security groups can help you meet the security needs of your organization, in such cases where you need to control the incoming or outgoing traffic of your control plane and compute machines.

Sorry kind of nit picky =)


.Prerequisites
* You have created the security groups in AWS. For more information, see the AWS documentation about working with link:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html[security groups].
* The security groups must be part of the existing VPC to which you are deploying the cluster. The security groups cannot be associated with another VPC.
Copy link

Choose a reason for hiding this comment

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

Suggested change
* The security groups must be part of the existing VPC to which you are deploying the cluster. The security groups cannot be associated with another VPC.
* The security groups must be associated with the existing VPC to which you are deploying the cluster. The security groups cannot be associated with another VPC.

nit: using the same words as AWS regarding this topic.

additionalSecurityGroupIDs:
- sg-1
- sg-2
replicas: 3
Copy link

Choose a reason for hiding this comment

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

I have not seen a restriction but I can look. Technically the placement in the install config allows the security groups to be added to any AWS machine type, but I haven't run specific tests for those cases.

platform:
aws:
region: us-east-1
subnets:
Copy link

Choose a reason for hiding this comment

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

@mjpytlak did we want to note that the subnets are required or just let the user figure that out during install?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did we want to note that the subnets are required or just let the user figure that out during install?

@barbacbd I was originally thinking that given an earlier sample file in the topic states that the subnets are required, I would let it be. However - can't hurt. I updated code block with a few annotations. Outside of that, I made your proposed changes. Thanks for those. Please let me know when you have had a chance to look into the Local Zones case.

@mjpytlak
Copy link
Contributor Author

mjpytlak commented Jun 8, 2023

@nirarg I am working with @barbacbd on the ability to apply existing AWS security groups when users BYON. [1] I noticed that the AWS Outposts case requires users to BYON. The content I am updating is shared by the Outposts doc. Do either you or Brent have concerns about this content appear in that installation use case? [2]

[1] https://issues.redhat.com/browse/OCPSTRAT-148
[2] https://60921--docspreview.netlify.app/openshift-enterprise/latest/installing/installing_aws/installing-aws-outposts-remote-workers.html

@mjpytlak
Copy link
Contributor Author

@barbacbd Following up on whether we can include the content on security groups to the Local Zones install use case. Do either you or @nirarg have any concerns about adding this content to the AWS Outpost install use case?

@barbacbd
Copy link

@mjpytlak @nirarg I don't see any issues with using custom security groups with any BYON. As long as the security groups are attached to a VPC then there should be no issues.

@barbacbd
Copy link

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2023
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2023
@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 Jun 28, 2023
@mjpytlak
Copy link
Contributor Author

@mtulio I have added this content to the Local Zones doc. Notably I have updated the sample example to include local zone specific content. PTAL and let me know if we are OK as is or if updates are required. Thanks in advance.

name: worker
endif::local-zones[]
ifdef::local-zones[]
- name: edge
Copy link
Contributor

Choose a reason for hiding this comment

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

The hyphen must be removed, otherwise will create a wrong yaml /install-config. (Double check the rendered page for Local zones)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mtulio I do not see the behavior. Are you looking at this page? https://60921--docspreview.netlify.app/openshift-enterprise/latest/installing/installing_aws/installing-aws-localzone.html#installation-aws-vpc-security-groups_installing-aws-localzone?

If so, is it possible you were looking at the page before I added the condition for local zones and you are getting cached version?

Copy link
Contributor Author

@mjpytlak mjpytlak Jul 13, 2023

Choose a reason for hiding this comment

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

I am interpreting your comment as ifdef::local-zones[] is incorrect. Are you referring to another hyphen in this example? If you are referring to - name: edge I used the syntax from https://docs.openshift.com/container-platform/4.13/installing/installing_aws/installing-aws-localzone.html#machines-edge-machine-pool_installing-aws-localzone. Is that a doc bug?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@mjpytlak Also looking at where that section is placed, I can see the docs is providing different examples of optional machine configuration (like Security Groups) here:
https://60921--docspreview.netlify.app/openshift-enterprise/latest/installing/installing_aws/installing-aws-localzone.html#machines-edge-machine-pool_installing-aws-localzone

  • Configuration that uses an edge pool with default settings
  • Configuration that uses an edge pool with a custom instance type
  • Configuration that uses an edge pool with a custom EBS type

Do you think that optional security group deployment would fit in that list too, as it is also optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think that optional security group deployment would fit in that list too, as it is also optional?

@mtulio Yes - I agree. I have added an example to this section. I have also removed the - from https://github.com/openshift/openshift-docs/pull/60921/files#diff-c1a8e33036504600b04232682d3adb385bd0cb256c8bb0fa17b50c6daec36635R39

Please take one more look.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mjpytlak ok, thanks, I can see there. Do we need two examples about that topic on the Local Zone page? As you agreed to add the example[1] in the section, I can't see a benefit of [2] (as we already have detailed in the other pages). As a user [reading the rendered page] it seems the SG section ([2]Applying existing AWS security groups to the cluster) is required in the installation process for Local Zones - which is not true.

I am ok having only 1 on the Local Zones install page. Let me know your thoughts.

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 am ok having only 1 on the Local Zones install page. Let me know your thoughts.

@mtulio I agree and that was an oversight on my part. I removed Applying existing AWS security groups to the cluster.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mjpytlak np at all! Thanks for revisiting.

Comment on lines 33 to 39
compute:
- hyperthreading: Enabled
ifndef::local-zones[]
name: worker
endif::local-zones[]
ifdef::local-zones[]
- name: edge
Copy link
Contributor

@mtulio mtulio Jul 13, 2023

Choose a reason for hiding this comment

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

IIUC I think this can fix:

Suggested change
compute:
- hyperthreading: Enabled
ifndef::local-zones[]
name: worker
endif::local-zones[]
ifdef::local-zones[]
- name: edge
compute:
- hyperthreading: Enabled
ifndef::local-zones[]
name: worker
endif::local-zones[]
ifdef::local-zones[]
name: edge

Copy link
Contributor Author

@mjpytlak mjpytlak Jul 17, 2023

Choose a reason for hiding this comment

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

Done. Thank you for the clarification on Friday. I did not realize that the - from hyperthreading was inherited.

Copy link
Contributor

Choose a reason for hiding this comment

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

lgtm that part. Thanks

@mjpytlak mjpytlak force-pushed the osdocs-6222 branch 2 times, most recently from 66fb021 to 0319f7b Compare July 20, 2023 14:22
@mtulio
Copy link
Contributor

mtulio commented Jul 20, 2023

LGTM Local Zones

@mjpytlak
Copy link
Contributor Author

@yunjiang29 Draft docs ready for QE review. PTAL. Thank you.

@yunjiang29
Copy link
Contributor

@gpei PTAL, thanks

@gpei
Copy link

gpei commented Jul 21, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2023
@mjpytlak mjpytlak added the peer-review-needed Signifies that the peer review team needs to review this PR label Jul 25, 2023
@bergerhoffer
Copy link
Contributor

/label peer-review-in-progress

@openshift-ci openshift-ci bot added the peer-review-in-progress Signifies that the peer review team is reviewing this PR label Jul 25, 2023
Copy link
Contributor

@bergerhoffer bergerhoffer left a comment

Choose a reason for hiding this comment

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

Nice job, just a few suggestions


.Prerequisites
* You have created the security groups in AWS. For more information, see the AWS documentation about working with link:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html[security groups].
* The security groups must associated with the existing VPC to which you are deploying the cluster. The security groups cannot be associated with another VPC.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* The security groups must associated with the existing VPC to which you are deploying the cluster. The security groups cannot be associated with another VPC.
* The security groups must be associated with the existing VPC to which you are deploying the cluster. The security groups cannot be associated with another VPC.

Also, it's fine the way it is, but per ISG you are allowed to end in a preposition to avoid an awkward sentence, in case you care to reword to get rid of the "to which" part. (And instead say "... existing VPC that you are deploying the cluster to."


.Procedure

. Edit the `compute.platform.aws.additionalSecurityGroupIDs` parameter to specify one or more custom security groups for your compute machines.
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are we editing, in the install-config.yaml file? I'd clarify that.

.Procedure

. Edit the `compute.platform.aws.additionalSecurityGroupIDs` parameter to specify one or more custom security groups for your compute machines.
. Edit `controlPlane.platform.aws.additionalSecurityGroupIDs` parameter to specify one or more custom security groups for your control plane machines.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
. Edit `controlPlane.platform.aws.additionalSecurityGroupIDs` parameter to specify one or more custom security groups for your control plane machines.
. Edit the `controlPlane.platform.aws.additionalSecurityGroupIDs` parameter to specify one or more custom security groups for your control plane machines.

. Edit `controlPlane.platform.aws.additionalSecurityGroupIDs` parameter to specify one or more custom security groups for your control plane machines.
. Save the file and reference it when deploying the cluster.

.Sample `install-config.yaml` files that specifies custom security groups
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.Sample `install-config.yaml` files that specifies custom security groups
.Sample `install-config.yaml` file that specifies custom security groups

.Sample `install-config.yaml` files that specifies custom security groups
[source,yaml]
----
#...
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be a space, # ...


By default, the installation program creates and attaches security groups to control plane and compute machines. The rules associated with the default security groups cannot be modified.

However, you can apply additional existing AWS security groups (custom security groups), which are associated with your existing VPC, to control plane and compute machines. Applying custom security groups can help you meet the security needs of your organization, in such cases where you need to control the incoming or outgoing traffic of these machines.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not critical, but I'd argue that you don't need the (custom security groups)

@bergerhoffer
Copy link
Contributor

/label peer-review-done
/remove-label peer-review-needed
/remove-label peer-review-in-progress

@openshift-ci openshift-ci bot added peer-review-done Signifies that the peer review team has reviewed this PR and removed peer-review-needed Signifies that the peer review team needs to review this PR peer-review-in-progress Signifies that the peer review team is reviewing this PR labels Jul 25, 2023
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 25, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jul 25, 2023

New changes are detected. LGTM label has been removed.

@mjpytlak
Copy link
Contributor Author

Appreciate the review @bergerhoffer. Always helpful.

@mjpytlak mjpytlak merged commit 6d28cda into openshift:main Jul 25, 2023
1 check passed
@mjpytlak
Copy link
Contributor Author

/cherrypick enterprise-4.14

@openshift-cherrypick-robot

@mjpytlak: new pull request created: #62781

In response to this:

/cherrypick enterprise-4.14

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/enterprise-4.14 peer-review-done Signifies that the peer review team has reviewed this PR size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants