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

Add AvailabilityZones field #92

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions config/crd/bases/registry.ethos.adobe.com_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ spec:
- certificateAuthorityData
- endpoint
type: object
availabilityZones:
description: AvailabilityZones cluster availability zones
items:
properties:
id:
type: string
name:
type: string
required:
- name
type: object
type: array
businessUnit:
description: The BU that owns the cluster
type: string
Expand Down
7 changes: 7 additions & 0 deletions local/client/dummy-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ spec:
taints:
- workload=memory-optimized:NoSchedule
accountId: "11111-2222-3333-4444-555555555"
availabilityZones:
- name: us-east-1a
id: use1-az1
- name: us-east-1b
id: use1-az2
- name: us-east-1c
id: use1-az3
virtualNetworks:
- id: "/subscriptions/11111-2222-3333-4444-555555555/resourceGroups/cluster01_local_network/providers/Microsoft.Network/virtualNetworks/cluster01_local_useast1-vnet/subnets/cluster01_local_useast1_master_network_10_0_0_0_24"
cidrs:
Expand Down
7 changes: 7 additions & 0 deletions local/database/dummy-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@
clusterCapacity: 30
clusterProvisioning: 30
lastUpdated: "2023-03-22T11:55:41Z"
availabilityZones:
- name: us-east-1a
id: use1-az1
- name: us-east-1b
id: use1-az2
- name: us-east-1c
id: use1-az3
status: Active
phase: Running
tags:
Expand Down
8 changes: 8 additions & 0 deletions pkg/api/registry/v1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ type ClusterSpec struct {

// ServiceMetadata service specific metadata
ServiceMetadata ServiceMetadata `json:"services,omitempty"`

// AvailabilityZones cluster availability zones
AvailabilityZones []AvailabilityZone `json:"availabilityZones,omitempty"`
}

// Offering the cluster is meant for
Expand Down Expand Up @@ -255,6 +258,11 @@ type ServiceMetadataItem map[string]ServiceMetadataMap

type ServiceMetadataMap map[string]string

type AvailabilityZone struct {
Name string `json:"name"`
ID string `json:"id,omitempty"`
}

// ClusterStatus defines the observed state of Cluster
type ClusterStatus struct {
// Send/Receive Errors
Expand Down
20 changes: 20 additions & 0 deletions pkg/api/registry/v1/zz_generated.deepcopy.go

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

18 changes: 16 additions & 2 deletions pkg/database/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,22 @@ var _ = Describe("Database Suite", func() {
Phase: "Running",
Type: "Dedicated",
Capabilities: []string{"gpu-compute"},
LastUpdated: "2020-03-20T07:55:46.132Z",
Tags: map[string]string{"onboarding": "on", "scaling": "on"},
AvailabilityZones: []registryv1.AvailabilityZone{
{
Name: "us-east-1a",
ID: "use1-az1",
},
{
Name: "us-east-1b",
ID: "use1-az2",
},
{
Name: "us-east-1c",
ID: "use1-az3",
},
},
LastUpdated: "2020-03-20T07:55:46.132Z",
Tags: map[string]string{"onboarding": "on", "scaling": "on"},
},
},
},
Expand Down
7 changes: 7 additions & 0 deletions pkg/database/testdata/clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,10 @@
tags:
onboarding: "on"
scaling: "on"
availabilityZones:
- name: us-east-1a
id: use1-az1
- name: us-east-1b
id: use1-az2
- name: us-east-1c
id: use1-az3
Loading