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

✨ ROSA: Add ProvisionShardID API field to ROSAControlPlane #4872

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ spec:
oidcID:
description: The ID of the OpenID Connect Provider.
type: string
provisionShardID:
description: ProvisionShardID defines the shard where rosa control
plane components will be hosted.
type: string
x-kubernetes-validations:
- message: provisionShardID is immutable
rule: self == oldSelf
region:
description: The AWS Region the cluster lives in.
type: string
Expand Down
6 changes: 6 additions & 0 deletions controlplane/rosa/api/v1beta2/rosacontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ type RosaControlPlaneSpec struct { //nolint: maligned
// +optional
AuditLogRoleARN string `json:"auditLogRoleARN,omitempty"`

// ProvisionShardID defines the shard where rosa control plane components will be hosted.
//
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="provisionShardID is immutable"
// +optional
ProvisionShardID string `json:"provisionShardID,omitempty"`

// CredentialsSecretRef references a secret with necessary credentials to connect to the OCM API.
// The secret should contain the following data keys:
// - ocmToken: eyJhbGciOiJIUzI1NiIsI....
Expand Down
6 changes: 6 additions & 0 deletions controlplane/rosa/controllers/rosacontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,12 @@ func buildOCMClusterSpec(controPlaneSpec rosacontrolplanev1.RosaControlPlaneSpec
ocmClusterSpec.MinReplicas = computeAutoscaling.MinReplicas
}

if controPlaneSpec.ProvisionShardID != "" {
ocmClusterSpec.CustomProperties = map[string]string{
"provision_shard_id": controPlaneSpec.ProvisionShardID,
}
}

return ocmClusterSpec, nil
}

Expand Down