From a83c20f58382bbd3d8ad84ac138e3a647d4bb58f Mon Sep 17 00:00:00 2001 From: Mike Beaumont Date: Fri, 5 Nov 2021 13:34:54 +0100 Subject: [PATCH 1/3] feat(gateway) add Gateway types to k8s store Signed-off-by: Mike Beaumont --- .../cmd/install/install_control_plane.go | 8 ++ app/kumactl/cmd/install/install_crds.go | 8 ++ app/kumactl/cmd/install/render_helm_files.go | 75 +++++++++++++++---- deployments/charts/kuma/crds/gateways.yaml | 27 +++++++ .../charts/kuma/templates/cp-rbac.yaml | 12 +++ .../k8s/native/api/v1alpha1/gateway.go | 27 +++++++ .../k8s/native/api/v1alpha1/gateway_types.go | 27 +++++++ .../api/v1alpha1/gateway_types_helpers.go | 43 +++++++++++ .../api/v1alpha1/zz_generated.deepcopy.go | 58 ++++++++++++++ .../config/crd/bases/kuma.io_gateways.yaml | 27 +++++++ .../k8s/native/config/rbac/role.yaml | 12 +++ .../resources/k8s/native/controllers/doc.go | 2 + 12 files changed, 312 insertions(+), 14 deletions(-) create mode 100644 deployments/charts/kuma/crds/gateways.yaml create mode 100644 pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go create mode 100644 pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types.go create mode 100644 pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types_helpers.go create mode 100644 pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gateways.yaml diff --git a/app/kumactl/cmd/install/install_control_plane.go b/app/kumactl/cmd/install/install_control_plane.go index 270b0e854cd3..00acd40f554b 100644 --- a/app/kumactl/cmd/install/install_control_plane.go +++ b/app/kumactl/cmd/install/install_control_plane.go @@ -12,6 +12,7 @@ import ( "github.com/kumahq/kuma/app/kumactl/pkg/install/k8s" kuma_cmd "github.com/kumahq/kuma/pkg/cmd" "github.com/kumahq/kuma/pkg/config/core" + bootstrap_k8s "github.com/kumahq/kuma/pkg/plugins/bootstrap/k8s" ) type componentVersion struct { @@ -72,6 +73,13 @@ This command requires that the KUBECONFIG environment is set`, return errors.Wrap(err, "Failed to read template files") } + scheme, err := bootstrap_k8s.NewScheme() + if err != nil { + return err + } + + templateFiles = filterHelmTemplates(scheme, templateFiles) + renderedFiles, err := renderHelmFiles(templateFiles, args, args.Namespace, ctx.HELMValuesPrefix, kubeClientConfig) if err != nil { return errors.Wrap(err, "Failed to render helm template files") diff --git a/app/kumactl/cmd/install/install_crds.go b/app/kumactl/cmd/install/install_crds.go index f1c9c8223a53..2c1f31afaeda 100644 --- a/app/kumactl/cmd/install/install_crds.go +++ b/app/kumactl/cmd/install/install_crds.go @@ -13,6 +13,7 @@ import ( install_context "github.com/kumahq/kuma/app/kumactl/cmd/install/context" "github.com/kumahq/kuma/app/kumactl/pkg/install/data" "github.com/kumahq/kuma/app/kumactl/pkg/install/k8s" + bootstrap_k8s "github.com/kumahq/kuma/pkg/plugins/bootstrap/k8s" ) func newInstallCrdsCmd(ctx *install_context.InstallCrdsContext) *cobra.Command { @@ -27,6 +28,13 @@ func newInstallCrdsCmd(ctx *install_context.InstallCrdsContext) *cobra.Command { return errors.Wrap(err, "Failed to read CRD files") } + scheme, err := bootstrap_k8s.NewScheme() + if err != nil { + return err + } + + wantCrdFiles = filterHelmTemplates(scheme, wantCrdFiles) + if !args.OnlyMissing { singleFile := data.JoinYAML(wantCrdFiles) diff --git a/app/kumactl/cmd/install/render_helm_files.go b/app/kumactl/cmd/install/render_helm_files.go index f5618fbd7ee6..7bfca85d696a 100644 --- a/app/kumactl/cmd/install/render_helm_files.go +++ b/app/kumactl/cmd/install/render_helm_files.go @@ -8,15 +8,60 @@ import ( "strings" "github.com/pkg/errors" + "gopkg.in/yaml.v2" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart/loader" "helm.sh/helm/v3/pkg/chartutil" "helm.sh/helm/v3/pkg/engine" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + kube_runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/rest" "github.com/kumahq/kuma/app/kumactl/pkg/install/data" ) +func unregisteredCRD(scheme *kube_runtime.Scheme, chartFile *data.File) bool { + types := scheme.AllKnownTypes() + + if !strings.HasPrefix(chartFile.FullPath, "crds/") { + return false + } + + var crdRes apiextensionsv1.CustomResourceDefinition + + if err := yaml.Unmarshal(chartFile.Data, &crdRes); err != nil { + return false + } + + for _, v := range crdRes.Spec.Versions { + gvk := schema.GroupVersionKind{ + Group: crdRes.Spec.Group, + Version: v.Name, + Kind: crdRes.Spec.Names.Kind, + } + if _, ok := types[gvk]; ok { + return false + } + } + + return true +} + +func filterHelmTemplates(scheme *kube_runtime.Scheme, files data.FileList) data.FileList { + var filteredFiles data.FileList + + for _, file := range files { + if unregisteredCRD(scheme, &file) { + continue + } + + filteredFiles = append(filteredFiles, file) + } + + return filteredFiles +} + func labelRegex(label string) *regexp.Regexp { return regexp.MustCompile("(?m)[\r\n]+^.*" + label + ".*$") } @@ -45,43 +90,45 @@ func renderHelmFiles( helmValuesPrefix string, kubeClientConfig *rest.Config, ) ([]data.File, error) { - chart, err := loadCharts(templates) + kumaChart, err := loadCharts(templates) if err != nil { return nil, errors.Errorf("Failed to load charts: %s", err) } overrideValues := generateOverrideValues(args, helmValuesPrefix) - if err := chartutil.ProcessDependencies(chart, overrideValues); err != nil { + + if err := chartutil.ProcessDependencies(kumaChart, overrideValues); err != nil { return nil, errors.Errorf("Failed to process dependencies: %s", err) } - options := generateReleaseOptions(chart.Metadata.Name, namespace) + options := generateReleaseOptions(kumaChart.Metadata.Name, namespace) - valuesToRender, err := chartutil.ToRenderValues(chart, overrideValues, options, nil) + valuesToRender, err := chartutil.ToRenderValues(kumaChart, overrideValues, options, nil) if err != nil { return nil, errors.Errorf("Failed to render values: %s", err) } var files map[string]string if kubeClientConfig == nil { - files, err = engine.Render(chart, valuesToRender) + files, err = engine.Render(kumaChart, valuesToRender) } else { - files, err = engine.RenderWithClient(chart, valuesToRender, kubeClientConfig) + files, err = engine.RenderWithClient(kumaChart, valuesToRender, kubeClientConfig) } if err != nil { return nil, errors.Errorf("Failed to render templates: %s", err) } files["namespace.yaml"] = kumaSystemNamespace(namespace) - return postRender(chart, files), nil + return postRender(kumaChart, files), nil } func loadCharts(templates []data.File) (*chart.Chart, error) { - files := []*loader.BufferedFile{} - for _, f := range templates { + var files []*loader.BufferedFile + + for _, template := range templates { files = append(files, &loader.BufferedFile{ - Name: f.FullPath, - Data: f.Data, + Name: template.FullPath, + Data: template.Data, }) } @@ -123,9 +170,9 @@ func generateOverrideValues(args interface{}, helmValuesPrefix string) map[strin } if helmValuesPrefix != "" { - prefixed := map[string]interface{}{} - prefixed[helmValuesPrefix] = overrideValues - return prefixed + return map[string]interface{}{ + helmValuesPrefix: overrideValues, + } } return overrideValues diff --git a/deployments/charts/kuma/crds/gateways.yaml b/deployments/charts/kuma/crds/gateways.yaml new file mode 100644 index 000000000000..eb425b495c1c --- /dev/null +++ b/deployments/charts/kuma/crds/gateways.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: gateways.kuma.io +spec: + group: kuma.io + names: + kind: Gateway + plural: gateways + scope: Namespaced + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: Gateway is the Schema for the gateway API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object + diff --git a/deployments/charts/kuma/templates/cp-rbac.yaml b/deployments/charts/kuma/templates/cp-rbac.yaml index 4d75597dbf60..2749c41a0934 100644 --- a/deployments/charts/kuma/templates/cp-rbac.yaml +++ b/deployments/charts/kuma/templates/cp-rbac.yaml @@ -89,6 +89,18 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go new file mode 100644 index 000000000000..13dcfb02c08a --- /dev/null +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go @@ -0,0 +1,27 @@ +//go:build gateway +// +build gateway + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1" + "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/registry" +) + +func init() { + SchemeBuilder.Register(&Gateway{}, &GatewayList{}) + registry.RegisterObjectType(&mesh_proto.Gateway{}, &Gateway{ + TypeMeta: metav1.TypeMeta{ + APIVersion: GroupVersion.String(), + Kind: "Gateway", + }, + }) + registry.RegisterListType(&mesh_proto.Gateway{}, &GatewayList{ + TypeMeta: metav1.TypeMeta{ + APIVersion: GroupVersion.String(), + Kind: "GatewayList", + }, + }) +} diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types.go new file mode 100644 index 000000000000..95ac2548ac00 --- /dev/null +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types.go @@ -0,0 +1,27 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/model" +) + +// Gateway is the Schema for the Gateway. +// +// +kubebuilder:object:root=true +type Gateway struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Mesh string `json:"mesh,omitempty"` + Spec model.RawMessage `json:"spec,omitempty"` +} + +// GatewayList contains a list of Gateways. +// +// +kubebuilder:object:root=true +type GatewayList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Gateway `json:"items"` +} diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types_helpers.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types_helpers.go new file mode 100644 index 000000000000..655e400614db --- /dev/null +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_types_helpers.go @@ -0,0 +1,43 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/model" +) + +func (pt *Gateway) GetObjectMeta() *metav1.ObjectMeta { + return &pt.ObjectMeta +} + +func (pt *Gateway) SetObjectMeta(m *metav1.ObjectMeta) { + pt.ObjectMeta = *m +} + +func (pt *Gateway) GetMesh() string { + return pt.Mesh +} + +func (pt *Gateway) SetMesh(mesh string) { + pt.Mesh = mesh +} + +func (pt *Gateway) GetSpec() map[string]interface{} { + return pt.Spec +} + +func (pt *Gateway) SetSpec(spec map[string]interface{}) { + pt.Spec = spec +} + +func (pt *Gateway) Scope() model.Scope { + return model.ScopeNamespace +} + +func (l *GatewayList) GetItems() []model.KubernetesObject { + result := make([]model.KubernetesObject, len(l.Items)) + for i := range l.Items { + result[i] = &l.Items[i] + } + return result +} diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go index 17eca515543d..3863af8d99c6 100644 --- a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go @@ -314,6 +314,64 @@ func (in *FaultInjectionList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Gateway) DeepCopyInto(out *Gateway) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway. +func (in *Gateway) DeepCopy() *Gateway { + if in == nil { + return nil + } + out := new(Gateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Gateway) 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 *GatewayList) DeepCopyInto(out *GatewayList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Gateway, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList. +func (in *GatewayList) DeepCopy() *GatewayList { + if in == nil { + return nil + } + out := new(GatewayList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayList) 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 *HealthCheck) DeepCopyInto(out *HealthCheck) { *out = *in diff --git a/pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gateways.yaml b/pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gateways.yaml new file mode 100644 index 000000000000..eb425b495c1c --- /dev/null +++ b/pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gateways.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: gateways.kuma.io +spec: + group: kuma.io + names: + kind: Gateway + plural: gateways + scope: Namespaced + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: Gateway is the Schema for the gateway API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object + diff --git a/pkg/plugins/resources/k8s/native/config/rbac/role.yaml b/pkg/plugins/resources/k8s/native/config/rbac/role.yaml index 88f144721fa7..5da5fa952bcd 100644 --- a/pkg/plugins/resources/k8s/native/config/rbac/role.yaml +++ b/pkg/plugins/resources/k8s/native/config/rbac/role.yaml @@ -46,6 +46,18 @@ rules: - patch - update - watch +- apiGroups: + - kuma.io + resources: + - gateways + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - kuma.io resources: diff --git a/pkg/plugins/resources/k8s/native/controllers/doc.go b/pkg/plugins/resources/k8s/native/controllers/doc.go index 463d57763af9..88f5cb105026 100644 --- a/pkg/plugins/resources/k8s/native/controllers/doc.go +++ b/pkg/plugins/resources/k8s/native/controllers/doc.go @@ -14,3 +14,5 @@ package controllers // +kubebuilder:rbac:groups=kuma.io,resources=retries,verbs=get;list;watch // +kubebuilder:rbac:groups=kuma.io,resources=proxytemplates,verbs=get;list;watch;create;update;patch;delete + +// +kubebuilder:rbac:groups=kuma.io,resources=gateways,verbs=get;list;watch;create;update;patch;delete From f7c7064af74b6cc1a114bdfc33caf70f48cbc777 Mon Sep 17 00:00:00 2001 From: Mike Beaumont Date: Mon, 8 Nov 2021 19:05:50 +0100 Subject: [PATCH 2/3] feat(gateway) add GatewayRoutes to k8s Signed-off-by: Mike Beaumont --- .../charts/kuma/crds/gateway-routes.yaml | 27 +++++++++ .../charts/kuma/templates/cp-rbac.yaml | 1 + .../k8s/native/api/v1alpha1/gateway.go | 14 +++++ .../api/v1alpha1/gateway_route_types.go | 27 +++++++++ .../v1alpha1/gateway_route_types_helpers.go | 43 ++++++++++++++ .../api/v1alpha1/zz_generated.deepcopy.go | 58 +++++++++++++++++++ .../crd/bases/kuma.io_gatewayroutes.yaml | 27 +++++++++ .../k8s/native/config/rbac/role.yaml | 12 ++++ .../resources/k8s/native/controllers/doc.go | 1 + 9 files changed, 210 insertions(+) create mode 100644 deployments/charts/kuma/crds/gateway-routes.yaml create mode 100644 pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types.go create mode 100644 pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types_helpers.go create mode 100644 pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gatewayroutes.yaml diff --git a/deployments/charts/kuma/crds/gateway-routes.yaml b/deployments/charts/kuma/crds/gateway-routes.yaml new file mode 100644 index 000000000000..d2fb859ebf25 --- /dev/null +++ b/deployments/charts/kuma/crds/gateway-routes.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: gatewayroutes.kuma.io +spec: + group: kuma.io + names: + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: GatewayRoute is the Schema for the gatewayroutes API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object + diff --git a/deployments/charts/kuma/templates/cp-rbac.yaml b/deployments/charts/kuma/templates/cp-rbac.yaml index 2749c41a0934..9370bc9bd8d2 100644 --- a/deployments/charts/kuma/templates/cp-rbac.yaml +++ b/deployments/charts/kuma/templates/cp-rbac.yaml @@ -93,6 +93,7 @@ rules: - kuma.io resources: - gateways + - gatewayroutes verbs: - get - list diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go index 13dcfb02c08a..93e5d147bb79 100644 --- a/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway.go @@ -24,4 +24,18 @@ func init() { Kind: "GatewayList", }, }) + + SchemeBuilder.Register(&GatewayRoute{}, &GatewayRouteList{}) + registry.RegisterObjectType(&mesh_proto.GatewayRoute{}, &GatewayRoute{ + TypeMeta: metav1.TypeMeta{ + APIVersion: GroupVersion.String(), + Kind: "GatewayRoute", + }, + }) + registry.RegisterListType(&mesh_proto.GatewayRoute{}, &GatewayRouteList{ + TypeMeta: metav1.TypeMeta{ + APIVersion: GroupVersion.String(), + Kind: "GatewayRouteList", + }, + }) } diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types.go new file mode 100644 index 000000000000..776b4f633aeb --- /dev/null +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types.go @@ -0,0 +1,27 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/model" +) + +// GatewayRoute is the Schema for the GatewayRoute. +// +// +kubebuilder:object:root=true +type GatewayRoute struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Mesh string `json:"mesh,omitempty"` + Spec model.RawMessage `json:"spec,omitempty"` +} + +// GatewayRouteList contains a list of GatewayRoutes. +// +// +kubebuilder:object:root=true +type GatewayRouteList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GatewayRoute `json:"items"` +} diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types_helpers.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types_helpers.go new file mode 100644 index 000000000000..b794ac8a00d5 --- /dev/null +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/gateway_route_types_helpers.go @@ -0,0 +1,43 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/model" +) + +func (pt *GatewayRoute) GetObjectMeta() *metav1.ObjectMeta { + return &pt.ObjectMeta +} + +func (pt *GatewayRoute) SetObjectMeta(m *metav1.ObjectMeta) { + pt.ObjectMeta = *m +} + +func (pt *GatewayRoute) GetMesh() string { + return pt.Mesh +} + +func (pt *GatewayRoute) SetMesh(mesh string) { + pt.Mesh = mesh +} + +func (pt *GatewayRoute) GetSpec() map[string]interface{} { + return pt.Spec +} + +func (pt *GatewayRoute) SetSpec(spec map[string]interface{}) { + pt.Spec = spec +} + +func (pt *GatewayRoute) Scope() model.Scope { + return model.ScopeNamespace +} + +func (l *GatewayRouteList) GetItems() []model.KubernetesObject { + result := make([]model.KubernetesObject, len(l.Items)) + for i := range l.Items { + result[i] = &l.Items[i] + } + return result +} diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go index 3863af8d99c6..41d4bf7403f3 100644 --- a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go @@ -372,6 +372,64 @@ func (in *GatewayList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayRoute) DeepCopyInto(out *GatewayRoute) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayRoute. +func (in *GatewayRoute) DeepCopy() *GatewayRoute { + if in == nil { + return nil + } + out := new(GatewayRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayRoute) 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 *GatewayRouteList) DeepCopyInto(out *GatewayRouteList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GatewayRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayRouteList. +func (in *GatewayRouteList) DeepCopy() *GatewayRouteList { + if in == nil { + return nil + } + out := new(GatewayRouteList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayRouteList) 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 *HealthCheck) DeepCopyInto(out *HealthCheck) { *out = *in diff --git a/pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gatewayroutes.yaml b/pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gatewayroutes.yaml new file mode 100644 index 000000000000..d2fb859ebf25 --- /dev/null +++ b/pkg/plugins/resources/k8s/native/config/crd/bases/kuma.io_gatewayroutes.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: gatewayroutes.kuma.io +spec: + group: kuma.io + names: + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: GatewayRoute is the Schema for the gatewayroutes API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object + diff --git a/pkg/plugins/resources/k8s/native/config/rbac/role.yaml b/pkg/plugins/resources/k8s/native/config/rbac/role.yaml index 5da5fa952bcd..ae3143db54c3 100644 --- a/pkg/plugins/resources/k8s/native/config/rbac/role.yaml +++ b/pkg/plugins/resources/k8s/native/config/rbac/role.yaml @@ -46,6 +46,18 @@ rules: - patch - update - watch +- apiGroups: + - kuma.io + resources: + - gatewayroutes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - kuma.io resources: diff --git a/pkg/plugins/resources/k8s/native/controllers/doc.go b/pkg/plugins/resources/k8s/native/controllers/doc.go index 88f5cb105026..7946de2421a6 100644 --- a/pkg/plugins/resources/k8s/native/controllers/doc.go +++ b/pkg/plugins/resources/k8s/native/controllers/doc.go @@ -16,3 +16,4 @@ package controllers // +kubebuilder:rbac:groups=kuma.io,resources=proxytemplates,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=kuma.io,resources=gateways,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=kuma.io,resources=gatewayroutes,verbs=get;list;watch;create;update;patch;delete From 6372840e5376add2b8da3883b049c0160c0ceda5 Mon Sep 17 00:00:00 2001 From: Mike Beaumont Date: Tue, 9 Nov 2021 12:47:30 +0100 Subject: [PATCH 3/3] tests(install-control-plane) add new resources to golden files Signed-off-by: Mike Beaumont --- ...tall-control-plane.cni-enabled.golden.yaml | 145 +++++++++++++----- ...install-control-plane.defaults.golden.yaml | 145 +++++++++++++----- .../install-control-plane.global.golden.yaml | 145 +++++++++++++----- ...ontrol-plane.override-env-vars.golden.yaml | 145 +++++++++++++----- ...nstall-control-plane.overrides.golden.yaml | 145 +++++++++++++----- ...all-control-plane.with-ingress.golden.yaml | 145 +++++++++++++----- .../install-control-plane.zone.golden.yaml | 145 +++++++++++++----- .../testdata/install-crds.all.golden.yaml | 52 +++++++ 8 files changed, 787 insertions(+), 280 deletions(-) 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 7686bc935ab3..ddbf35c16752 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 @@ -120,6 +120,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: proxytemplates.kuma.io +spec: + group: kuma.io + names: + kind: ProxyTemplate + plural: proxytemplates + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ProxyTemplate is the Schema for the proxytemplates API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: ratelimits.kuma.io +spec: + group: kuma.io + names: + kind: RateLimit + plural: ratelimits + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: RateLimit is the Schema for the ratelimits API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: retries.kuma.io @@ -330,12 +382,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneingressinsights.kuma.io + name: dataplaneinsights.kuma.io spec: group: kuma.io names: - kind: ZoneIngressInsight - plural: zoneingressinsights + kind: DataplaneInsight + plural: dataplaneinsights scope: Namespaced versions: - name: v1alpha1 @@ -343,11 +395,11 @@ spec: storage: true schema: openAPIV3Schema: - description: ZoneIngressInsight is the Schema for the zone ingress insight API + description: DataplaneInsight is the Schema for the dataplane insights API properties: mesh: type: string - spec: + status: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -356,20 +408,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneinsights.kuma.io + name: zoneingressinsights.kuma.io spec: group: kuma.io names: - kind: ZoneInsight - plural: zoneinsights - scope: Cluster + kind: ZoneIngressInsight + plural: zoneingressinsights + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: ZoneInsight is the Schema for the zone insight API + description: ZoneIngressInsight is the Schema for the zone ingress insight API properties: mesh: type: string @@ -382,24 +434,24 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: dataplaneinsights.kuma.io + name: zoneinsights.kuma.io spec: group: kuma.io names: - kind: DataplaneInsight - plural: dataplaneinsights - scope: Namespaced + kind: ZoneInsight + plural: zoneinsights + scope: Cluster versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: DataplaneInsight is the Schema for the dataplane insights API + description: ZoneInsight is the Schema for the zone insight API properties: mesh: type: string - status: + spec: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -511,20 +563,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: healthchecks.kuma.io + name: gatewayroutes.kuma.io spec: group: kuma.io names: - kind: HealthCheck - plural: healthchecks - scope: Cluster + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: HealthCheck is the Schema for the healthchecks API + description: GatewayRoute is the Schema for the gatewayroutes API properties: mesh: type: string @@ -537,20 +589,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshinsights.kuma.io + name: gateways.kuma.io spec: group: kuma.io names: - kind: MeshInsight - plural: meshinsights - scope: Cluster + kind: Gateway + plural: gateways + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: MeshInsight is the Schema for the meshes insights API + description: Gateway is the Schema for the gateway API properties: mesh: type: string @@ -563,12 +615,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshes.kuma.io + name: healthchecks.kuma.io spec: group: kuma.io names: - kind: Mesh - plural: meshes + kind: HealthCheck + plural: healthchecks scope: Cluster versions: - name: v1alpha1 @@ -576,8 +628,10 @@ spec: storage: true schema: openAPIV3Schema: - description: Mesh is the Schema for the meshes API + description: HealthCheck is the Schema for the healthchecks API properties: + mesh: + type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -587,12 +641,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: proxytemplates.kuma.io + name: meshinsights.kuma.io spec: group: kuma.io names: - kind: ProxyTemplate - plural: proxytemplates + kind: MeshInsight + plural: meshinsights scope: Cluster versions: - name: v1alpha1 @@ -600,7 +654,7 @@ spec: storage: true schema: openAPIV3Schema: - description: ProxyTemplate is the Schema for the proxytemplates API + description: MeshInsight is the Schema for the meshes insights API properties: mesh: type: string @@ -613,12 +667,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: ratelimits.kuma.io + name: meshes.kuma.io spec: group: kuma.io names: - kind: RateLimit - plural: ratelimits + kind: Mesh + plural: meshes scope: Cluster versions: - name: v1alpha1 @@ -626,10 +680,8 @@ spec: storage: true schema: openAPIV3Schema: - description: RateLimit is the Schema for the ratelimits API + description: Mesh is the Schema for the meshes API properties: - mesh: - type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -736,6 +788,19 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + - gatewayroutes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: 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 1e912ce78c8e..addcc8c17934 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 @@ -84,6 +84,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: proxytemplates.kuma.io +spec: + group: kuma.io + names: + kind: ProxyTemplate + plural: proxytemplates + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ProxyTemplate is the Schema for the proxytemplates API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: ratelimits.kuma.io +spec: + group: kuma.io + names: + kind: RateLimit + plural: ratelimits + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: RateLimit is the Schema for the ratelimits API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: retries.kuma.io @@ -294,12 +346,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneingressinsights.kuma.io + name: dataplaneinsights.kuma.io spec: group: kuma.io names: - kind: ZoneIngressInsight - plural: zoneingressinsights + kind: DataplaneInsight + plural: dataplaneinsights scope: Namespaced versions: - name: v1alpha1 @@ -307,11 +359,11 @@ spec: storage: true schema: openAPIV3Schema: - description: ZoneIngressInsight is the Schema for the zone ingress insight API + description: DataplaneInsight is the Schema for the dataplane insights API properties: mesh: type: string - spec: + status: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -320,20 +372,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneinsights.kuma.io + name: zoneingressinsights.kuma.io spec: group: kuma.io names: - kind: ZoneInsight - plural: zoneinsights - scope: Cluster + kind: ZoneIngressInsight + plural: zoneingressinsights + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: ZoneInsight is the Schema for the zone insight API + description: ZoneIngressInsight is the Schema for the zone ingress insight API properties: mesh: type: string @@ -346,24 +398,24 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: dataplaneinsights.kuma.io + name: zoneinsights.kuma.io spec: group: kuma.io names: - kind: DataplaneInsight - plural: dataplaneinsights - scope: Namespaced + kind: ZoneInsight + plural: zoneinsights + scope: Cluster versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: DataplaneInsight is the Schema for the dataplane insights API + description: ZoneInsight is the Schema for the zone insight API properties: mesh: type: string - status: + spec: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -475,20 +527,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: healthchecks.kuma.io + name: gatewayroutes.kuma.io spec: group: kuma.io names: - kind: HealthCheck - plural: healthchecks - scope: Cluster + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: HealthCheck is the Schema for the healthchecks API + description: GatewayRoute is the Schema for the gatewayroutes API properties: mesh: type: string @@ -501,20 +553,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshinsights.kuma.io + name: gateways.kuma.io spec: group: kuma.io names: - kind: MeshInsight - plural: meshinsights - scope: Cluster + kind: Gateway + plural: gateways + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: MeshInsight is the Schema for the meshes insights API + description: Gateway is the Schema for the gateway API properties: mesh: type: string @@ -527,12 +579,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshes.kuma.io + name: healthchecks.kuma.io spec: group: kuma.io names: - kind: Mesh - plural: meshes + kind: HealthCheck + plural: healthchecks scope: Cluster versions: - name: v1alpha1 @@ -540,8 +592,10 @@ spec: storage: true schema: openAPIV3Schema: - description: Mesh is the Schema for the meshes API + description: HealthCheck is the Schema for the healthchecks API properties: + mesh: + type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -551,12 +605,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: proxytemplates.kuma.io + name: meshinsights.kuma.io spec: group: kuma.io names: - kind: ProxyTemplate - plural: proxytemplates + kind: MeshInsight + plural: meshinsights scope: Cluster versions: - name: v1alpha1 @@ -564,7 +618,7 @@ spec: storage: true schema: openAPIV3Schema: - description: ProxyTemplate is the Schema for the proxytemplates API + description: MeshInsight is the Schema for the meshes insights API properties: mesh: type: string @@ -577,12 +631,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: ratelimits.kuma.io + name: meshes.kuma.io spec: group: kuma.io names: - kind: RateLimit - plural: ratelimits + kind: Mesh + plural: meshes scope: Cluster versions: - name: v1alpha1 @@ -590,10 +644,8 @@ spec: storage: true schema: openAPIV3Schema: - description: RateLimit is the Schema for the ratelimits API + description: Mesh is the Schema for the meshes API properties: - mesh: - type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -683,6 +735,19 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + - gatewayroutes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: 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 d133c06e5d18..3dd6a6b793fc 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 @@ -84,6 +84,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: proxytemplates.kuma.io +spec: + group: kuma.io + names: + kind: ProxyTemplate + plural: proxytemplates + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ProxyTemplate is the Schema for the proxytemplates API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: ratelimits.kuma.io +spec: + group: kuma.io + names: + kind: RateLimit + plural: ratelimits + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: RateLimit is the Schema for the ratelimits API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: retries.kuma.io @@ -294,12 +346,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneingressinsights.kuma.io + name: dataplaneinsights.kuma.io spec: group: kuma.io names: - kind: ZoneIngressInsight - plural: zoneingressinsights + kind: DataplaneInsight + plural: dataplaneinsights scope: Namespaced versions: - name: v1alpha1 @@ -307,11 +359,11 @@ spec: storage: true schema: openAPIV3Schema: - description: ZoneIngressInsight is the Schema for the zone ingress insight API + description: DataplaneInsight is the Schema for the dataplane insights API properties: mesh: type: string - spec: + status: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -320,20 +372,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneinsights.kuma.io + name: zoneingressinsights.kuma.io spec: group: kuma.io names: - kind: ZoneInsight - plural: zoneinsights - scope: Cluster + kind: ZoneIngressInsight + plural: zoneingressinsights + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: ZoneInsight is the Schema for the zone insight API + description: ZoneIngressInsight is the Schema for the zone ingress insight API properties: mesh: type: string @@ -346,24 +398,24 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: dataplaneinsights.kuma.io + name: zoneinsights.kuma.io spec: group: kuma.io names: - kind: DataplaneInsight - plural: dataplaneinsights - scope: Namespaced + kind: ZoneInsight + plural: zoneinsights + scope: Cluster versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: DataplaneInsight is the Schema for the dataplane insights API + description: ZoneInsight is the Schema for the zone insight API properties: mesh: type: string - status: + spec: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -475,20 +527,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: healthchecks.kuma.io + name: gatewayroutes.kuma.io spec: group: kuma.io names: - kind: HealthCheck - plural: healthchecks - scope: Cluster + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: HealthCheck is the Schema for the healthchecks API + description: GatewayRoute is the Schema for the gatewayroutes API properties: mesh: type: string @@ -501,20 +553,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshinsights.kuma.io + name: gateways.kuma.io spec: group: kuma.io names: - kind: MeshInsight - plural: meshinsights - scope: Cluster + kind: Gateway + plural: gateways + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: MeshInsight is the Schema for the meshes insights API + description: Gateway is the Schema for the gateway API properties: mesh: type: string @@ -527,12 +579,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshes.kuma.io + name: healthchecks.kuma.io spec: group: kuma.io names: - kind: Mesh - plural: meshes + kind: HealthCheck + plural: healthchecks scope: Cluster versions: - name: v1alpha1 @@ -540,8 +592,10 @@ spec: storage: true schema: openAPIV3Schema: - description: Mesh is the Schema for the meshes API + description: HealthCheck is the Schema for the healthchecks API properties: + mesh: + type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -551,12 +605,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: proxytemplates.kuma.io + name: meshinsights.kuma.io spec: group: kuma.io names: - kind: ProxyTemplate - plural: proxytemplates + kind: MeshInsight + plural: meshinsights scope: Cluster versions: - name: v1alpha1 @@ -564,7 +618,7 @@ spec: storage: true schema: openAPIV3Schema: - description: ProxyTemplate is the Schema for the proxytemplates API + description: MeshInsight is the Schema for the meshes insights API properties: mesh: type: string @@ -577,12 +631,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: ratelimits.kuma.io + name: meshes.kuma.io spec: group: kuma.io names: - kind: RateLimit - plural: ratelimits + kind: Mesh + plural: meshes scope: Cluster versions: - name: v1alpha1 @@ -590,10 +644,8 @@ spec: storage: true schema: openAPIV3Schema: - description: RateLimit is the Schema for the ratelimits API + description: Mesh is the Schema for the meshes API properties: - mesh: - type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -683,6 +735,19 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + - gatewayroutes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: 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 5e5ded7bd3e7..f278cd8fdcae 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 @@ -84,6 +84,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: proxytemplates.kuma.io +spec: + group: kuma.io + names: + kind: ProxyTemplate + plural: proxytemplates + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ProxyTemplate is the Schema for the proxytemplates API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: ratelimits.kuma.io +spec: + group: kuma.io + names: + kind: RateLimit + plural: ratelimits + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: RateLimit is the Schema for the ratelimits API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: retries.kuma.io @@ -294,12 +346,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneingressinsights.kuma.io + name: dataplaneinsights.kuma.io spec: group: kuma.io names: - kind: ZoneIngressInsight - plural: zoneingressinsights + kind: DataplaneInsight + plural: dataplaneinsights scope: Namespaced versions: - name: v1alpha1 @@ -307,11 +359,11 @@ spec: storage: true schema: openAPIV3Schema: - description: ZoneIngressInsight is the Schema for the zone ingress insight API + description: DataplaneInsight is the Schema for the dataplane insights API properties: mesh: type: string - spec: + status: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -320,20 +372,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneinsights.kuma.io + name: zoneingressinsights.kuma.io spec: group: kuma.io names: - kind: ZoneInsight - plural: zoneinsights - scope: Cluster + kind: ZoneIngressInsight + plural: zoneingressinsights + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: ZoneInsight is the Schema for the zone insight API + description: ZoneIngressInsight is the Schema for the zone ingress insight API properties: mesh: type: string @@ -346,24 +398,24 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: dataplaneinsights.kuma.io + name: zoneinsights.kuma.io spec: group: kuma.io names: - kind: DataplaneInsight - plural: dataplaneinsights - scope: Namespaced + kind: ZoneInsight + plural: zoneinsights + scope: Cluster versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: DataplaneInsight is the Schema for the dataplane insights API + description: ZoneInsight is the Schema for the zone insight API properties: mesh: type: string - status: + spec: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -475,20 +527,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: healthchecks.kuma.io + name: gatewayroutes.kuma.io spec: group: kuma.io names: - kind: HealthCheck - plural: healthchecks - scope: Cluster + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: HealthCheck is the Schema for the healthchecks API + description: GatewayRoute is the Schema for the gatewayroutes API properties: mesh: type: string @@ -501,20 +553,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshinsights.kuma.io + name: gateways.kuma.io spec: group: kuma.io names: - kind: MeshInsight - plural: meshinsights - scope: Cluster + kind: Gateway + plural: gateways + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: MeshInsight is the Schema for the meshes insights API + description: Gateway is the Schema for the gateway API properties: mesh: type: string @@ -527,12 +579,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshes.kuma.io + name: healthchecks.kuma.io spec: group: kuma.io names: - kind: Mesh - plural: meshes + kind: HealthCheck + plural: healthchecks scope: Cluster versions: - name: v1alpha1 @@ -540,8 +592,10 @@ spec: storage: true schema: openAPIV3Schema: - description: Mesh is the Schema for the meshes API + description: HealthCheck is the Schema for the healthchecks API properties: + mesh: + type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -551,12 +605,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: proxytemplates.kuma.io + name: meshinsights.kuma.io spec: group: kuma.io names: - kind: ProxyTemplate - plural: proxytemplates + kind: MeshInsight + plural: meshinsights scope: Cluster versions: - name: v1alpha1 @@ -564,7 +618,7 @@ spec: storage: true schema: openAPIV3Schema: - description: ProxyTemplate is the Schema for the proxytemplates API + description: MeshInsight is the Schema for the meshes insights API properties: mesh: type: string @@ -577,12 +631,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: ratelimits.kuma.io + name: meshes.kuma.io spec: group: kuma.io names: - kind: RateLimit - plural: ratelimits + kind: Mesh + plural: meshes scope: Cluster versions: - name: v1alpha1 @@ -590,10 +644,8 @@ spec: storage: true schema: openAPIV3Schema: - description: RateLimit is the Schema for the ratelimits API + description: Mesh is the Schema for the meshes API properties: - mesh: - type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -683,6 +735,19 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + - gatewayroutes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: 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 0aba779affb7..c54fb9835a3e 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 @@ -84,6 +84,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: proxytemplates.kuma.io +spec: + group: kuma.io + names: + kind: ProxyTemplate + plural: proxytemplates + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ProxyTemplate is the Schema for the proxytemplates API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: ratelimits.kuma.io +spec: + group: kuma.io + names: + kind: RateLimit + plural: ratelimits + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: RateLimit is the Schema for the ratelimits API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: retries.kuma.io @@ -294,12 +346,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneingressinsights.kuma.io + name: dataplaneinsights.kuma.io spec: group: kuma.io names: - kind: ZoneIngressInsight - plural: zoneingressinsights + kind: DataplaneInsight + plural: dataplaneinsights scope: Namespaced versions: - name: v1alpha1 @@ -307,11 +359,11 @@ spec: storage: true schema: openAPIV3Schema: - description: ZoneIngressInsight is the Schema for the zone ingress insight API + description: DataplaneInsight is the Schema for the dataplane insights API properties: mesh: type: string - spec: + status: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -320,20 +372,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneinsights.kuma.io + name: zoneingressinsights.kuma.io spec: group: kuma.io names: - kind: ZoneInsight - plural: zoneinsights - scope: Cluster + kind: ZoneIngressInsight + plural: zoneingressinsights + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: ZoneInsight is the Schema for the zone insight API + description: ZoneIngressInsight is the Schema for the zone ingress insight API properties: mesh: type: string @@ -346,24 +398,24 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: dataplaneinsights.kuma.io + name: zoneinsights.kuma.io spec: group: kuma.io names: - kind: DataplaneInsight - plural: dataplaneinsights - scope: Namespaced + kind: ZoneInsight + plural: zoneinsights + scope: Cluster versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: DataplaneInsight is the Schema for the dataplane insights API + description: ZoneInsight is the Schema for the zone insight API properties: mesh: type: string - status: + spec: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -475,20 +527,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: healthchecks.kuma.io + name: gatewayroutes.kuma.io spec: group: kuma.io names: - kind: HealthCheck - plural: healthchecks - scope: Cluster + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: HealthCheck is the Schema for the healthchecks API + description: GatewayRoute is the Schema for the gatewayroutes API properties: mesh: type: string @@ -501,20 +553,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshinsights.kuma.io + name: gateways.kuma.io spec: group: kuma.io names: - kind: MeshInsight - plural: meshinsights - scope: Cluster + kind: Gateway + plural: gateways + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: MeshInsight is the Schema for the meshes insights API + description: Gateway is the Schema for the gateway API properties: mesh: type: string @@ -527,12 +579,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshes.kuma.io + name: healthchecks.kuma.io spec: group: kuma.io names: - kind: Mesh - plural: meshes + kind: HealthCheck + plural: healthchecks scope: Cluster versions: - name: v1alpha1 @@ -540,8 +592,10 @@ spec: storage: true schema: openAPIV3Schema: - description: Mesh is the Schema for the meshes API + description: HealthCheck is the Schema for the healthchecks API properties: + mesh: + type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -551,12 +605,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: proxytemplates.kuma.io + name: meshinsights.kuma.io spec: group: kuma.io names: - kind: ProxyTemplate - plural: proxytemplates + kind: MeshInsight + plural: meshinsights scope: Cluster versions: - name: v1alpha1 @@ -564,7 +618,7 @@ spec: storage: true schema: openAPIV3Schema: - description: ProxyTemplate is the Schema for the proxytemplates API + description: MeshInsight is the Schema for the meshes insights API properties: mesh: type: string @@ -577,12 +631,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: ratelimits.kuma.io + name: meshes.kuma.io spec: group: kuma.io names: - kind: RateLimit - plural: ratelimits + kind: Mesh + plural: meshes scope: Cluster versions: - name: v1alpha1 @@ -590,10 +644,8 @@ spec: storage: true schema: openAPIV3Schema: - description: RateLimit is the Schema for the ratelimits API + description: Mesh is the Schema for the meshes API properties: - mesh: - type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -683,6 +735,19 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + - gatewayroutes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: 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 dd156741e135..1ea9e79bf190 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 @@ -93,6 +93,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: proxytemplates.kuma.io +spec: + group: kuma.io + names: + kind: ProxyTemplate + plural: proxytemplates + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ProxyTemplate is the Schema for the proxytemplates API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: ratelimits.kuma.io +spec: + group: kuma.io + names: + kind: RateLimit + plural: ratelimits + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: RateLimit is the Schema for the ratelimits API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: retries.kuma.io @@ -303,12 +355,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneingressinsights.kuma.io + name: dataplaneinsights.kuma.io spec: group: kuma.io names: - kind: ZoneIngressInsight - plural: zoneingressinsights + kind: DataplaneInsight + plural: dataplaneinsights scope: Namespaced versions: - name: v1alpha1 @@ -316,11 +368,11 @@ spec: storage: true schema: openAPIV3Schema: - description: ZoneIngressInsight is the Schema for the zone ingress insight API + description: DataplaneInsight is the Schema for the dataplane insights API properties: mesh: type: string - spec: + status: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -329,20 +381,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneinsights.kuma.io + name: zoneingressinsights.kuma.io spec: group: kuma.io names: - kind: ZoneInsight - plural: zoneinsights - scope: Cluster + kind: ZoneIngressInsight + plural: zoneingressinsights + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: ZoneInsight is the Schema for the zone insight API + description: ZoneIngressInsight is the Schema for the zone ingress insight API properties: mesh: type: string @@ -355,24 +407,24 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: dataplaneinsights.kuma.io + name: zoneinsights.kuma.io spec: group: kuma.io names: - kind: DataplaneInsight - plural: dataplaneinsights - scope: Namespaced + kind: ZoneInsight + plural: zoneinsights + scope: Cluster versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: DataplaneInsight is the Schema for the dataplane insights API + description: ZoneInsight is the Schema for the zone insight API properties: mesh: type: string - status: + spec: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -484,20 +536,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: healthchecks.kuma.io + name: gatewayroutes.kuma.io spec: group: kuma.io names: - kind: HealthCheck - plural: healthchecks - scope: Cluster + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: HealthCheck is the Schema for the healthchecks API + description: GatewayRoute is the Schema for the gatewayroutes API properties: mesh: type: string @@ -510,20 +562,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshinsights.kuma.io + name: gateways.kuma.io spec: group: kuma.io names: - kind: MeshInsight - plural: meshinsights - scope: Cluster + kind: Gateway + plural: gateways + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: MeshInsight is the Schema for the meshes insights API + description: Gateway is the Schema for the gateway API properties: mesh: type: string @@ -536,12 +588,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshes.kuma.io + name: healthchecks.kuma.io spec: group: kuma.io names: - kind: Mesh - plural: meshes + kind: HealthCheck + plural: healthchecks scope: Cluster versions: - name: v1alpha1 @@ -549,8 +601,10 @@ spec: storage: true schema: openAPIV3Schema: - description: Mesh is the Schema for the meshes API + description: HealthCheck is the Schema for the healthchecks API properties: + mesh: + type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -560,12 +614,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: proxytemplates.kuma.io + name: meshinsights.kuma.io spec: group: kuma.io names: - kind: ProxyTemplate - plural: proxytemplates + kind: MeshInsight + plural: meshinsights scope: Cluster versions: - name: v1alpha1 @@ -573,7 +627,7 @@ spec: storage: true schema: openAPIV3Schema: - description: ProxyTemplate is the Schema for the proxytemplates API + description: MeshInsight is the Schema for the meshes insights API properties: mesh: type: string @@ -586,12 +640,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: ratelimits.kuma.io + name: meshes.kuma.io spec: group: kuma.io names: - kind: RateLimit - plural: ratelimits + kind: Mesh + plural: meshes scope: Cluster versions: - name: v1alpha1 @@ -599,10 +653,8 @@ spec: storage: true schema: openAPIV3Schema: - description: RateLimit is the Schema for the ratelimits API + description: Mesh is the Schema for the meshes API properties: - mesh: - type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -692,6 +744,19 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + - gatewayroutes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: 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 74d5a7568192..6a11696e44e3 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 @@ -84,6 +84,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: proxytemplates.kuma.io +spec: + group: kuma.io + names: + kind: ProxyTemplate + plural: proxytemplates + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ProxyTemplate is the Schema for the proxytemplates API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: ratelimits.kuma.io +spec: + group: kuma.io + names: + kind: RateLimit + plural: ratelimits + scope: Cluster + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: RateLimit is the Schema for the ratelimits API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: retries.kuma.io @@ -294,12 +346,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneingressinsights.kuma.io + name: dataplaneinsights.kuma.io spec: group: kuma.io names: - kind: ZoneIngressInsight - plural: zoneingressinsights + kind: DataplaneInsight + plural: dataplaneinsights scope: Namespaced versions: - name: v1alpha1 @@ -307,11 +359,11 @@ spec: storage: true schema: openAPIV3Schema: - description: ZoneIngressInsight is the Schema for the zone ingress insight API + description: DataplaneInsight is the Schema for the dataplane insights API properties: mesh: type: string - spec: + status: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -320,20 +372,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: zoneinsights.kuma.io + name: zoneingressinsights.kuma.io spec: group: kuma.io names: - kind: ZoneInsight - plural: zoneinsights - scope: Cluster + kind: ZoneIngressInsight + plural: zoneingressinsights + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: ZoneInsight is the Schema for the zone insight API + description: ZoneIngressInsight is the Schema for the zone ingress insight API properties: mesh: type: string @@ -346,24 +398,24 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: dataplaneinsights.kuma.io + name: zoneinsights.kuma.io spec: group: kuma.io names: - kind: DataplaneInsight - plural: dataplaneinsights - scope: Namespaced + kind: ZoneInsight + plural: zoneinsights + scope: Cluster versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: DataplaneInsight is the Schema for the dataplane insights API + description: ZoneInsight is the Schema for the zone insight API properties: mesh: type: string - status: + spec: x-kubernetes-preserve-unknown-fields: true type: object type: object @@ -475,20 +527,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: healthchecks.kuma.io + name: gatewayroutes.kuma.io spec: group: kuma.io names: - kind: HealthCheck - plural: healthchecks - scope: Cluster + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: HealthCheck is the Schema for the healthchecks API + description: GatewayRoute is the Schema for the gatewayroutes API properties: mesh: type: string @@ -501,20 +553,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshinsights.kuma.io + name: gateways.kuma.io spec: group: kuma.io names: - kind: MeshInsight - plural: meshinsights - scope: Cluster + kind: Gateway + plural: gateways + scope: Namespaced versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: - description: MeshInsight is the Schema for the meshes insights API + description: Gateway is the Schema for the gateway API properties: mesh: type: string @@ -527,12 +579,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: meshes.kuma.io + name: healthchecks.kuma.io spec: group: kuma.io names: - kind: Mesh - plural: meshes + kind: HealthCheck + plural: healthchecks scope: Cluster versions: - name: v1alpha1 @@ -540,8 +592,10 @@ spec: storage: true schema: openAPIV3Schema: - description: Mesh is the Schema for the meshes API + description: HealthCheck is the Schema for the healthchecks API properties: + mesh: + type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -551,12 +605,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: proxytemplates.kuma.io + name: meshinsights.kuma.io spec: group: kuma.io names: - kind: ProxyTemplate - plural: proxytemplates + kind: MeshInsight + plural: meshinsights scope: Cluster versions: - name: v1alpha1 @@ -564,7 +618,7 @@ spec: storage: true schema: openAPIV3Schema: - description: ProxyTemplate is the Schema for the proxytemplates API + description: MeshInsight is the Schema for the meshes insights API properties: mesh: type: string @@ -577,12 +631,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: ratelimits.kuma.io + name: meshes.kuma.io spec: group: kuma.io names: - kind: RateLimit - plural: ratelimits + kind: Mesh + plural: meshes scope: Cluster versions: - name: v1alpha1 @@ -590,10 +644,8 @@ spec: storage: true schema: openAPIV3Schema: - description: RateLimit is the Schema for the ratelimits API + description: Mesh is the Schema for the meshes API properties: - mesh: - type: string spec: x-kubernetes-preserve-unknown-fields: true type: object @@ -683,6 +735,19 @@ rules: - update - patch - delete + - apiGroups: + - kuma.io + resources: + - gateways + - gatewayroutes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - kuma.io resources: 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 ad0ee5280e12..86d644ee7fdb 100644 --- a/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml @@ -131,6 +131,58 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: gatewayroutes.kuma.io +spec: + group: kuma.io + names: + kind: GatewayRoute + plural: gatewayroutes + scope: Namespaced + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: GatewayRoute is the Schema for the gatewayroutes API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: gateways.kuma.io +spec: + group: kuma.io + names: + kind: Gateway + plural: gateways + scope: Namespaced + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + description: Gateway is the Schema for the gateway API + properties: + mesh: + type: string + spec: + x-kubernetes-preserve-unknown-fields: true + type: object + type: object +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: creationTimestamp: null name: healthchecks.kuma.io