From eeccfdbad8188072394bf184c214df2264bcf133 Mon Sep 17 00:00:00 2001 From: Jakub Dyszkiewicz Date: Wed, 26 Jun 2024 11:53:55 +0200 Subject: [PATCH 1/3] feat(meshmultizoneservice): api Signed-off-by: Jakub Dyszkiewicz --- .../crds/kuma.io_meshmultizoneservices.yaml | 133 ++++++++++ deployments/charts/kuma/values.yaml | 1 + docs/generated/openapi.yaml | 248 ++++++++++++++++++ .../crds/kuma.io_meshmultizoneservices.yaml | 133 ++++++++++ docs/generated/raw/helm-values.yaml | 1 + .../resources/apis/zz_generated.policies.go | 1 + .../api/v1alpha1/meshmultizoneservice.go | 42 +++ .../api/v1alpha1/rest.yaml | 140 ++++++++++ .../api/v1alpha1/schema.yaml | 107 ++++++++ .../api/v1alpha1/suite_test.go | 11 + .../api/v1alpha1/validator.go | 14 + .../api/v1alpha1/validator_test.go | 36 +++ .../api/v1alpha1/zz_generated.deepcopy.go | 114 ++++++++ .../api/v1alpha1/zz_generated.resource.go | 166 ++++++++++++ .../crd/kuma.io_meshmultizoneservices.yaml | 133 ++++++++++ .../k8s/v1alpha1/groupversion_info.go | 19 ++ .../k8s/v1alpha1/zz_generated.deepcopy.go | 77 ++++++ .../k8s/v1alpha1/zz_generated.types.go | 125 +++++++++ .../zz_generated.plugin.go | 12 + .../resources/apis/zz_generated.modules.go | 8 +- 20 files changed, 1518 insertions(+), 3 deletions(-) create mode 100644 deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml create mode 100644 docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/rest.yaml create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/suite_test.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator_test.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.deepcopy.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.resource.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml create mode 100644 pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/groupversion_info.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.deepcopy.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.types.go create mode 100644 pkg/core/resources/apis/meshmultizoneservice/zz_generated.plugin.go diff --git a/deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml b/deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml new file mode 100644 index 000000000000..6ca06036f60f --- /dev/null +++ b/deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml @@ -0,0 +1,133 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: meshmultizoneservices.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: MeshMultiZoneService + listKind: MeshMultiZoneServiceList + plural: meshmultizoneservices + singular: meshmultizoneservice + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService + resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by + labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + type: object + served: true + storage: true diff --git a/deployments/charts/kuma/values.yaml b/deployments/charts/kuma/values.yaml index bcd67e45464a..d090672fa7b6 100644 --- a/deployments/charts/kuma/values.yaml +++ b/deployments/charts/kuma/values.yaml @@ -729,6 +729,7 @@ plugins: resources: hostnamegenerators: true meshexternalservices: true + meshmultizoneservices: true meshservices: true policies: meshaccesslogs: true diff --git a/docs/generated/openapi.yaml b/docs/generated/openapi.yaml index f51317ad11c5..b93ac88eb272 100644 --- a/docs/generated/openapi.yaml +++ b/docs/generated/openapi.yaml @@ -1756,6 +1756,101 @@ paths: responses: '200': $ref: '#/components/responses/MeshExternalServiceList' + /meshes/{mesh}/meshmultizoneservices/{name}: + get: + summary: Returns MeshMultiZoneService entity + tags: + - MeshMultiZoneService + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + - in: path + name: name + schema: + type: string + required: true + description: name of the MeshMultiZoneService + responses: + '200': + $ref: '#/components/responses/MeshMultiZoneServiceItem' + put: + summary: Creates or Updates MeshMultiZoneService entity + tags: + - MeshMultiZoneService + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + - in: path + name: name + schema: + type: string + required: true + description: name of the MeshMultiZoneService + requestBody: + description: Put request + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MeshMultiZoneServiceItem' + responses: + '200': + description: Updated + content: + application/json: + schema: + $ref: >- + #/components/schemas/MeshMultiZoneServiceCreateOrUpdateSuccessResponse + '201': + description: Created + content: + application/json: + schema: + $ref: >- + #/components/schemas/MeshMultiZoneServiceCreateOrUpdateSuccessResponse + delete: + summary: Deletes MeshMultiZoneService entity + tags: + - MeshMultiZoneService + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + - in: path + name: name + schema: + type: string + required: true + description: name of the MeshMultiZoneService + responses: + '200': + description: Successful response + /meshes/{mesh}/meshmultizoneservices: + get: + summary: Returns a list of MeshMultiZoneService in the mesh. + tags: + - MeshMultiZoneService + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + responses: + '200': + $ref: '#/components/responses/MeshMultiZoneServiceList' /meshes/{mesh}/meshservices/{name}: get: summary: Returns MeshService entity @@ -10930,6 +11025,136 @@ components: request should correct or be aware of. items: type: string + MeshMultiZoneServiceItem: + type: object + required: + - type + - name + - spec + properties: + type: + description: the type of the resource + type: string + enum: + - MeshMultiZoneService + mesh: + description: >- + Mesh is the name of the Kuma mesh this resource belongs to. It may + be omitted for cluster-scoped resources. + type: string + default: default + name: + description: Name of the Kuma resource + type: string + labels: + additionalProperties: + type: string + description: The labels to help identity resources + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: >- + Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: >- + Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + MeshMultiZoneServiceCreateOrUpdateSuccessResponse: + type: object + properties: + warnings: + type: array + description: > + warnings is a list of warning messages to return to the requesting + Kuma API clients. + + Warning messages describe a problem the client making the API + request should correct or be aware of. + items: + type: string MeshServiceItem: type: object required: @@ -11582,6 +11807,29 @@ components: next: type: string description: URL to the next page + MeshMultiZoneServiceItem: + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/MeshMultiZoneServiceItem' + MeshMultiZoneServiceList: + description: List + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/MeshMultiZoneServiceItem' + total: + type: number + description: The total number of entities + next: + type: string + description: URL to the next page MeshServiceItem: description: Successful response content: diff --git a/docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml b/docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml new file mode 100644 index 000000000000..6ca06036f60f --- /dev/null +++ b/docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml @@ -0,0 +1,133 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: meshmultizoneservices.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: MeshMultiZoneService + listKind: MeshMultiZoneServiceList + plural: meshmultizoneservices + singular: meshmultizoneservice + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService + resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by + labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + type: object + served: true + storage: true diff --git a/docs/generated/raw/helm-values.yaml b/docs/generated/raw/helm-values.yaml index bcd67e45464a..d090672fa7b6 100644 --- a/docs/generated/raw/helm-values.yaml +++ b/docs/generated/raw/helm-values.yaml @@ -729,6 +729,7 @@ plugins: resources: hostnamegenerators: true meshexternalservices: true + meshmultizoneservices: true meshservices: true policies: meshaccesslogs: true diff --git a/pkg/config/core/resources/apis/zz_generated.policies.go b/pkg/config/core/resources/apis/zz_generated.policies.go index 8e4021a63cd5..5a34668a5f05 100644 --- a/pkg/config/core/resources/apis/zz_generated.policies.go +++ b/pkg/config/core/resources/apis/zz_generated.policies.go @@ -6,6 +6,7 @@ package apis var DefaultEnabled = []string{ "hostnamegenerators", "meshexternalservices", + "meshmultizoneservices", "meshservices", } diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go new file mode 100644 index 000000000000..22737ca77cab --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go @@ -0,0 +1,42 @@ +// +kubebuilder:object:generate=true +package v1alpha1 + +import ( + hostnamegenerator_api "github.com/kumahq/kuma/pkg/core/resources/apis/hostnamegenerator/api/v1alpha1" + meshservice_api "github.com/kumahq/kuma/pkg/core/resources/apis/meshservice/api/v1alpha1" +) + +// MeshMultiZoneService allows users to create a service that spawns across multiple zones +// It aggregates existing MeshServices by labels. +// +kuma:policy:is_policy=false +// +kuma:policy:has_status=true +type MeshMultiZoneService struct { + // Selector is a way to select multiple MeshServices + Selector Selector `json:"selector"` +} + +type Selector struct { + // MeshService selects MeshServices + MeshService MeshServiceSelector `json:"meshService"` +} + +type MeshServiceSelector struct { + // MatchLabels matches multiple MeshServices by labels + MatchLabels map[string]string `json:"matchLabels"` +} + +type MeshMultiZoneServiceStatus struct { + // Ports is an aggregated distinct list of ports from selected MeshServices + Ports []meshservice_api.Port `json:"ports,omitempty"` + // Addresses is a list of addresses generated by HostnameGenerator + Addresses []hostnamegenerator_api.Address `json:"addresses,omitempty"` + // VIPs is a list of assigned Kuma VIPs. + VIPs []meshservice_api.VIP `json:"vips,omitempty"` + // MeshServices is a list of matched MeshServices + MeshServices []MatchedMeshService `json:"meshServices"` +} + +type MatchedMeshService struct { + // Name is a core name of MeshService + Name string `json:"name"` +} diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/rest.yaml b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/rest.yaml new file mode 100644 index 000000000000..d2f3ada80acc --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/rest.yaml @@ -0,0 +1,140 @@ +openapi: 3.0.3 +info: + version: v1alpha1 + title: Kuma API + description: Kuma API + x-ref-schema-name: "MeshMultiZoneService" + +paths: + /meshes/{mesh}/meshmultizoneservices/{name}: + get: + summary: Returns MeshMultiZoneService entity + tags: [ "MeshMultiZoneService" ] + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + - in: path + name: name + schema: + type: string + required: true + description: name of the MeshMultiZoneService + responses: + '200': + $ref: "#/components/responses/MeshMultiZoneServiceItem" + + put: + summary: Creates or Updates MeshMultiZoneService entity + tags: [ "MeshMultiZoneService" ] + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + - in: path + name: name + schema: + type: string + required: true + description: name of the MeshMultiZoneService + requestBody: + description: Put request + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MeshMultiZoneServiceItem' + responses: + '200': + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/MeshMultiZoneServiceCreateOrUpdateSuccessResponse' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/MeshMultiZoneServiceCreateOrUpdateSuccessResponse' + + delete: + summary: Deletes MeshMultiZoneService entity + tags: [ "MeshMultiZoneService" ] + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + - in: path + name: name + schema: + type: string + required: true + description: name of the MeshMultiZoneService + responses: + '200': + description: Successful response + + /meshes/{mesh}/meshmultizoneservices: + get: + summary: Returns a list of MeshMultiZoneService in the mesh. + tags: [ "MeshMultiZoneService" ] + parameters: + - in: path + name: mesh + schema: + type: string + required: true + description: name of the mesh + responses: + '200': + $ref: "#/components/responses/MeshMultiZoneServiceList" + +components: + schemas: + MeshMultiZoneServiceItem: + $ref: 'schema.yaml' + MeshMultiZoneServiceCreateOrUpdateSuccessResponse: + type: object + properties: + warnings: + type: array + description: | + warnings is a list of warning messages to return to the requesting Kuma API clients. + Warning messages describe a problem the client making the API request should correct or be aware of. + items: + type: string + + responses: + MeshMultiZoneServiceItem: + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/MeshMultiZoneServiceItem' + MeshMultiZoneServiceList: + description: List + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/MeshMultiZoneServiceItem" + total: + type: number + description: The total number of entities + next: + type: string + description: URL to the next page diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml new file mode 100644 index 000000000000..74bc4f58b7c6 --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml @@ -0,0 +1,107 @@ +type: object +required: [type, name, spec] +properties: + type: + description: 'the type of the resource' + type: string + enum: + - MeshMultiZoneService + mesh: + description: 'Mesh is the name of the Kuma mesh this resource belongs to. It may be omitted for cluster-scoped resources.' + type: string + default: default + name: + description: 'Name of the Kuma resource' + type: string + labels: + additionalProperties: + type: string + description: 'The labels to help identity resources' + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/suite_test.go b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/suite_test.go new file mode 100644 index 000000000000..032613021160 --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/suite_test.go @@ -0,0 +1,11 @@ +package v1alpha1_test + +import ( + "testing" + + "github.com/kumahq/kuma/pkg/test" +) + +func TestPlugin(t *testing.T) { + test.RunSpecs(t, "MeshMultiZoneService") +} diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator.go b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator.go new file mode 100644 index 000000000000..edc4a6cc638a --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator.go @@ -0,0 +1,14 @@ +package v1alpha1 + +import ( + "github.com/kumahq/kuma/pkg/core/validators" +) + +func (r *MeshMultiZoneServiceResource) validate() error { + var verr validators.ValidationError + path := validators.RootedAt("spec") + if len(r.Spec.Selector.MeshService.MatchLabels) == 0 { + verr.AddViolationAt(path.Field("selector").Field("meshService").Field("matchLabels"), "cannot be empty") + } + return verr.OrNil() +} diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator_test.go b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator_test.go new file mode 100644 index 000000000000..0d588b21be46 --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/validator_test.go @@ -0,0 +1,36 @@ +package v1alpha1_test + +import ( + . "github.com/onsi/ginkgo/v2" + + meshmzservice_api "github.com/kumahq/kuma/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1" + "github.com/kumahq/kuma/pkg/core/validators" + . "github.com/kumahq/kuma/pkg/test/resources/validators" +) + +var _ = Describe("validation", func() { + DescribeErrorCases( + meshmzservice_api.NewMeshMultiZoneServiceResource, + ErrorCases( + "spec errors", + []validators.Violation{ + { + Field: "spec.selector.meshService.matchLabels", + Message: "cannot be empty", + }, + }, + ``), + ) + + DescribeValidCases( + meshmzservice_api.NewMeshMultiZoneServiceResource, + Entry( + "full spec", + ` +selector: + meshService: + matchLabels: + app: xyz +`), + ) +}) diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.deepcopy.go b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..c9a8b166e6a9 --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,114 @@ +//go:build !ignore_autogenerated + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + hostnamegeneratorapiv1alpha1 "github.com/kumahq/kuma/pkg/core/resources/apis/hostnamegenerator/api/v1alpha1" + apiv1alpha1 "github.com/kumahq/kuma/pkg/core/resources/apis/meshservice/api/v1alpha1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MatchedMeshService) DeepCopyInto(out *MatchedMeshService) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchedMeshService. +func (in *MatchedMeshService) DeepCopy() *MatchedMeshService { + if in == nil { + return nil + } + out := new(MatchedMeshService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshMultiZoneService) DeepCopyInto(out *MeshMultiZoneService) { + *out = *in + in.Selector.DeepCopyInto(&out.Selector) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshMultiZoneService. +func (in *MeshMultiZoneService) DeepCopy() *MeshMultiZoneService { + if in == nil { + return nil + } + out := new(MeshMultiZoneService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshMultiZoneServiceStatus) DeepCopyInto(out *MeshMultiZoneServiceStatus) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]apiv1alpha1.Port, len(*in)) + copy(*out, *in) + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]hostnamegeneratorapiv1alpha1.Address, len(*in)) + copy(*out, *in) + } + if in.VIPs != nil { + in, out := &in.VIPs, &out.VIPs + *out = make([]apiv1alpha1.VIP, len(*in)) + copy(*out, *in) + } + if in.MeshServices != nil { + in, out := &in.MeshServices, &out.MeshServices + *out = make([]MatchedMeshService, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshMultiZoneServiceStatus. +func (in *MeshMultiZoneServiceStatus) DeepCopy() *MeshMultiZoneServiceStatus { + if in == nil { + return nil + } + out := new(MeshMultiZoneServiceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshServiceSelector) DeepCopyInto(out *MeshServiceSelector) { + *out = *in + if in.MatchLabels != nil { + in, out := &in.MatchLabels, &out.MatchLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshServiceSelector. +func (in *MeshServiceSelector) DeepCopy() *MeshServiceSelector { + if in == nil { + return nil + } + out := new(MeshServiceSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Selector) DeepCopyInto(out *Selector) { + *out = *in + in.MeshService.DeepCopyInto(&out.MeshService) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selector. +func (in *Selector) DeepCopy() *Selector { + if in == nil { + return nil + } + out := new(Selector) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.resource.go b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.resource.go new file mode 100644 index 000000000000..a84e6680960a --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/zz_generated.resource.go @@ -0,0 +1,166 @@ +// Generated by tools/policy-gen. +// Run "make generate" to update this file. + +// nolint:whitespace +package v1alpha1 + +import ( + _ "embed" + "fmt" + + "k8s.io/kube-openapi/pkg/validation/spec" + "sigs.k8s.io/yaml" + + "github.com/kumahq/kuma/pkg/core/resources/model" +) + +//go:embed schema.yaml +var rawSchema []byte + +func init() { + var schema spec.Schema + if rawSchema != nil { + if err := yaml.Unmarshal(rawSchema, &schema); err != nil { + panic(err) + } + } + rawSchema = nil + MeshMultiZoneServiceResourceTypeDescriptor.Schema = &schema +} + +const ( + MeshMultiZoneServiceType model.ResourceType = "MeshMultiZoneService" +) + +var _ model.Resource = &MeshMultiZoneServiceResource{} + +type MeshMultiZoneServiceResource struct { + Meta model.ResourceMeta + Spec *MeshMultiZoneService + Status *MeshMultiZoneServiceStatus +} + +func NewMeshMultiZoneServiceResource() *MeshMultiZoneServiceResource { + return &MeshMultiZoneServiceResource{ + Spec: &MeshMultiZoneService{}, + Status: &MeshMultiZoneServiceStatus{}, + } +} + +func (t *MeshMultiZoneServiceResource) GetMeta() model.ResourceMeta { + return t.Meta +} + +func (t *MeshMultiZoneServiceResource) SetMeta(m model.ResourceMeta) { + t.Meta = m +} + +func (t *MeshMultiZoneServiceResource) GetSpec() model.ResourceSpec { + return t.Spec +} + +func (t *MeshMultiZoneServiceResource) SetSpec(spec model.ResourceSpec) error { + protoType, ok := spec.(*MeshMultiZoneService) + if !ok { + return fmt.Errorf("invalid type %T for Spec", spec) + } else { + if protoType == nil { + t.Spec = &MeshMultiZoneService{} + } else { + t.Spec = protoType + } + return nil + } +} + +func (t *MeshMultiZoneServiceResource) GetStatus() model.ResourceStatus { + return t.Status +} + +func (t *MeshMultiZoneServiceResource) SetStatus(status model.ResourceStatus) error { + protoType, ok := status.(*MeshMultiZoneServiceStatus) + if !ok { + return fmt.Errorf("invalid type %T for Status", status) + } else { + if protoType == nil { + t.Status = &MeshMultiZoneServiceStatus{} + } else { + t.Status = protoType + } + return nil + } +} + +func (t *MeshMultiZoneServiceResource) Descriptor() model.ResourceTypeDescriptor { + return MeshMultiZoneServiceResourceTypeDescriptor +} + +func (t *MeshMultiZoneServiceResource) Validate() error { + if v, ok := interface{}(t).(interface{ validate() error }); !ok { + return nil + } else { + return v.validate() + } +} + +var _ model.ResourceList = &MeshMultiZoneServiceResourceList{} + +type MeshMultiZoneServiceResourceList struct { + Items []*MeshMultiZoneServiceResource + Pagination model.Pagination +} + +func (l *MeshMultiZoneServiceResourceList) GetItems() []model.Resource { + res := make([]model.Resource, len(l.Items)) + for i, elem := range l.Items { + res[i] = elem + } + return res +} + +func (l *MeshMultiZoneServiceResourceList) GetItemType() model.ResourceType { + return MeshMultiZoneServiceType +} + +func (l *MeshMultiZoneServiceResourceList) NewItem() model.Resource { + return NewMeshMultiZoneServiceResource() +} + +func (l *MeshMultiZoneServiceResourceList) AddItem(r model.Resource) error { + if trr, ok := r.(*MeshMultiZoneServiceResource); ok { + l.Items = append(l.Items, trr) + return nil + } else { + return model.ErrorInvalidItemType((*MeshMultiZoneServiceResource)(nil), r) + } +} + +func (l *MeshMultiZoneServiceResourceList) GetPagination() *model.Pagination { + return &l.Pagination +} + +func (l *MeshMultiZoneServiceResourceList) SetPagination(p model.Pagination) { + l.Pagination = p +} + +var MeshMultiZoneServiceResourceTypeDescriptor = model.ResourceTypeDescriptor{ + Name: MeshMultiZoneServiceType, + Resource: NewMeshMultiZoneServiceResource(), + ResourceList: &MeshMultiZoneServiceResourceList{}, + Scope: model.ScopeMesh, + KDSFlags: model.GlobalToAllZonesFlag | model.ZoneToGlobalFlag, + WsPath: "meshmultizoneservices", + KumactlArg: "meshmultizoneservice", + KumactlListArg: "meshmultizoneservices", + AllowToInspect: false, + IsPolicy: false, + IsExperimental: false, + SingularDisplayName: "Mesh Multi Zone Service", + PluralDisplayName: "Mesh Multi Zone Services", + IsPluginOriginated: true, + IsTargetRefBased: false, + HasToTargetRef: false, + HasFromTargetRef: false, + HasStatus: true, + AllowedOnSystemNamespaceOnly: false, +} diff --git a/pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml b/pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml new file mode 100644 index 000000000000..6ca06036f60f --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml @@ -0,0 +1,133 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: meshmultizoneservices.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: MeshMultiZoneService + listKind: MeshMultiZoneServiceList + plural: meshmultizoneservices + singular: meshmultizoneservice + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService + resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by + labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + type: object + served: true + storage: true diff --git a/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/groupversion_info.go b/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/groupversion_info.go new file mode 100644 index 000000000000..f87708f0cd5b --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/groupversion_info.go @@ -0,0 +1,19 @@ +// Package v1alpha1 contains API Schema definitions for the mesh v1alpha1 API group +// +groupName=kuma.io +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "kuma.io", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.deepcopy.go b/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..cbc7d318bca6 --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,77 @@ +//go:build !ignore_autogenerated + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/kumahq/kuma/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshMultiZoneService) DeepCopyInto(out *MeshMultiZoneService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(apiv1alpha1.MeshMultiZoneService) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(apiv1alpha1.MeshMultiZoneServiceStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshMultiZoneService. +func (in *MeshMultiZoneService) DeepCopy() *MeshMultiZoneService { + if in == nil { + return nil + } + out := new(MeshMultiZoneService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MeshMultiZoneService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshMultiZoneServiceList) DeepCopyInto(out *MeshMultiZoneServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MeshMultiZoneService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshMultiZoneServiceList. +func (in *MeshMultiZoneServiceList) DeepCopy() *MeshMultiZoneServiceList { + if in == nil { + return nil + } + out := new(MeshMultiZoneServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MeshMultiZoneServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.types.go b/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.types.go new file mode 100644 index 000000000000..f165284fbbe9 --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1/zz_generated.types.go @@ -0,0 +1,125 @@ +// Generated by tools/policy-gen +// Run "make generate" to update this file. + +// nolint:whitespace +package v1alpha1 + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + policy "github.com/kumahq/kuma/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1" + core_model "github.com/kumahq/kuma/pkg/core/resources/model" + "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/model" + "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/registry" + "github.com/kumahq/kuma/pkg/plugins/runtime/k8s/metadata" +) + +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=kuma,scope=Namespaced +type MeshMultiZoneService struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec is the specification of the Kuma MeshMultiZoneService resource. + // +kubebuilder:validation:Optional + Spec *policy.MeshMultiZoneService `json:"spec,omitempty"` + // Status is the current status of the Kuma MeshMultiZoneService resource. + // +kubebuilder:validation:Optional + Status *policy.MeshMultiZoneServiceStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced +type MeshMultiZoneServiceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MeshMultiZoneService `json:"items"` +} + +func (cb *MeshMultiZoneService) GetObjectMeta() *metav1.ObjectMeta { + return &cb.ObjectMeta +} + +func (cb *MeshMultiZoneService) SetObjectMeta(m *metav1.ObjectMeta) { + cb.ObjectMeta = *m +} + +func (cb *MeshMultiZoneService) GetMesh() string { + if mesh, ok := cb.ObjectMeta.Labels[metadata.KumaMeshLabel]; ok { + return mesh + } else { + return core_model.DefaultMesh + } +} + +func (cb *MeshMultiZoneService) SetMesh(mesh string) { + if cb.ObjectMeta.Labels == nil { + cb.ObjectMeta.Labels = map[string]string{} + } + cb.ObjectMeta.Labels[metadata.KumaMeshLabel] = mesh +} + +func (cb *MeshMultiZoneService) GetSpec() (core_model.ResourceSpec, error) { + return cb.Spec, nil +} + +func (cb *MeshMultiZoneService) SetSpec(spec core_model.ResourceSpec) { + if spec == nil { + cb.Spec = nil + return + } + + if _, ok := spec.(*policy.MeshMultiZoneService); !ok { + panic(fmt.Sprintf("unexpected protobuf message type %T", spec)) + } + + cb.Spec = spec.(*policy.MeshMultiZoneService) +} + +func (cb *MeshMultiZoneService) GetStatus() (core_model.ResourceStatus, error) { + return cb.Status, nil +} + +func (cb *MeshMultiZoneService) SetStatus(status core_model.ResourceStatus) error { + if status == nil { + cb.Status = nil + return nil + } + + if _, ok := status.(*policy.MeshMultiZoneServiceStatus); !ok { + panic(fmt.Sprintf("unexpected message type %T", status)) + } + + cb.Status = status.(*policy.MeshMultiZoneServiceStatus) + return nil +} + +func (cb *MeshMultiZoneService) Scope() model.Scope { + return model.ScopeNamespace +} + +func (l *MeshMultiZoneServiceList) GetItems() []model.KubernetesObject { + result := make([]model.KubernetesObject, len(l.Items)) + for i := range l.Items { + result[i] = &l.Items[i] + } + return result +} + +func init() { + SchemeBuilder.Register(&MeshMultiZoneService{}, &MeshMultiZoneServiceList{}) + registry.RegisterObjectType(&policy.MeshMultiZoneService{}, &MeshMultiZoneService{ + TypeMeta: metav1.TypeMeta{ + APIVersion: GroupVersion.String(), + Kind: "MeshMultiZoneService", + }, + }) + registry.RegisterListType(&policy.MeshMultiZoneService{}, &MeshMultiZoneServiceList{ + TypeMeta: metav1.TypeMeta{ + APIVersion: GroupVersion.String(), + Kind: "MeshMultiZoneServiceList", + }, + }) +} diff --git a/pkg/core/resources/apis/meshmultizoneservice/zz_generated.plugin.go b/pkg/core/resources/apis/meshmultizoneservice/zz_generated.plugin.go new file mode 100644 index 000000000000..15f7b8fe7b42 --- /dev/null +++ b/pkg/core/resources/apis/meshmultizoneservice/zz_generated.plugin.go @@ -0,0 +1,12 @@ +package meshmultizoneservice + +import ( + api_v1alpha1 "github.com/kumahq/kuma/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1" + k8s_v1alpha1 "github.com/kumahq/kuma/pkg/core/resources/apis/meshmultizoneservice/k8s/v1alpha1" + "github.com/kumahq/kuma/pkg/core/resources/registry" +) + +func InitPlugin() { + registry.AddKubeScheme(k8s_v1alpha1.AddToScheme) + registry.RegisterType(api_v1alpha1.MeshMultiZoneServiceResourceTypeDescriptor) +} diff --git a/pkg/core/resources/apis/zz_generated.modules.go b/pkg/core/resources/apis/zz_generated.modules.go index 36cc2ec6e404..ce34a86f8a47 100644 --- a/pkg/core/resources/apis/zz_generated.modules.go +++ b/pkg/core/resources/apis/zz_generated.modules.go @@ -6,11 +6,13 @@ import ( "github.com/kumahq/kuma/pkg/core/plugins" "github.com/kumahq/kuma/pkg/core/resources/apis/hostnamegenerator" "github.com/kumahq/kuma/pkg/core/resources/apis/meshexternalservice" + "github.com/kumahq/kuma/pkg/core/resources/apis/meshmultizoneservice" "github.com/kumahq/kuma/pkg/core/resources/apis/meshservice" ) var NameToModule = map[string]*plugins.PluginInitializer{ - "hostnamegenerators": {InitFn: hostnamegenerator.InitPlugin, Initialized: false}, - "meshexternalservices": {InitFn: meshexternalservice.InitPlugin, Initialized: false}, - "meshservices": {InitFn: meshservice.InitPlugin, Initialized: false}, + "hostnamegenerators": {InitFn: hostnamegenerator.InitPlugin, Initialized: false}, + "meshexternalservices": {InitFn: meshexternalservice.InitPlugin, Initialized: false}, + "meshmultizoneservices": {InitFn: meshmultizoneservice.InitPlugin, Initialized: false}, + "meshservices": {InitFn: meshservice.InitPlugin, Initialized: false}, } From f2b12c92a601c654002eade7f53a63e3bac3a438 Mon Sep 17 00:00:00 2001 From: Jakub Dyszkiewicz Date: Wed, 26 Jun 2024 14:36:39 +0200 Subject: [PATCH 2/3] update tests Signed-off-by: Jakub Dyszkiewicz --- .../cmd/completion/testdata/bash.golden | 72 +++++ ...tall-control-plane.cni-enabled.golden.yaml | 6 +- ...install-control-plane.defaults.golden.yaml | 303 +++++++++++++----- .../install-control-plane.dump-values.yaml | 1 + ...all-control-plane.gateway-api-present.yaml | 303 +++++++++++++----- .../install-control-plane.global.golden.yaml | 6 +- ...ontrol-plane.override-env-vars.golden.yaml | 6 +- ...nstall-control-plane.overrides.golden.yaml | 6 +- ...install-control-plane.registry.golden.yaml | 6 +- ...roxy-ebpf-experimental-enabled.golden.yaml | 6 +- ...tall-control-plane.with-egress.golden.yaml | 6 +- .../install-control-plane.with-helm-set.yaml | 303 +++++++++++++----- ...nstall-control-plane.with-helm-values.yaml | 6 +- ...all-control-plane.with-ingress.golden.yaml | 6 +- .../install-control-plane.zone.golden.yaml | 6 +- .../doNotChangeTlsChecksum.golden.yaml | 4 + .../install-cp-helm/empty.golden.yaml | 6 +- .../install-cp-helm/fix4485.golden.yaml | 6 +- .../install-cp-helm/fix4496.golden.yaml | 6 +- .../install-cp-helm/fix4935.golden.yaml | 6 +- .../install-cp-helm/fix5978.golden.yaml | 6 +- .../install-cp-helm/fix7724.golden.yaml | 6 +- .../install-cp-helm/fix7824.golden.yaml | 6 +- .../minReadySeconds.golden.yaml | 6 +- .../securityContext.golden.yaml | 6 +- .../testdata/install-crds.all.golden.yaml | 133 ++++++++ .../base_endpoints/_resources.golden.json | 9 + pkg/config/app/kuma-cp/kuma-cp.defaults.yaml | 1 + pkg/kds/server/server_test.go | 2 +- 29 files changed, 976 insertions(+), 269 deletions(-) diff --git a/app/kumactl/cmd/completion/testdata/bash.golden b/app/kumactl/cmd/completion/testdata/bash.golden index 24ecb32f4b2e..30a4e8b4fd4d 100644 --- a/app/kumactl/cmd/completion/testdata/bash.golden +++ b/app/kumactl/cmd/completion/testdata/bash.golden @@ -2389,6 +2389,76 @@ _kumactl_get_meshmetrics() noun_aliases=() } +_kumactl_get_meshmultizoneservice() +{ + last_command="kumactl_get_meshmultizoneservice" + + command_aliases=() + + commands=() + + flags=() + two_word_flags=() + local_nonpersistent_flags=() + flags_with_completion=() + flags_completion=() + + flags+=("--mesh=") + two_word_flags+=("--mesh") + two_word_flags+=("-m") + flags+=("--api-timeout=") + two_word_flags+=("--api-timeout") + flags+=("--config-file=") + two_word_flags+=("--config-file") + flags+=("--log-level=") + two_word_flags+=("--log-level") + flags+=("--no-config") + flags+=("--output=") + two_word_flags+=("--output") + two_word_flags+=("-o") + + must_have_one_flag=() + must_have_one_noun=() + noun_aliases=() +} + +_kumactl_get_meshmultizoneservices() +{ + last_command="kumactl_get_meshmultizoneservices" + + command_aliases=() + + commands=() + + flags=() + two_word_flags=() + local_nonpersistent_flags=() + flags_with_completion=() + flags_completion=() + + flags+=("--mesh=") + two_word_flags+=("--mesh") + two_word_flags+=("-m") + flags+=("--offset=") + two_word_flags+=("--offset") + flags+=("--size=") + two_word_flags+=("--size") + flags+=("--api-timeout=") + two_word_flags+=("--api-timeout") + flags+=("--config-file=") + two_word_flags+=("--config-file") + flags+=("--log-level=") + two_word_flags+=("--log-level") + flags+=("--no-config") + flags+=("--output=") + two_word_flags+=("--output") + two_word_flags+=("-o") + + must_have_one_flag=() + must_have_one_noun=() + noun_aliases=() +} + _kumactl_get_meshpassthrough() { last_command="kumactl_get_meshpassthrough" @@ -3972,6 +4042,8 @@ _kumactl_get() commands+=("meshloadbalancingstrategy") commands+=("meshmetric") commands+=("meshmetrics") + commands+=("meshmultizoneservice") + commands+=("meshmultizoneservices") commands+=("meshpassthrough") commands+=("meshpassthroughs") commands+=("meshproxypatch") diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.cni-enabled.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.cni-enabled.golden.yaml index d44e66770b60..b70b9201ddb8 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.cni-enabled.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.cni-enabled.golden.yaml @@ -256,6 +256,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -594,7 +595,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -792,6 +793,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -848,6 +850,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -977,6 +980,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml index 141dad6f99bd..165daa737240 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml @@ -3698,6 +3698,139 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: meshmultizoneservices.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: MeshMultiZoneService + listKind: MeshMultiZoneServiceList + plural: meshmultizoneservices + singular: meshmultizoneservice + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService + resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by + labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -6268,6 +6401,76 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: dataplanes.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: Dataplane + listKind: DataplaneList + plural: dataplanes + singular: dataplane + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Service tag of the first inbound + jsonPath: .spec.networking.inbound[0].tags['kuma\.io/service'] + name: kuma.io/service + type: string + - description: Service tag of the second inbound + jsonPath: .spec.networking.inbound[1].tags['kuma\.io/service'] + name: kuma.io/service + type: string + - description: Service tag of the third inbound + jsonPath: .spec.networking.inbound[2].tags['kuma\.io/service'] + name: kuma.io/service + priority: 1 + type: string + - description: Service tag of the fourth inbound + jsonPath: .spec.networking.inbound[3].tags['kuma\.io/service'] + name: kuma.io/service + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + mesh: + description: |- + Mesh is the name of the Kuma mesh this resource belongs to. + It may be omitted for cluster-scoped resources. + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma Dataplane resource. + x-kubernetes-preserve-unknown-fields: true + type: object + served: true + storage: true + subresources: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -6552,76 +6755,6 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.14.0 - name: dataplanes.kuma.io -spec: - group: kuma.io - names: - categories: - - kuma - kind: Dataplane - listKind: DataplaneList - plural: dataplanes - singular: dataplane - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: Service tag of the first inbound - jsonPath: .spec.networking.inbound[0].tags['kuma\.io/service'] - name: kuma.io/service - type: string - - description: Service tag of the second inbound - jsonPath: .spec.networking.inbound[1].tags['kuma\.io/service'] - name: kuma.io/service - type: string - - description: Service tag of the third inbound - jsonPath: .spec.networking.inbound[2].tags['kuma\.io/service'] - name: kuma.io/service - priority: 1 - type: string - - description: Service tag of the fourth inbound - jsonPath: .spec.networking.inbound[3].tags['kuma\.io/service'] - name: kuma.io/service - priority: 1 - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - mesh: - description: |- - Mesh is the name of the Kuma mesh this resource belongs to. - It may be omitted for cluster-scoped resources. - type: string - metadata: - type: object - spec: - description: Spec is the specification of the Kuma Dataplane resource. - x-kubernetes-preserve-unknown-fields: true - type: object - served: true - storage: true - subresources: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -7228,16 +7361,16 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: traffictraces.kuma.io + name: externalservices.kuma.io spec: group: kuma.io names: categories: - kuma - kind: TrafficTrace - listKind: TrafficTraceList - plural: traffictraces - singular: traffictrace + kind: ExternalService + listKind: ExternalServiceList + plural: externalservices + singular: externalservice scope: Cluster versions: - name: v1alpha1 @@ -7267,7 +7400,7 @@ spec: metadata: type: object spec: - description: Spec is the specification of the Kuma TrafficTrace resource. + description: Spec is the specification of the Kuma ExternalService resource. x-kubernetes-preserve-unknown-fields: true type: object served: true @@ -7278,16 +7411,16 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: externalservices.kuma.io + name: traffictraces.kuma.io spec: group: kuma.io names: categories: - kuma - kind: ExternalService - listKind: ExternalServiceList - plural: externalservices - singular: externalservice + kind: TrafficTrace + listKind: TrafficTraceList + plural: traffictraces + singular: traffictrace scope: Cluster versions: - name: v1alpha1 @@ -7317,7 +7450,7 @@ spec: metadata: type: object spec: - description: Spec is the specification of the Kuma ExternalService resource. + description: Spec is the specification of the Kuma TrafficTrace resource. x-kubernetes-preserve-unknown-fields: true type: object served: true @@ -9314,6 +9447,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -9493,7 +9627,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -9687,6 +9821,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -9743,6 +9878,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -9872,6 +10008,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.dump-values.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.dump-values.yaml index bcd67e45464a..d090672fa7b6 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.dump-values.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.dump-values.yaml @@ -729,6 +729,7 @@ plugins: resources: hostnamegenerators: true meshexternalservices: true + meshmultizoneservices: true meshservices: true policies: meshaccesslogs: true diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml index 46361bb3aea8..f2bdb007620b 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml @@ -3698,6 +3698,139 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: meshmultizoneservices.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: MeshMultiZoneService + listKind: MeshMultiZoneServiceList + plural: meshmultizoneservices + singular: meshmultizoneservice + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService + resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by + labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -6268,6 +6401,76 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: dataplanes.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: Dataplane + listKind: DataplaneList + plural: dataplanes + singular: dataplane + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Service tag of the first inbound + jsonPath: .spec.networking.inbound[0].tags['kuma\.io/service'] + name: kuma.io/service + type: string + - description: Service tag of the second inbound + jsonPath: .spec.networking.inbound[1].tags['kuma\.io/service'] + name: kuma.io/service + type: string + - description: Service tag of the third inbound + jsonPath: .spec.networking.inbound[2].tags['kuma\.io/service'] + name: kuma.io/service + priority: 1 + type: string + - description: Service tag of the fourth inbound + jsonPath: .spec.networking.inbound[3].tags['kuma\.io/service'] + name: kuma.io/service + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + mesh: + description: |- + Mesh is the name of the Kuma mesh this resource belongs to. + It may be omitted for cluster-scoped resources. + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma Dataplane resource. + x-kubernetes-preserve-unknown-fields: true + type: object + served: true + storage: true + subresources: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -6552,76 +6755,6 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.14.0 - name: dataplanes.kuma.io -spec: - group: kuma.io - names: - categories: - - kuma - kind: Dataplane - listKind: DataplaneList - plural: dataplanes - singular: dataplane - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: Service tag of the first inbound - jsonPath: .spec.networking.inbound[0].tags['kuma\.io/service'] - name: kuma.io/service - type: string - - description: Service tag of the second inbound - jsonPath: .spec.networking.inbound[1].tags['kuma\.io/service'] - name: kuma.io/service - type: string - - description: Service tag of the third inbound - jsonPath: .spec.networking.inbound[2].tags['kuma\.io/service'] - name: kuma.io/service - priority: 1 - type: string - - description: Service tag of the fourth inbound - jsonPath: .spec.networking.inbound[3].tags['kuma\.io/service'] - name: kuma.io/service - priority: 1 - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - mesh: - description: |- - Mesh is the name of the Kuma mesh this resource belongs to. - It may be omitted for cluster-scoped resources. - type: string - metadata: - type: object - spec: - description: Spec is the specification of the Kuma Dataplane resource. - x-kubernetes-preserve-unknown-fields: true - type: object - served: true - storage: true - subresources: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -7228,16 +7361,16 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: traffictraces.kuma.io + name: externalservices.kuma.io spec: group: kuma.io names: categories: - kuma - kind: TrafficTrace - listKind: TrafficTraceList - plural: traffictraces - singular: traffictrace + kind: ExternalService + listKind: ExternalServiceList + plural: externalservices + singular: externalservice scope: Cluster versions: - name: v1alpha1 @@ -7267,7 +7400,7 @@ spec: metadata: type: object spec: - description: Spec is the specification of the Kuma TrafficTrace resource. + description: Spec is the specification of the Kuma ExternalService resource. x-kubernetes-preserve-unknown-fields: true type: object served: true @@ -7278,16 +7411,16 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: externalservices.kuma.io + name: traffictraces.kuma.io spec: group: kuma.io names: categories: - kuma - kind: ExternalService - listKind: ExternalServiceList - plural: externalservices - singular: externalservice + kind: TrafficTrace + listKind: TrafficTraceList + plural: traffictraces + singular: traffictrace scope: Cluster versions: - name: v1alpha1 @@ -7317,7 +7450,7 @@ spec: metadata: type: object spec: - description: Spec is the specification of the Kuma ExternalService resource. + description: Spec is the specification of the Kuma TrafficTrace resource. x-kubernetes-preserve-unknown-fields: true type: object served: true @@ -9314,6 +9447,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -9493,7 +9627,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -9694,6 +9828,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -9750,6 +9885,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -9879,6 +10015,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.global.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.global.golden.yaml index 8df98c78c468..cc0cb45f44cf 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.global.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.global.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -396,7 +397,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 3c1990a88ba7b4d999513b943b274a3fd08d57346a2aecfcd33ed3571a2077c0 + checksum/tls-secrets: 2a84a7cc2a2b85f287088eb783e06d01299acf9e477025ccb7de1c73a981f7f7 labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -589,6 +590,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -645,6 +647,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -720,6 +723,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.override-env-vars.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.override-env-vars.golden.yaml index 0e06fb3f61e2..a4777b0811f9 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.override-env-vars.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.override-env-vars.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -574,6 +575,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -630,6 +632,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -759,6 +762,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.overrides.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.overrides.golden.yaml index a47f12fc12d3..e81cbfb01e61 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.overrides.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.overrides.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: 154c47a95fc93687dd1e825cea7f843d0fe8c450f82014d27cd7eb1a49f3bd35 - checksum/tls-secrets: e34142b1733c18f9055c82ad6f9a159712146b466faa38931d19e3844a7fcc98 + checksum/tls-secrets: b306fe4f07c55c729889ca893637e082e80b837748bb0121bcbaa8fee4c9ead8 labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -607,6 +608,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -663,6 +665,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -792,6 +795,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.registry.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.registry.golden.yaml index 059c62369a61..8dee375991ec 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.registry.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.registry.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -574,6 +575,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -630,6 +632,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -759,6 +762,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.tproxy-ebpf-experimental-enabled.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.tproxy-ebpf-experimental-enabled.golden.yaml index 90d0ca38c95a..b97b91b337fc 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.tproxy-ebpf-experimental-enabled.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.tproxy-ebpf-experimental-enabled.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -584,6 +585,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -640,6 +642,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -769,6 +772,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.with-egress.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.with-egress.golden.yaml index 46a5bb696ef2..9602ceec98b4 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.with-egress.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.with-egress.golden.yaml @@ -211,6 +211,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -411,7 +412,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -734,6 +735,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -790,6 +792,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -919,6 +922,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml index f767b1779d6b..76de4608b970 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml @@ -3718,6 +3718,139 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: meshmultizoneservices.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: MeshMultiZoneService + listKind: MeshMultiZoneServiceList + plural: meshmultizoneservices + singular: meshmultizoneservice + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService + resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by + labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -6288,6 +6421,76 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: dataplanes.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: Dataplane + listKind: DataplaneList + plural: dataplanes + singular: dataplane + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Service tag of the first inbound + jsonPath: .spec.networking.inbound[0].tags['kuma\.io/service'] + name: kuma.io/service + type: string + - description: Service tag of the second inbound + jsonPath: .spec.networking.inbound[1].tags['kuma\.io/service'] + name: kuma.io/service + type: string + - description: Service tag of the third inbound + jsonPath: .spec.networking.inbound[2].tags['kuma\.io/service'] + name: kuma.io/service + priority: 1 + type: string + - description: Service tag of the fourth inbound + jsonPath: .spec.networking.inbound[3].tags['kuma\.io/service'] + name: kuma.io/service + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + mesh: + description: |- + Mesh is the name of the Kuma mesh this resource belongs to. + It may be omitted for cluster-scoped resources. + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma Dataplane resource. + x-kubernetes-preserve-unknown-fields: true + type: object + served: true + storage: true + subresources: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -6572,76 +6775,6 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.14.0 - name: dataplanes.kuma.io -spec: - group: kuma.io - names: - categories: - - kuma - kind: Dataplane - listKind: DataplaneList - plural: dataplanes - singular: dataplane - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: Service tag of the first inbound - jsonPath: .spec.networking.inbound[0].tags['kuma\.io/service'] - name: kuma.io/service - type: string - - description: Service tag of the second inbound - jsonPath: .spec.networking.inbound[1].tags['kuma\.io/service'] - name: kuma.io/service - type: string - - description: Service tag of the third inbound - jsonPath: .spec.networking.inbound[2].tags['kuma\.io/service'] - name: kuma.io/service - priority: 1 - type: string - - description: Service tag of the fourth inbound - jsonPath: .spec.networking.inbound[3].tags['kuma\.io/service'] - name: kuma.io/service - priority: 1 - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - mesh: - description: |- - Mesh is the name of the Kuma mesh this resource belongs to. - It may be omitted for cluster-scoped resources. - type: string - metadata: - type: object - spec: - description: Spec is the specification of the Kuma Dataplane resource. - x-kubernetes-preserve-unknown-fields: true - type: object - served: true - storage: true - subresources: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 @@ -7248,16 +7381,16 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: traffictraces.kuma.io + name: externalservices.kuma.io spec: group: kuma.io names: categories: - kuma - kind: TrafficTrace - listKind: TrafficTraceList - plural: traffictraces - singular: traffictrace + kind: ExternalService + listKind: ExternalServiceList + plural: externalservices + singular: externalservice scope: Cluster versions: - name: v1alpha1 @@ -7287,7 +7420,7 @@ spec: metadata: type: object spec: - description: Spec is the specification of the Kuma TrafficTrace resource. + description: Spec is the specification of the Kuma ExternalService resource. x-kubernetes-preserve-unknown-fields: true type: object served: true @@ -7298,16 +7431,16 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: externalservices.kuma.io + name: traffictraces.kuma.io spec: group: kuma.io names: categories: - kuma - kind: ExternalService - listKind: ExternalServiceList - plural: externalservices - singular: externalservice + kind: TrafficTrace + listKind: TrafficTraceList + plural: traffictraces + singular: traffictrace scope: Cluster versions: - name: v1alpha1 @@ -7337,7 +7470,7 @@ spec: metadata: type: object spec: - description: Spec is the specification of the Kuma ExternalService resource. + description: Spec is the specification of the Kuma TrafficTrace resource. x-kubernetes-preserve-unknown-fields: true type: object served: true @@ -9334,6 +9467,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -9555,7 +9689,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -10013,6 +10147,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -10069,6 +10204,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -10198,6 +10334,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-values.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-values.yaml index e5397b7d8425..f96abb1b4850 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-values.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-values.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -574,6 +575,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -630,6 +632,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -759,6 +762,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.with-ingress.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.with-ingress.golden.yaml index 171c4cc07092..f529c5b96138 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.with-ingress.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.with-ingress.golden.yaml @@ -211,6 +211,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -411,7 +412,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -740,6 +741,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -796,6 +798,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -925,6 +928,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.zone.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.zone.golden.yaml index 16c15eb27f6f..c8125723b629 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.zone.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.zone.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -578,6 +579,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -634,6 +636,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -763,6 +766,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/doNotChangeTlsChecksum.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/doNotChangeTlsChecksum.golden.yaml index 77506f4a273f..7e75b281b0c1 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/doNotChangeTlsChecksum.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/doNotChangeTlsChecksum.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -573,6 +574,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -629,6 +631,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -758,6 +761,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/empty.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/empty.golden.yaml index 881391fecc6a..fa82ff20aa95 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/empty.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/empty.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -574,6 +575,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -630,6 +632,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -759,6 +762,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/fix4485.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/fix4485.golden.yaml index 757ea2d501be..3b142c136108 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/fix4485.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/fix4485.golden.yaml @@ -218,6 +218,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -402,7 +403,7 @@ spec: metadata: annotations: checksum/config: 3a137bbfcbbe6ba5a3997b30b1b047b2b080a9f912520a5fa683f11c4c6b6f3c - checksum/tls-secrets: c0c93e423d02879e6eb230522838fee82c6d0a4e8fe2accf616ab8abb56cfc03 + checksum/tls-secrets: 8273613770030cf2dae5a42658c8ca8ae0585164eeacbfe9f59a1483379583d8 labels: app: kuma-control-plane "foo": "baz" @@ -604,6 +605,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -660,6 +662,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -790,6 +793,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/fix4496.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/fix4496.golden.yaml index 26ff7bceeef6..81afde476e81 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/fix4496.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/fix4496.golden.yaml @@ -215,6 +215,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -421,7 +422,7 @@ spec: metadata: annotations: checksum/config: 2f553eadd8f68661f4b1fd0b3ccbbc562943d89fa76f2f2ba2975541290fda71 - checksum/tls-secrets: 3cccee2bb8a9ba05a981cfa791b17920170cd76061efc699a2f6c379c86052e6 + checksum/tls-secrets: 724593ef6bb4c85967f3ab60372dd4e95fd3ca1edd8ecc16b50db9a7b648c9be labels: app: kuma-control-plane "foo": "bar" @@ -778,6 +779,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -834,6 +836,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -964,6 +967,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/fix4935.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/fix4935.golden.yaml index e3cf18c0486e..454a8b8abb49 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/fix4935.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/fix4935.golden.yaml @@ -276,6 +276,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -664,7 +665,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f bim: "bam" foo: "{\"bar\": \"baz\"}" labels: @@ -1160,6 +1161,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -1216,6 +1218,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -1345,6 +1348,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/fix5978.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/fix5978.golden.yaml index cba1e598f602..7a9c20366528 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/fix5978.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/fix5978.golden.yaml @@ -221,6 +221,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -442,7 +443,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -903,6 +904,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -959,6 +961,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -1088,6 +1091,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/fix7724.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/fix7724.golden.yaml index e02ede11d368..c6834e1acf03 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/fix7724.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/fix7724.golden.yaml @@ -204,6 +204,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -383,7 +384,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -577,6 +578,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -633,6 +635,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -762,6 +765,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/fix7824.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/fix7824.golden.yaml index ba11a33a9f5c..283d3d9504f5 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/fix7824.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/fix7824.golden.yaml @@ -236,6 +236,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -457,7 +458,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -978,6 +979,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -1034,6 +1036,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -1163,6 +1166,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/minReadySeconds.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/minReadySeconds.golden.yaml index 7c7534bf7494..3a8de1f9594b 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/minReadySeconds.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/minReadySeconds.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -574,6 +575,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -630,6 +632,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -759,6 +762,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-cp-helm/securityContext.golden.yaml b/app/kumactl/cmd/install/testdata/install-cp-helm/securityContext.golden.yaml index 03191ce13c45..49c37021885d 100644 --- a/app/kumactl/cmd/install/testdata/install-cp-helm/securityContext.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-cp-helm/securityContext.golden.yaml @@ -201,6 +201,7 @@ rules: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices verbs: - get @@ -380,7 +381,7 @@ spec: metadata: annotations: checksum/config: fd9d1d8386f97f2bd49e50f476520816168a1c9f60bbc43dec1347a64d239155 - checksum/tls-secrets: 31d2a666f62aa9bb7ed631b29dea95b3e82e47e9f490fb976200767f51185f14 + checksum/tls-secrets: ab74ff424a21b080a396ffabd259f04ce845bd0c206dbf7d89e579358f934c0f labels: app: kuma-control-plane app.kubernetes.io/name: kuma @@ -575,6 +576,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices sideEffects: None - name: owner-reference.kuma-admission.kuma.io @@ -631,6 +633,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices @@ -760,6 +763,7 @@ webhooks: - meshtrafficpermissions - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices diff --git a/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml b/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml index 85a5590b5441..e1b97a590925 100644 --- a/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml @@ -5245,6 +5245,139 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: meshmultizoneservices.kuma.io +spec: + group: kuma.io + names: + categories: + - kuma + kind: MeshMultiZoneService + listKind: MeshMultiZoneServiceList + plural: meshmultizoneservices + singular: meshmultizoneservice + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec is the specification of the Kuma MeshMultiZoneService + resource. + properties: + selector: + description: Selector is a way to select multiple MeshServices + properties: + meshService: + description: MeshService selects MeshServices + properties: + matchLabels: + additionalProperties: + type: string + description: MatchLabels matches multiple MeshServices by + labels + type: object + required: + - matchLabels + type: object + required: + - meshService + type: object + required: + - selector + type: object + status: + description: Status is the current status of the Kuma MeshMultiZoneService + resource. + properties: + addresses: + description: Addresses is a list of addresses generated by HostnameGenerator + items: + properties: + hostname: + type: string + hostnameGeneratorRef: + properties: + coreName: + type: string + required: + - coreName + type: object + origin: + type: string + type: object + type: array + meshServices: + description: MeshServices is a list of matched MeshServices + items: + properties: + name: + description: Name is a core name of MeshService + type: string + required: + - name + type: object + type: array + ports: + description: Ports is an aggregated distinct list of ports from selected + MeshServices + items: + properties: + appProtocol: + default: tcp + description: Protocol identifies a protocol supported by a service. + type: string + name: + type: string + port: + format: int32 + type: integer + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: array + vips: + description: VIPs is a list of assigned Kuma VIPs. + items: + properties: + ip: + type: string + type: object + type: array + required: + - meshServices + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 diff --git a/pkg/api-server/testdata/base_endpoints/_resources.golden.json b/pkg/api-server/testdata/base_endpoints/_resources.golden.json index 70cbaf2a7007..02e8225c4f63 100644 --- a/pkg/api-server/testdata/base_endpoints/_resources.golden.json +++ b/pkg/api-server/testdata/base_endpoints/_resources.golden.json @@ -235,6 +235,15 @@ "scope": "Mesh", "singularDisplayName": "Mesh Metric" }, + { + "includeInFederation": true, + "name": "MeshMultiZoneService", + "path": "meshmultizoneservices", + "pluralDisplayName": "Mesh Multi Zone Services", + "readOnly": false, + "scope": "Mesh", + "singularDisplayName": "Mesh Multi Zone Service" + }, { "includeInFederation": true, "name": "MeshPassthrough", diff --git a/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml b/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml index f363daf4d8b0..5663fb6554be 100644 --- a/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml +++ b/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml @@ -797,6 +797,7 @@ coreResources: enabled: # ENV: KUMA_CORE_RESOURCES_ENABLED - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices # IP address management configuration ipam: diff --git a/pkg/kds/server/server_test.go b/pkg/kds/server/server_test.go index 16b78456cc44..f02737ec2b8a 100644 --- a/pkg/kds/server/server_test.go +++ b/pkg/kds/server/server_test.go @@ -63,7 +63,7 @@ var _ = Describe("KDS Server", func() { ctx := context.Background() // Do not forget to update this test after updating protobuf `KumaKdsOptions`. Expect(registry.Global().ObjectTypes(model.HasKdsEnabled())). - To(HaveLen(44)) // old policies plus plugins + To(HaveLen(45)) // old policies plus plugins vrf := kds_verifier.New(). // NOTE: The resources all have to be created before any DiscoveryRequests are made. From dc587aad2011a740ebdcd54074d2b43f26eaeb14 Mon Sep 17 00:00:00 2001 From: Jakub Dyszkiewicz Date: Wed, 26 Jun 2024 15:19:36 +0200 Subject: [PATCH 3/3] update omitempty Signed-off-by: Jakub Dyszkiewicz --- .../install/testdata/install-control-plane.defaults.golden.yaml | 2 -- .../testdata/install-control-plane.gateway-api-present.yaml | 2 -- .../install/testdata/install-control-plane.with-helm-set.yaml | 2 -- app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml | 2 -- deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml | 2 -- docs/generated/openapi.yaml | 2 -- docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml | 2 -- docs/generated/raw/kuma-cp.yaml | 1 + .../meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go | 2 +- .../apis/meshmultizoneservice/api/v1alpha1/schema.yaml | 2 -- .../k8s/crd/kuma.io_meshmultizoneservices.yaml | 2 -- 11 files changed, 2 insertions(+), 19 deletions(-) diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml index 165daa737240..2f995ec7ae7c 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml @@ -3822,8 +3822,6 @@ spec: type: string type: object type: array - required: - - meshServices type: object type: object served: true diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml index f2bdb007620b..a35553af7409 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml @@ -3822,8 +3822,6 @@ spec: type: string type: object type: array - required: - - meshServices type: object type: object served: true diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml index 76de4608b970..eaef01a74ffe 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml @@ -3842,8 +3842,6 @@ spec: type: string type: object type: array - required: - - meshServices type: object type: object served: true diff --git a/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml b/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml index e1b97a590925..409a24562e2d 100644 --- a/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml @@ -5369,8 +5369,6 @@ spec: type: string type: object type: array - required: - - meshServices type: object type: object served: true diff --git a/deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml b/deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml index 6ca06036f60f..90869bfc0c05 100644 --- a/deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml +++ b/deployments/charts/kuma/crds/kuma.io_meshmultizoneservices.yaml @@ -125,8 +125,6 @@ spec: type: string type: object type: array - required: - - meshServices type: object type: object served: true diff --git a/docs/generated/openapi.yaml b/docs/generated/openapi.yaml index b93ac88eb272..27dd6300d628 100644 --- a/docs/generated/openapi.yaml +++ b/docs/generated/openapi.yaml @@ -11139,8 +11139,6 @@ components: type: string type: object type: array - required: - - meshServices type: object MeshMultiZoneServiceCreateOrUpdateSuccessResponse: type: object diff --git a/docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml b/docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml index 6ca06036f60f..90869bfc0c05 100644 --- a/docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml +++ b/docs/generated/raw/crds/kuma.io_meshmultizoneservices.yaml @@ -125,8 +125,6 @@ spec: type: string type: object type: array - required: - - meshServices type: object type: object served: true diff --git a/docs/generated/raw/kuma-cp.yaml b/docs/generated/raw/kuma-cp.yaml index f363daf4d8b0..5663fb6554be 100644 --- a/docs/generated/raw/kuma-cp.yaml +++ b/docs/generated/raw/kuma-cp.yaml @@ -797,6 +797,7 @@ coreResources: enabled: # ENV: KUMA_CORE_RESOURCES_ENABLED - hostnamegenerators - meshexternalservices + - meshmultizoneservices - meshservices # IP address management configuration ipam: diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go index 22737ca77cab..34ada2c495bd 100644 --- a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/meshmultizoneservice.go @@ -33,7 +33,7 @@ type MeshMultiZoneServiceStatus struct { // VIPs is a list of assigned Kuma VIPs. VIPs []meshservice_api.VIP `json:"vips,omitempty"` // MeshServices is a list of matched MeshServices - MeshServices []MatchedMeshService `json:"meshServices"` + MeshServices []MatchedMeshService `json:"meshServices,omitempty"` } type MatchedMeshService struct { diff --git a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml index 74bc4f58b7c6..f7ba62ee173d 100644 --- a/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml +++ b/pkg/core/resources/apis/meshmultizoneservice/api/v1alpha1/schema.yaml @@ -102,6 +102,4 @@ properties: type: string type: object type: array - required: - - meshServices type: object diff --git a/pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml b/pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml index 6ca06036f60f..90869bfc0c05 100644 --- a/pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml +++ b/pkg/core/resources/apis/meshmultizoneservice/k8s/crd/kuma.io_meshmultizoneservices.yaml @@ -125,8 +125,6 @@ spec: type: string type: object type: array - required: - - meshServices type: object type: object served: true