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

✨ controlplane/rosa: allow configuring private link #4758

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ linters-settings:
alias: apimachinerytypes
- pkg: "sigs.k8s.io/cluster-api/exp/api/v1beta1"
alias: expclusterv1
- pkg: "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
alias: clustersmgmtv1
staticcheck:
go: "1.21"
stylecheck:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ DOCKER_BUILDKIT=1
export ACK_GINKGO_DEPRECATIONS := 1.16.4

# Set --output-base for conversion-gen if we are not within GOPATH
ifneq ($(abspath $(REPO_ROOT)),$(shell go env GOPATH)/src/sigs.k8s.io/cluster-api-provider-aws)
ifneq ($(abspath $(REPO_ROOT)),$(abspath $(shell go env GOPATH)/src/sigs.k8s.io/cluster-api-provider-aws))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously Makefile couldn't handle $GOPATH with trailing / ...

GEN_OUTPUT_BASE := --output-base=$(REPO_ROOT)
else
export GOPATH := $(shell go env GOPATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,28 @@ spec:
items:
type: string
type: array
aws:
description: AWS configures aspects of the ROSA HCP workload cluster
that are specific to AWS.
properties:
privateLink:
description: PrivateLink configures whether Private Link is enabled
for the cluster
type: boolean
privateLinkConfiguration:
description: PrivateLinkConfiguration configures the Private Link
for the cluster
properties:
principals:
description: Principals are the ARNs for principals that are
allowed for the Private Link.
items:
type: string
type: array
type: object
required:
- privateLink
type: object
controlPlaneEndpoint:
description: ControlPlaneEndpoint represents the endpoint used to
communicate with the control plane.
Expand Down Expand Up @@ -277,6 +299,7 @@ spec:
required:
- accountID
- availabilityZones
- aws
- creatorARN
- installerRoleARN
- machineCIDR
Expand Down
16 changes: 16 additions & 0 deletions controlplane/rosa/api/v1beta2/rosacontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ type RosaControlPlaneSpec struct { //nolint: maligned
// - ocmApiUrl: Optional, defaults to 'https://api.openshift.com'
// +optional
CredentialsSecretRef *corev1.LocalObjectReference `json:"credentialsSecretRef,omitempty"`

// AWS configures aspects of the ROSA HCP workload cluster that are specific to AWS.
AWS AWSConfiguration `json:"aws"`
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this field required?
Given this provider can only provision AWS clusters, the naming of this field aws might be confusing. Do we really need to wrap the PrivateLink field with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}

type AWSConfiguration struct {
// PrivateLink configures whether Private Link is enabled for the cluster
PrivateLink bool `json:"privateLink"`

// PrivateLinkConfiguration configures the Private Link for the cluster
PrivateLinkConfiguration *PrivateLinkConfiguration `json:"privateLinkConfiguration,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

PrivateLinkConfiguration is not exposed by the rosa cli, I don't think we should expose it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does someone configure the principals with the rosa CLI? Is it day-2?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think its possible to configure this, maybe only SREs have access.

}

type PrivateLinkConfiguration struct {
// Principals are the ARNs for principals that are allowed for the Private Link.
Principals []string `json:"principals,omitempty"`
}

// AWSRolesRef contains references to various AWS IAM roles required for operators to make calls against the AWS API.
Expand Down
41 changes: 41 additions & 0 deletions controlplane/rosa/api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading