From b98cdea25df7280310203ad22d3f8ed727c9dc30 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Wed, 16 Nov 2022 18:45:29 +0100 Subject: [PATCH 01/11] [makefile] Adding target to setup olm kuadrant installation * Bumps opm version * Creates tasks to load olm needed images to Kind for local testing * Uses custom catalog Dockerfile [catalog] Custom Dockerfile for building catalog * In order to use instead of autogenerated index.Dockerfile * To mitigate https://github.com/operator-framework/operator-registry/issues/619 [gh] Using custom catalog.Dockerfile to build catalog images [gh] Adding platforms for building images [makefile] Adding platform param in custom docker build command --- Makefile | 90 +++++++++++++++++++++++++++++++++++++++++++--- catalog.Dockerfile | 8 +++++ 2 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 catalog.Dockerfile diff --git a/Makefile b/Makefile index 7295cc700..3eb6da7a4 100644 --- a/Makefile +++ b/Makefile @@ -245,15 +245,19 @@ local-setup: $(KIND) ## Deploy locally kuadrant operator from the current code local-cleanup: ## Delete local cluster $(MAKE) kind-delete-cluster -# kuadrant is not deployed -.PHONY: local-env-setup -local-env-setup: ## Deploys all services and manifests required by kuadrant to run. Used to run kuadrant with "make run" +.PHONY: local-cluster-setup +local-cluster-setup: ## Sets up Kind cluster with GatewayAPI manifests and istio GW, nothing Kuadrant. $(MAKE) kind-delete-cluster $(MAKE) kind-create-cluster $(MAKE) namespace $(MAKE) gateway-api-install $(MAKE) istio-install $(MAKE) deploy-gateway + +# kuadrant is not deployed +.PHONY: local-env-setup +local-env-setup: ## Deploys all services and manifests required by kuadrant to run. Used to run kuadrant with "make run" + $(MAKE) local-cluster-setup $(MAKE) deploy-dependencies $(MAKE) install @@ -266,6 +270,20 @@ test-env-setup: ## Deploys all services and manifests required by kuadrant to ru $(MAKE) deploy-dependencies $(MAKE) install +.PHONY: local-olm-setup +local-olm-setup: ## Installs OLM and the Kuadrant operator catalog, then installs the operator with its dependencies. + $(MAKE) local-cluster-setup + $(MAKE) docker-build + $(MAKE) install-olm + $(MAKE) bundle + $(MAKE) bundle-build + $(MAKE) catalog-generate + $(MAKE) catalog-custom-build + $(MAKE) kind-load-catalog + $(MAKE) kind-load-image + $(MAKE) kind-load-bundle + $(MAKE) deploy-olm + ##@ Build build: generate fmt vet ## Build manager binary. @@ -282,6 +300,15 @@ docker-build: ## Build docker image with the manager. docker-push: ## Push docker image with the manager. docker push $(IMG) +kind-load-catalog: ## Load catalog image to local cluster + $(KIND) load docker-image $(CATALOG_IMG) --name $(KIND_CLUSTER_NAME) + +kind-load-image: ## Load image to local cluster + $(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME) + +kind-load-bundle: ## Load image to local cluster + $(KIND) load docker-image $(BUNDLE_IMG) --name $(KIND_CLUSTER_NAME) + ##@ Deployment install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. @@ -310,7 +337,7 @@ install-olm: $(OPERATOR_SDK) uninstall-olm: $(OPERATOR_SDK) olm uninstall -deploy-catalog: $(KUSTOMIZE) $(YQ) ## Deploy controller to the K8s cluster specified in ~/.kube/config using OLM catalog image. +deploy-catalog: $(KUSTOMIZE) $(YQ) ## Deploy operator to the K8s cluster specified in ~/.kube/config using OLM catalog image. V="$(CATALOG_IMG)" $(YQ) eval '.spec.image = strenv(V)' -i config/deploy/olm/catalogsource.yaml $(KUSTOMIZE) build config/deploy/olm | kubectl apply -f - @@ -364,6 +391,61 @@ bundle-build: ## Build the bundle image. bundle-push: ## Push the bundle image. $(MAKE) docker-push IMG=$(BUNDLE_IMG) +.PHONY: opm +OPM = ./bin/opm +opm: ## Download opm locally if necessary. +ifeq (,$(wildcard $(OPM))) +ifeq (,$(shell which opm 2>/dev/null)) + @{ \ + set -e ;\ + mkdir -p $(dir $(OPM)) ;\ + OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ + curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.26.2/$${OS}-$${ARCH}-opm ;\ + chmod +x $(OPM) ;\ + } +else +OPM = $(shell which opm) +endif +endif + +# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0). +# These images MUST exist in a registry and be pull-able. +BUNDLE_IMGS ?= $(BUNDLE_IMG),$(LIMITADOR_OPERATOR_BUNDLE_IMG),$(AUTHORINO_OPERATOR_BUNDLE_IMG) + +# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0). +CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:$(IMAGE_TAG) + +# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image. +ifneq ($(origin CATALOG_BASE_IMG), undefined) +FROM_INDEX_OPT := --from-index $(CATALOG_BASE_IMG) +endif + +PLATFORM_PARAM = +ifeq ($(shell uname -sm),Darwin arm64) + PLATFORM_PARAM = --platform=linux/arm64 +endif + +# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'. +# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see: +# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator +.PHONY: catalog-build +catalog-build: opm ## Build a catalog image. + $(OPM) index add --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) + +.PHONY: catalog-custom-build +catalog-custom-build: ## Build the bundle image. + docker build $(PLATFORM_PARAM) -f catalog.Dockerfile -t $(CATALOG_IMG) . + + +.PHONY: catalog-generate +catalog-generate: opm ## Generate a catalog/index Dockerfile. + $(OPM) index add --generate --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) + +# Push the catalog image. +.PHONY: catalog-push +catalog-push: ## Push a catalog image. + $(MAKE) docker-push IMG=$(CATALOG_IMG) + ##@ Code Style GOLANGCI-LINT = $(PROJECT_PATH)/bin/golangci-lint diff --git a/catalog.Dockerfile b/catalog.Dockerfile new file mode 100644 index 000000000..d3b5970b7 --- /dev/null +++ b/catalog.Dockerfile @@ -0,0 +1,8 @@ +FROM quay.io/operator-framework/upstream-opm-builder +LABEL operators.operatorframework.io.index.database.v1=/database/index.db +ADD database/index.db /database/index.db +RUN mkdir /registry && chmod 775 /registry +EXPOSE 50051 +WORKDIR /registry +ENTRYPOINT ["/bin/opm"] +CMD ["registry", "serve", "--database", "/database/index.db"] From 002a9b81b7ff5a643f46e6947dd476ee66de987e Mon Sep 17 00:00:00 2001 From: Guilherme Cassolato Date: Wed, 30 Nov 2022 01:30:17 +0100 Subject: [PATCH 02/11] Reconcile Authorino when OSSM --- Makefile | 2 +- .../maistra/addtoscheme_maistra_v1.go | 12 + .../maistra/addtoscheme_maistra_v2.go | 12 + api/external/maistra/apis.go | 13 + api/external/maistra/status/status.go | 279 ++ .../maistra/status/zz_generated.deepcopy.go | 120 + api/external/maistra/v1/helmvalues.go | 344 ++ api/external/maistra/v1/register.go | 24 + .../v1/servicemeshcontrolplane_types.go | 149 + .../maistra/v1/servicemeshmember_types.go | 177 + .../maistra/v1/servicemeshmemberroll_types.go | 206 ++ .../maistra/v1/zz_generated.deepcopy.go | 438 +++ api/external/maistra/v2/addons.go | 22 + api/external/maistra/v2/cluster.go | 76 + api/external/maistra/v2/datadog.go | 6 + api/external/maistra/v2/gateways.go | 165 + api/external/maistra/v2/general.go | 16 + api/external/maistra/v2/grafana.go | 68 + api/external/maistra/v2/jaeger.go | 98 + api/external/maistra/v2/kiali.go | 80 + api/external/maistra/v2/lightstep.go | 6 + api/external/maistra/v2/logging.go | 93 + api/external/maistra/v2/policy.go | 91 + api/external/maistra/v2/prometheus.go | 58 + api/external/maistra/v2/proxy.go | 387 ++ api/external/maistra/v2/register.go | 26 + api/external/maistra/v2/runtime.go | 344 ++ api/external/maistra/v2/security.go | 295 ++ .../v2/servicemeshcontrolplane_types.go | 204 ++ api/external/maistra/v2/stackdriver.go | 97 + api/external/maistra/v2/telemetry.go | 119 + api/external/maistra/v2/threescale.go | 130 + api/external/maistra/v2/tracing.go | 31 + api/external/maistra/v2/zipkin.go | 6 + .../maistra/v2/zz_generated.deepcopy.go | 3131 +++++++++++++++++ api/external/maistra/version/version.go | 48 + ...adrant-operator.clusterserviceversion.yaml | 28 + config/rbac/role.yaml | 28 + controllers/kuadrant_controller.go | 252 +- main.go | 2 + 40 files changed, 7653 insertions(+), 30 deletions(-) create mode 100644 api/external/maistra/addtoscheme_maistra_v1.go create mode 100644 api/external/maistra/addtoscheme_maistra_v2.go create mode 100644 api/external/maistra/apis.go create mode 100644 api/external/maistra/status/status.go create mode 100644 api/external/maistra/status/zz_generated.deepcopy.go create mode 100644 api/external/maistra/v1/helmvalues.go create mode 100644 api/external/maistra/v1/register.go create mode 100644 api/external/maistra/v1/servicemeshcontrolplane_types.go create mode 100644 api/external/maistra/v1/servicemeshmember_types.go create mode 100644 api/external/maistra/v1/servicemeshmemberroll_types.go create mode 100644 api/external/maistra/v1/zz_generated.deepcopy.go create mode 100644 api/external/maistra/v2/addons.go create mode 100644 api/external/maistra/v2/cluster.go create mode 100644 api/external/maistra/v2/datadog.go create mode 100644 api/external/maistra/v2/gateways.go create mode 100644 api/external/maistra/v2/general.go create mode 100644 api/external/maistra/v2/grafana.go create mode 100644 api/external/maistra/v2/jaeger.go create mode 100644 api/external/maistra/v2/kiali.go create mode 100644 api/external/maistra/v2/lightstep.go create mode 100644 api/external/maistra/v2/logging.go create mode 100644 api/external/maistra/v2/policy.go create mode 100644 api/external/maistra/v2/prometheus.go create mode 100644 api/external/maistra/v2/proxy.go create mode 100644 api/external/maistra/v2/register.go create mode 100644 api/external/maistra/v2/runtime.go create mode 100644 api/external/maistra/v2/security.go create mode 100644 api/external/maistra/v2/servicemeshcontrolplane_types.go create mode 100644 api/external/maistra/v2/stackdriver.go create mode 100644 api/external/maistra/v2/telemetry.go create mode 100644 api/external/maistra/v2/threescale.go create mode 100644 api/external/maistra/v2/tracing.go create mode 100644 api/external/maistra/v2/zipkin.go create mode 100644 api/external/maistra/v2/zz_generated.deepcopy.go create mode 100644 api/external/maistra/version/version.go diff --git a/Makefile b/Makefile index 3eb6da7a4..8b63f54f1 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,7 @@ act: $(ACT) ## Download act locally if necessary. .PHONY: manifests manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases + $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./api/v1beta1" output:crd:artifacts:config=config/crd/bases .PHONY: dependencies-manifests dependencies-manifests: export AUTHORINO_OPERATOR_GITREF := $(AUTHORINO_OPERATOR_GITREF) diff --git a/api/external/maistra/addtoscheme_maistra_v1.go b/api/external/maistra/addtoscheme_maistra_v1.go new file mode 100644 index 000000000..569765298 --- /dev/null +++ b/api/external/maistra/addtoscheme_maistra_v1.go @@ -0,0 +1,12 @@ +package apis + +import ( + v1 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v1" +) + +func init() { + // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back + AddToSchemes = append(AddToSchemes, + v1.SchemeBuilder.AddToScheme, + ) +} diff --git a/api/external/maistra/addtoscheme_maistra_v2.go b/api/external/maistra/addtoscheme_maistra_v2.go new file mode 100644 index 000000000..4e2897f4b --- /dev/null +++ b/api/external/maistra/addtoscheme_maistra_v2.go @@ -0,0 +1,12 @@ +package apis + +import ( + v2 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v2" +) + +func init() { + // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back + AddToSchemes = append(AddToSchemes, + v2.SchemeBuilder.AddToScheme, + ) +} diff --git a/api/external/maistra/apis.go b/api/external/maistra/apis.go new file mode 100644 index 000000000..07dc96164 --- /dev/null +++ b/api/external/maistra/apis.go @@ -0,0 +1,13 @@ +package apis + +import ( + "k8s.io/apimachinery/pkg/runtime" +) + +// AddToSchemes may be used to add all resources defined in the project to a Scheme +var AddToSchemes runtime.SchemeBuilder + +// AddToScheme adds all Resources to the Scheme +func AddToScheme(s *runtime.Scheme) error { + return AddToSchemes.AddToScheme(s) +} diff --git a/api/external/maistra/status/status.go b/api/external/maistra/status/status.go new file mode 100644 index 000000000..06a29c6b8 --- /dev/null +++ b/api/external/maistra/status/status.go @@ -0,0 +1,279 @@ +package status + +import ( + "fmt" + "strings" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/kuadrant/kuadrant-operator/api/external/maistra/version" +) + +type StatusBase struct { + // Annotations is an unstructured key value map used to store additional, + // usually redundant status information, such as the number of components + // deployed by the ServiceMeshControlPlane (number is redundant because + // you could just as easily count the elements in the ComponentStatus + // array). The reason to add this redundant information is to make it + // available to kubectl, which does not yet allow counting objects in + // JSONPath expressions. + // +optional + Annotations map[string]string `json:"annotations,omitempty"` +} + +func (s *StatusBase) GetAnnotation(name string) string { + if s.Annotations == nil { + return "" + } + return s.Annotations[name] +} + +func (s *StatusBase) SetAnnotation(name string, value string) { + if s.Annotations == nil { + s.Annotations = map[string]string{} + } + s.Annotations[name] = value +} + +func (s *StatusBase) RemoveAnnotation(name string) { + if s.Annotations != nil { + delete(s.Annotations, name) + } +} + +// StatusType represents the status for a control plane, component, or resource +type StatusType struct { + // Represents the latest available observations of the object's current state. + Conditions []Condition `json:"conditions,omitempty"` +} + +// NewStatus returns a new StatusType object +func NewStatus() StatusType { + return StatusType{Conditions: make([]Condition, 0, 3)} +} + +type ComponentStatusList struct { + // +optional + ComponentStatus []ComponentStatus `json:"components,omitempty"` +} + +// FindComponentByName returns the status for a specific component +func (s *ComponentStatusList) FindComponentByName(name string) *ComponentStatus { + for i, status := range s.ComponentStatus { + if status.Resource == name { + return &s.ComponentStatus[i] + } + } + return nil +} + +// NewComponentStatus returns a new ComponentStatus object +func NewComponentStatus() *ComponentStatus { + return &ComponentStatus{StatusType: NewStatus()} +} + +// ComponentStatus represents the status of an object with children +type ComponentStatus struct { + StatusType `json:",inline"` + + // The name of the component this status pertains to. + Resource string `json:"resource,omitempty"` + + // TODO: can we remove this? it's not used anywhere + // The status of each resource that comprises this component. + Resources []*StatusType `json:"children,omitempty"` +} + +// ConditionType represents the type of the condition. Condition stages are: +// Installed, Reconciled, Ready +type ConditionType string + +const ( + // ConditionTypeInstalled signifies the whether or not the controller has + // installed the resources defined through the CR. + ConditionTypeInstalled ConditionType = "Installed" + // ConditionTypeReconciled signifies the whether or not the controller has + // reconciled the resources defined through the CR. + ConditionTypeReconciled ConditionType = "Reconciled" + // ConditionTypeReady signifies the whether or not any Deployment, StatefulSet, + // etc. resources are Ready. + ConditionTypeReady ConditionType = "Ready" +) + +// ConditionStatus represents the status of the condition +type ConditionStatus string + +const ( + // ConditionStatusTrue represents completion of the condition, e.g. + // Initialized=True signifies that initialization has occurred. + ConditionStatusTrue ConditionStatus = "True" + // ConditionStatusFalse represents incomplete status of the condition, e.g. + // Initialized=False signifies that initialization has not occurred or has + // failed. + ConditionStatusFalse ConditionStatus = "False" + // ConditionStatusUnknown represents unknown completion of the condition, e.g. + // Initialized=Unknown signifies that initialization may or may not have been + // completed. + ConditionStatusUnknown ConditionStatus = "Unknown" +) + +// ConditionReason represents a short message indicating how the condition came +// to be in its present state. +type ConditionReason string + +const ( + // ConditionReasonDeletionError ... + ConditionReasonDeletionError ConditionReason = "DeletionError" + // ConditionReasonInstallSuccessful ... + ConditionReasonInstallSuccessful ConditionReason = "InstallSuccessful" + // ConditionReasonInstallError ... + ConditionReasonInstallError ConditionReason = "InstallError" + // ConditionReasonReconcileSuccessful ... + ConditionReasonReconcileSuccessful ConditionReason = "ReconcileSuccessful" + // ConditionReasonValidationError ... + ConditionReasonValidationError ConditionReason = "ValidationError" + // ConditionReasonValidationError ... + ConditionReasonMultipleSMCPs ConditionReason = "ErrMultipleSMCPs" + // ConditionReasonDependencyMissingError ... + ConditionReasonDependencyMissingError ConditionReason = "DependencyMissingError" + // ConditionReasonReconcileError ... + ConditionReasonReconcileError ConditionReason = "ReconcileError" + // ConditionReasonResourceCreated ... + ConditionReasonResourceCreated ConditionReason = "ResourceCreated" + // ConditionReasonSpecUpdated ... + ConditionReasonSpecUpdated ConditionReason = "SpecUpdated" + // ConditionReasonOperatorUpdated indicates that the SMCP is being reconciled + // because the operator was upgraded + ConditionReasonOperatorUpdated ConditionReason = "OperatorUpdated" + // ConditionReasonUpdateSuccessful ... + ConditionReasonUpdateSuccessful ConditionReason = "UpdateSuccessful" + // ConditionReasonComponentsReady ... + ConditionReasonComponentsReady ConditionReason = "ComponentsReady" + // ConditionReasonComponentsNotReady ... + ConditionReasonComponentsNotReady ConditionReason = "ComponentsNotReady" + // ConditionReasonProbeError ... + ConditionReasonProbeError ConditionReason = "ProbeError" + // ConditionReasonPausingInstall ... + ConditionReasonPausingInstall ConditionReason = "PausingInstall" + // ConditionReasonPausingUpdate ... + ConditionReasonPausingUpdate ConditionReason = "PausingUpdate" + // ConditionReasonDeleting ... + ConditionReasonDeleting ConditionReason = "Deleting" + // ConditionReasonDeleted ... + ConditionReasonDeleted ConditionReason = "Deleted" +) + +// A Condition represents a specific observation of the object's state. +type Condition struct { + // The type of this condition. + Type ConditionType `json:"type,omitempty"` + + // The status of this condition. Can be True, False or Unknown. + Status ConditionStatus `json:"status,omitempty"` + + // Unique, single-word, CamelCase reason for the condition's last transition. + Reason ConditionReason `json:"reason,omitempty"` + + // Human-readable message indicating details about the last transition. + Message string `json:"message,omitempty"` + + // Last time the condition transitioned from one status to another. + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` +} + +func (c *Condition) Matches(status ConditionStatus, reason ConditionReason, message string) bool { + return c.Status == status && c.Reason == reason && c.Message == message +} + +// CurrentReconciledVersion returns a ReconciledVersion for this release of the operator +func CurrentReconciledVersion(generation int64) string { + return ComposeReconciledVersion(version.Info.Version, generation) +} + +// ComposeReconciledVersion returns a string for use in ReconciledVersion fields +func ComposeReconciledVersion(operatorVersion string, generation int64) string { + return fmt.Sprintf("%s-%d", operatorVersion, generation) +} + +// GetCondition removes a condition for the list of conditions +func (s *StatusType) GetCondition(conditionType ConditionType) Condition { + if s == nil { + return Condition{Type: conditionType, Status: ConditionStatusUnknown} + } + for i := range s.Conditions { + if s.Conditions[i].Type == conditionType { + return s.Conditions[i] + } + } + return Condition{Type: conditionType, Status: ConditionStatusUnknown} +} + +// SetCondition sets a specific condition in the list of conditions +func (s *StatusType) SetCondition(condition Condition) *StatusType { + if s == nil { + return nil + } + // These only get serialized out to the second. This can break update + // skipping, as the time in the resource returned from the client may not + // match the time in our cached status during a reconcile. We truncate here + // to save any problems down the line. + now := metav1.NewTime(time.Now().Truncate(time.Second)) + for i, prevCondition := range s.Conditions { + if prevCondition.Type == condition.Type { + if prevCondition.Status != condition.Status { + condition.LastTransitionTime = now + } else { + condition.LastTransitionTime = prevCondition.LastTransitionTime + } + s.Conditions[i] = condition + return s + } + } + + // If the condition does not exist, + // initialize the lastTransitionTime + condition.LastTransitionTime = now + s.Conditions = append(s.Conditions, condition) + return s +} + +// RemoveCondition removes a condition for the list of conditions +func (s *StatusType) RemoveCondition(conditionType ConditionType) *StatusType { + if s == nil { + return nil + } + for i := range s.Conditions { + if s.Conditions[i].Type == conditionType { + s.Conditions = append(s.Conditions[:i], s.Conditions[i+1:]...) + return s + } + } + return s +} + +// ResourceKey is a typedef for key used in ManagedGenerations. It is a string +// with the format: namespace/name=group/version,kind +type ResourceKey string + +// NewResourceKey for the object and type +func NewResourceKey(o metav1.Object, t metav1.Type) ResourceKey { + return ResourceKey(fmt.Sprintf("%s/%s=%s,Kind=%s", o.GetNamespace(), o.GetName(), t.GetAPIVersion(), t.GetKind())) +} + +// ToUnstructured returns a an Unstructured object initialized with Namespace, +// Name, APIVersion, and Kind fields from the ResourceKey +func (key ResourceKey) ToUnstructured() *unstructured.Unstructured { + // ResourceKey is guaranteed to be at least "/=," meaning we are guaranteed + // to get two elements in all of the splits + retval := &unstructured.Unstructured{} + parts := strings.SplitN(string(key), "=", 2) + nn := strings.SplitN(parts[0], "/", 2) + gvk := strings.SplitN(parts[1], ",Kind=", 2) + retval.SetNamespace(nn[0]) + retval.SetName(nn[1]) + retval.SetAPIVersion(gvk[0]) + retval.SetKind(gvk[1]) + return retval +} diff --git a/api/external/maistra/status/zz_generated.deepcopy.go b/api/external/maistra/status/zz_generated.deepcopy.go new file mode 100644 index 000000000..27bcbe7b9 --- /dev/null +++ b/api/external/maistra/status/zz_generated.deepcopy.go @@ -0,0 +1,120 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package status + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus) { + *out = *in + in.StatusType.DeepCopyInto(&out.StatusType) + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]*StatusType, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(StatusType) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatus. +func (in *ComponentStatus) DeepCopy() *ComponentStatus { + if in == nil { + return nil + } + out := new(ComponentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentStatusList) DeepCopyInto(out *ComponentStatusList) { + *out = *in + if in.ComponentStatus != nil { + in, out := &in.ComponentStatus, &out.ComponentStatus + *out = make([]ComponentStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatusList. +func (in *ComponentStatusList) DeepCopy() *ComponentStatusList { + if in == nil { + return nil + } + out := new(ComponentStatusList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusBase) DeepCopyInto(out *StatusBase) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusBase. +func (in *StatusBase) DeepCopy() *StatusBase { + if in == nil { + return nil + } + out := new(StatusBase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusType) DeepCopyInto(out *StatusType) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusType. +func (in *StatusType) DeepCopy() *StatusType { + if in == nil { + return nil + } + out := new(StatusType) + in.DeepCopyInto(out) + return out +} diff --git a/api/external/maistra/v1/helmvalues.go b/api/external/maistra/v1/helmvalues.go new file mode 100644 index 000000000..7f58c1f53 --- /dev/null +++ b/api/external/maistra/v1/helmvalues.go @@ -0,0 +1,344 @@ +package v1 + +import ( + "fmt" + "strconv" + "strings" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/util/json" +) + +// HelmValues is typedef for Helm .Values +// +kubebuilder:validation:Type=object +// +kubebuilder:validation:XPreserveUnknownFields +type HelmValues struct { + data map[string]interface{} `json:"-"` +} + +func NewHelmValues(values map[string]interface{}) *HelmValues { + if values == nil { + values = make(map[string]interface{}) + } + return &HelmValues{data: values} +} + +func (h *HelmValues) GetContent() map[string]interface{} { + if h == nil { + return nil + } + return h.data +} + +func (h *HelmValues) GetFieldNoCopy(path string) (interface{}, bool, error) { + if h == nil || h.data == nil { + return nil, false, nil + } + return unstructured.NestedFieldNoCopy(h.data, strings.Split(path, ".")...) +} + +func (h *HelmValues) GetBool(path string) (bool, bool, error) { + if h == nil || h.data == nil { + return false, false, nil + } + val, found, err := unstructured.NestedFieldNoCopy(h.data, strings.Split(path, ".")...) + if !found || err != nil { + return false, found, err + } + b, ok := val.(bool) + if !ok { + if val == nil { + return false, false, nil + } + return false, false, fmt.Errorf("%v accessor error: %v is of the type %T, expected bool", path, val, val) + } + return b, true, nil +} + +func (h *HelmValues) GetAndRemoveBool(path string) (bool, bool, error) { + value, ok, err := h.GetBool(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetString(path string) (string, bool, error) { + if h == nil || h.data == nil { + return "", false, nil + } + val, found, err := unstructured.NestedFieldNoCopy(h.data, strings.Split(path, ".")...) + if !found || err != nil { + return "", found, err + } + s, ok := val.(string) + if !ok { + if val == nil { + return "", false, nil + } + return "", false, fmt.Errorf("%v accessor error: %v is of the type %T, expected string", path, val, val) + } + return s, true, nil +} + +func (h *HelmValues) GetForceNumberToString(path string) (string, bool, error) { + if h == nil || h.data == nil { + return "", false, nil + } + value, ok, err := unstructured.NestedFieldNoCopy(h.data, strings.Split(path, ".")...) + if err != nil { + return "", false, err + } else if !ok { + return "", false, nil + } + switch typeValue := value.(type) { + case int64: + return strconv.FormatInt(typeValue, 10), ok, nil + case float64: + return strconv.FormatFloat(typeValue, 'f', -1, 64), ok, nil + case string: + return typeValue, ok, nil + case nil: + return "", false, nil + } + return "", false, fmt.Errorf("could not convert type to string: %T=%s", value, value) +} + +func (h *HelmValues) GetAndRemoveString(path string) (string, bool, error) { + value, ok, err := h.GetString(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetAndRemoveForceNumberToString(path string) (string, bool, error) { + value, ok, err := h.GetForceNumberToString(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetInt64(path string) (int64, bool, error) { + if h == nil || h.data == nil { + return 0, false, nil + } + val, found, err := unstructured.NestedFieldNoCopy(h.data, strings.Split(path, ".")...) + if !found || err != nil { + return 0, found, err + } + i, ok := val.(int64) + if !ok { + if val == nil { + return 0, false, nil + } + return 0, false, fmt.Errorf("%v accessor error: %v is of the type %T, expected int64", path, val, val) + } + return i, true, nil +} + +func (h *HelmValues) GetAndRemoveInt64(path string) (int64, bool, error) { + value, ok, err := h.GetInt64(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetFloat64(path string) (float64, bool, error) { + if h == nil || h.data == nil { + return 0, false, nil + } + val, found, err := unstructured.NestedFieldNoCopy(h.data, strings.Split(path, ".")...) + if !found || err != nil { + return 0, found, err + } + f, ok := val.(float64) + if !ok { + if val == nil { + return 0, false, nil + } + return 0, false, fmt.Errorf("%v accessor error: %v is of the type %T, expected float64", path, val, val) + } + return f, true, nil +} + +func (h *HelmValues) GetAndRemoveFloat64(path string) (float64, bool, error) { + value, ok, err := h.GetFloat64(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetStringSlice(path string) ([]string, bool, error) { + if h == nil || h.data == nil { + return nil, false, nil + } + slice, ok, err := unstructured.NestedStringSlice(h.data, strings.Split(path, ".")...) + if err != nil { + if val, _, _ := h.GetFieldNoCopy(path); val == nil { + return nil, false, nil + } + } + return slice, ok, err +} + +func (h *HelmValues) GetAndRemoveStringSlice(path string) ([]string, bool, error) { + value, ok, err := h.GetStringSlice(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetSlice(path string) ([]interface{}, bool, error) { + if h == nil || h.data == nil { + return nil, false, nil + } + slice, ok, err := unstructured.NestedSlice(h.data, strings.Split(path, ".")...) + if err != nil { + if val, _, _ := h.GetFieldNoCopy(path); val == nil { + return nil, false, nil + } + } + return slice, ok, err +} + +func (h *HelmValues) GetAndRemoveSlice(path string) ([]interface{}, bool, error) { + value, ok, err := h.GetSlice(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetAndRemoveStringToStringMap(path string) (map[string]string, bool, error) { + var stringToStringMap map[string]string + var found bool + if rawValues, ok, err := h.GetMap(path); ok { + if len(rawValues) > 0 { + stringToStringMap = make(map[string]string) + for name, rawValue := range rawValues { + if rawValue == nil { + continue + } + switch value := rawValue.(type) { + case string: + stringToStringMap[name] = value + default: + return nil, false, fmt.Errorf("unknown type for %s.%s value, expected string: %T", path, name, rawValue) + } + } + if len(stringToStringMap) == 0 { + // this can happen if there are nil values + stringToStringMap = nil + } else { + found = true + } + } + } else if err != nil { + return nil, false, err + } + h.RemoveField(path) + return stringToStringMap, found, nil +} + +func (h *HelmValues) GetMap(path string) (map[string]interface{}, bool, error) { + if h == nil || h.data == nil { + return nil, false, nil + } + rawval, ok, err := unstructured.NestedFieldCopy(h.data, strings.Split(path, ".")...) + if ok { + if rawval == nil { + return nil, ok, err + } + if mapval, ok := rawval.(map[string]interface{}); ok { + return mapval, ok, err + } + return nil, false, fmt.Errorf("%v accessor error: %v is of the type %T, expected map[string]interface{}", path, rawval, rawval) + } + return nil, ok, err +} + +func (h *HelmValues) GetAndRemoveMap(path string) (map[string]interface{}, bool, error) { + value, ok, err := h.GetMap(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) GetStringMap(path string) (map[string]string, bool, error) { + if h == nil || h.data == nil { + return nil, false, nil + } + mapval, ok, err := unstructured.NestedStringMap(h.data, strings.Split(path, ".")...) + if ok { + return mapval, ok, err + } + return nil, ok, err +} + +func (h *HelmValues) GetAndRemoveStringMap(path string) (map[string]string, bool, error) { + value, ok, err := h.GetStringMap(path) + if err == nil { + h.RemoveField(path) + } + return value, ok, err +} + +func (h *HelmValues) SetField(path string, value interface{}) error { + if h == nil { + panic("Tried to invoke SetField on nil *HelmValues") + } + if h.data == nil { + h.data = map[string]interface{}{} + } + return unstructured.SetNestedField(h.data, value, strings.Split(path, ".")...) +} + +func (h *HelmValues) SetStringSlice(path string, value []string) error { + if h == nil { + panic("Tried to invoke SetField on nil *HelmValues") + } + if h.data == nil { + h.data = map[string]interface{}{} + } + return unstructured.SetNestedStringSlice(h.data, value, strings.Split(path, ".")...) +} + +func (h *HelmValues) RemoveField(path string) { + if h == nil || h.data == nil { + return + } + unstructured.RemoveNestedField(h.data, strings.Split(path, ".")...) +} + +func (h *HelmValues) UnmarshalJSON(in []byte) error { + err := json.Unmarshal(in, &h.data) + if err != nil { + return err + } + return nil +} + +func (h *HelmValues) MarshalJSON() ([]byte, error) { + return json.Marshal(h.data) +} + +func (h *HelmValues) DeepCopyInto(out *HelmValues) { + *out = HelmValues{} + + data, err := json.Marshal(h) + if err != nil { + // panic ??? + return + } + err = json.Unmarshal(data, out) + if err != nil { + // panic ??? + return + } +} diff --git a/api/external/maistra/v1/register.go b/api/external/maistra/v1/register.go new file mode 100644 index 000000000..458024ced --- /dev/null +++ b/api/external/maistra/v1/register.go @@ -0,0 +1,24 @@ +// NOTE: Boilerplate only. Ignore this file. + +// Package v1 contains API Schema definitions for the maistra v1 API group +// +k8s:deepcopy-gen=package,register +// +groupName=maistra.io +package v1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +const ( + APIGroup = "maistra.io" + APIVersion = "v1" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: APIGroup, Version: APIVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} +) diff --git a/api/external/maistra/v1/servicemeshcontrolplane_types.go b/api/external/maistra/v1/servicemeshcontrolplane_types.go new file mode 100644 index 000000000..769532776 --- /dev/null +++ b/api/external/maistra/v1/servicemeshcontrolplane_types.go @@ -0,0 +1,149 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kuadrant/kuadrant-operator/api/external/maistra/status" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +func init() { + SchemeBuilder.Register(&ServiceMeshControlPlane{}, &ServiceMeshControlPlaneList{}) +} + +const DefaultTemplate = "default" + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceMeshControlPlane represents a deployment of the service mesh control +// plane. The control plane components are deployed in the namespace in which +// the ServiceMeshControlPlane resides. The configuration options for the +// components that comprise the control plane are specified in this object. +// +k8s:openapi-gen=true +// +kubebuilder:resource:shortName=smcp,categories=maistra-io +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.annotations.readyComponentCount",description="How many of the total number of components are ready" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Reconciled\")].reason",description="Whether or not the control plane installation is up to date." +// +kubebuilder:printcolumn:name="Template",type="string",JSONPath=".status.lastAppliedConfiguration.template",description="The configuration template to use as the base." +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.lastAppliedConfiguration.version",description="The actual current version of the control plane installation." +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The age of the object" +// +kubebuilder:printcolumn:name="Image HUB",type="string",JSONPath=".status.lastAppliedConfiguration.istio.global.hub",description="The image hub used as the base for all component images.",priority=1 +type ServiceMeshControlPlane struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // The specification of the desired state of this ServiceMeshControlPlane. + // This includes the configuration options for all components that comprise + // the control plane. + // +kubebuilder:validation:Required + Spec ControlPlaneSpec `json:"spec"` + + // The current status of this ServiceMeshControlPlane and the components + // that comprise the control plane. This data may be out of date by some + // window of time. + Status ControlPlaneStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceMeshControlPlaneList contains a list of ServiceMeshControlPlane +type ServiceMeshControlPlaneList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceMeshControlPlane `json:"items"` +} + +// ControlPlaneStatus represents the current state of a ServiceMeshControlPlane. +type ControlPlaneStatus struct { + status.StatusBase `json:",inline"` + + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + status.StatusType `json:",inline"` + + // The generation observed by the controller during the most recent + // reconciliation. The information in the status pertains to this particular + // generation of the object. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // The last version that was reconciled. + ReconciledVersion string `json:"reconciledVersion,omitempty"` + + // The list of components comprising the control plane and their statuses. + // +nullable + status.ComponentStatusList `json:",inline"` + + // The full specification of the configuration options that were applied + // to the components of the control plane during the most recent reconciliation. + // +optional + LastAppliedConfiguration ControlPlaneSpec `json:"lastAppliedConfiguration"` +} + +// GetReconciledVersion returns the reconciled version, or a default for older resources +func (s *ControlPlaneStatus) GetReconciledVersion() string { + if s == nil { + return status.ComposeReconciledVersion("0.0.0", 0) + } + if s.ReconciledVersion == "" { + return status.ComposeReconciledVersion("1.0.0", s.ObservedGeneration) + } + return s.ReconciledVersion +} + +// ControlPlaneSpec represents the configuration for installing a control plane. +type ControlPlaneSpec struct { + // Template selects the template to use for default values. Defaults to + // "default" when not set. + // DEPRECATED - use Profiles instead + // +optional + Template string `json:"template,omitempty"` + + // Profiles selects the profile to use for default values. Defaults to + // "default" when not set. Takes precedence over Template. + // +optional + Profiles []string `json:"profiles,omitempty"` + + // Version specifies what Maistra version of the control plane to install. + // When creating a new ServiceMeshControlPlane with an empty version, the + // admission webhook sets the version to the latest version supported by + // the operator. + // +optional + Version string `json:"version,omitempty"` + + // Deprecated: No longer used anywhere. + // Previously used to specify the NetworkType of the cluster. Defaults to "subnet". + // +optional + NetworkType NetworkType `json:"networkType,omitempty"` + + // Specifies the Istio configuration options that are passed to Helm when the + // Istio charts are rendered. These options are usually populated from the + // template specified in the spec.template field, but individual values can + // be overridden here. + // More info: https://maistra.io/docs/installation/installation-options/ + // +optional + // +kubebuilder:validation:Optional + Istio *HelmValues `json:"istio,omitempty"` + + // Specifies the 3Scale configuration options that are passed to Helm when the + // 3Scale charts are rendered. These values are usually populated from the + // template specified in the spec.template field, but individual values can + // be overridden here. + // More info: https://maistra.io/docs/installation/installation-options/#_3scale + // +optional + // +kubebuilder:validation:Optional + ThreeScale *HelmValues `json:"threeScale,omitempty"` +} + +// NetworkType is type definition representing the network type of the cluster +type NetworkType string + +const ( + // NetworkTypeSubnet when using ovs-subnet + NetworkTypeSubnet NetworkType = "subnet" + // NetworkTypeMultitenant when using ovs-multitenant + NetworkTypeMultitenant NetworkType = "multitenant" + // NetworkTypeNetworkPolicy when using ovs-networkpolicy + NetworkTypeNetworkPolicy NetworkType = "networkpolicy" +) diff --git a/api/external/maistra/v1/servicemeshmember_types.go b/api/external/maistra/v1/servicemeshmember_types.go new file mode 100644 index 000000000..16d989244 --- /dev/null +++ b/api/external/maistra/v1/servicemeshmember_types.go @@ -0,0 +1,177 @@ +package v1 + +import ( + "fmt" + + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kuadrant/kuadrant-operator/api/external/maistra/status" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +func init() { + SchemeBuilder.Register(&ServiceMeshMember{}, &ServiceMeshMemberList{}) +} + +// A ServiceMeshMember object marks the namespace in which it lives as a member +// of the Service Mesh Control Plane referenced in the object. +// The ServiceMeshMember object should be created in each application namespace +// that must be part of the service mesh and must be named "default". +// +// When the ServiceMeshMember object is created, it causes the namespace to be +// added to the ServiceMeshMemberRoll within the namespace of the +// ServiceMeshControlPlane object the ServiceMeshMember references. +// +// To reference a ServiceMeshControlPlane, the user creating the ServiceMeshMember +// object must have the "use" permission on the referenced ServiceMeshControlPlane +// object. This permission is given via the mesh-users RoleBinding (and mesh-user +// Role) in the namespace of the referenced ServiceMeshControlPlane object. +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:storageversion +// +kubebuilder:resource:shortName=smm,categories=maistra-io +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Control Plane",type="string",JSONPath=".status.annotations.controlPlaneRef",description="The ServiceMeshControlPlane this namespace belongs to" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="Whether or not namespace is configured as a member of the mesh." +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The age of the object" +type ServiceMeshMember struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // The desired state of this ServiceMeshMember. + // +kubebuilder:validation:Required + Spec ServiceMeshMemberSpec `json:"spec"` + + // The current status of this ServiceMeshMember. This data may be out of + // date by some window of time. + // +optional + Status ServiceMeshMemberStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceMeshMemberList contains a list of ServiceMeshMember objects +type ServiceMeshMemberList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceMeshMember `json:"items"` +} + +// ServiceMeshMemberSpec defines the member of the mesh +type ServiceMeshMemberSpec struct { + // A reference to the ServiceMeshControlPlane object. + ControlPlaneRef ServiceMeshControlPlaneRef `json:"controlPlaneRef"` +} + +// ServiceMeshControlPlaneRef is a reference to a ServiceMeshControlPlane object +type ServiceMeshControlPlaneRef struct { + // The name of the referenced ServiceMeshControlPlane object. + Name string `json:"name"` + + // The namespace of the referenced ServiceMeshControlPlane object. + Namespace string `json:"namespace"` +} + +func (s ServiceMeshControlPlaneRef) String() string { + return fmt.Sprintf("%s%c%s", s.Namespace, '/', s.Name) +} + +// ServiceMeshMemberStatus represents the current state of a ServiceMeshMember. +type ServiceMeshMemberStatus struct { + status.StatusBase `json:",inline"` + + // The generation observed by the controller during the most recent + // reconciliation. The information in the status pertains to this particular + // generation of the object. + ObservedGeneration int64 `json:"observedGeneration"` + + // The generation of the ServiceMeshControlPlane object observed by the + // controller during the most recent reconciliation of this + // ServiceMeshMember. + ServiceMeshGeneration int64 `json:"meshGeneration,omitempty"` // TODO: do we need this field at all? + + // The reconciled version of the ServiceMeshControlPlane object observed by + // the controller during the most recent reconciliation of this + // ServiceMeshMember. + ServiceMeshReconciledVersion string `json:"meshReconciledVersion,omitempty"` // TODO: do we need this field at all? + + // Represents the latest available observations of a ServiceMeshMember's + // current state. + Conditions []ServiceMeshMemberCondition `json:"conditions"` +} + +// ServiceMeshMemberConditionType represents the type of the condition. Condition types are: +// Reconciled, NamespaceConfigured +type ServiceMeshMemberConditionType string + +const ( + // ConditionTypeReconciled signifies whether or not the controller has + // updated the ServiceMeshMemberRoll object based on this ServiceMeshMember. + ConditionTypeMemberReconciled ServiceMeshMemberConditionType = "Reconciled" + // ConditionTypeReady signifies whether the namespace has been configured + // to use the mesh + ConditionTypeMemberReady ServiceMeshMemberConditionType = "Ready" // TODO: remove the Ready condition in v2 +) + +type ServiceMeshMemberConditionReason string + +const ( + // ConditionReasonDeletionError ... + ConditionReasonMemberCannotCreateMemberRoll ServiceMeshMemberConditionReason = "CreateMemberRollFailed" + ConditionReasonMemberCannotUpdateMemberRoll ServiceMeshMemberConditionReason = "UpdateMemberRollFailed" + ConditionReasonMemberCannotDeleteMemberRoll ServiceMeshMemberConditionReason = "DeleteMemberRollFailed" + ConditionReasonMemberNamespaceNotExists ServiceMeshMemberConditionReason = "NamespaceNotExists" + ConditionReasonMemberReferencesDifferentControlPlane ServiceMeshMemberConditionReason = "ReferencesDifferentControlPlane" + ConditionReasonMemberTerminating ServiceMeshMemberConditionReason = "Terminating" + ConditionReasonMemberNameInvalid ServiceMeshMemberConditionReason = "InvalidName" +) + +// Condition represents a specific condition on a resource +type ServiceMeshMemberCondition struct { + Type ServiceMeshMemberConditionType `json:"type,omitempty"` + Status core.ConditionStatus `json:"status,omitempty"` + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + Reason ServiceMeshMemberConditionReason `json:"reason,omitempty"` + Message string `json:"message,omitempty"` +} + +// GetCondition removes a condition for the list of conditions +func (s *ServiceMeshMemberStatus) GetCondition(conditionType ServiceMeshMemberConditionType) ServiceMeshMemberCondition { + if s == nil { + return ServiceMeshMemberCondition{Type: conditionType, Status: core.ConditionUnknown} + } + for i := range s.Conditions { + if s.Conditions[i].Type == conditionType { + return s.Conditions[i] + } + } + return ServiceMeshMemberCondition{Type: conditionType, Status: core.ConditionUnknown} +} + +// SetCondition sets a specific condition in the list of conditions +func (s *ServiceMeshMemberStatus) SetCondition(condition ServiceMeshMemberCondition) *ServiceMeshMemberStatus { + if s == nil { + return nil + } + now := metav1.Now() + for i := range s.Conditions { + if s.Conditions[i].Type == condition.Type { + if s.Conditions[i].Status != condition.Status { + condition.LastTransitionTime = now + } else { + condition.LastTransitionTime = s.Conditions[i].LastTransitionTime + } + s.Conditions[i] = condition + return s + } + } + + // If the condition does not exist, + // initialize the lastTransitionTime + condition.LastTransitionTime = now + s.Conditions = append(s.Conditions, condition) + return s +} diff --git a/api/external/maistra/v1/servicemeshmemberroll_types.go b/api/external/maistra/v1/servicemeshmemberroll_types.go new file mode 100644 index 000000000..ece15d3ad --- /dev/null +++ b/api/external/maistra/v1/servicemeshmemberroll_types.go @@ -0,0 +1,206 @@ +package v1 + +import ( + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kuadrant/kuadrant-operator/api/external/maistra/status" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +func init() { + SchemeBuilder.Register(&ServiceMeshMemberRoll{}, &ServiceMeshMemberRollList{}) +} + +// The ServiceMeshMemberRoll object configures which namespaces belong to a +// service mesh. Only namespaces listed in the ServiceMeshMemberRoll will be +// affected by the control plane. Any number of namespaces can be added, but a +// namespace may not exist in more than one service mesh. The +// ServiceMeshMemberRoll object must be created in the same namespace as +// the ServiceMeshControlPlane object and must be named "default". +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:storageversion +// +kubebuilder:resource:shortName=smmr,categories=maistra-io +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.annotations.configuredMemberCount",description="How many of the total number of member namespaces are configured" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].reason",description="Whether all member namespaces have been configured or why that's not the case" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The age of the object" +// +kubebuilder:printcolumn:name="Members",type="string",JSONPath=".status.members",description="Namespaces that are members of this Control Plane",priority=1 +type ServiceMeshMemberRoll struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Specification of the desired list of members of the service mesh. + // +kubebuilder:validation:Required + Spec ServiceMeshMemberRollSpec `json:"spec"` + + // The current status of this ServiceMeshMemberRoll. This data may be out + // of date by some window of time. + Status ServiceMeshMemberRollStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceMeshMemberRollList contains a list of ServiceMeshMemberRoll +type ServiceMeshMemberRollList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceMeshMemberRoll `json:"items"` +} + +// ServiceMeshMemberRollSpec is the specification of the desired list of +// members of the service mesh. +type ServiceMeshMemberRollSpec struct { + // List of namespaces that should be members of the service mesh. + // +optional + // +nullable + Members []string `json:"members,omitempty"` +} + +func (s *ServiceMeshMemberRollSpec) IsClusterScoped() bool { + for _, ns := range s.Members { + if ns == "*" { + return true + } + } + return false +} + +// ServiceMeshMemberRollStatus represents the current state of a ServiceMeshMemberRoll. +type ServiceMeshMemberRollStatus struct { + status.StatusBase `json:",inline"` + + // The generation observed by the controller during the most recent + // reconciliation. The information in the status pertains to this particular + // generation of the object. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // The generation of the ServiceMeshControlPlane object observed by the + // controller during the most recent reconciliation of this + // ServiceMeshMemberRoll. + ServiceMeshGeneration int64 `json:"meshGeneration,omitempty"` + + // The reconciled version of the ServiceMeshControlPlane object observed by + // the controller during the most recent reconciliation of this + // ServiceMeshMemberRoll. + ServiceMeshReconciledVersion string `json:"meshReconciledVersion,omitempty"` + + // Complete list of namespaces that are configured as members of the service + // mesh - this includes namespaces specified in spec.members and those that + // contain a ServiceMeshMember object + // +optional + // +nullable + Members []string `json:"members"` + + // List of namespaces that are configured as members of the service mesh. + // +optional + // +nullable + ConfiguredMembers []string `json:"configuredMembers"` + + // List of namespaces that haven't been configured as members of the service + // mesh yet. + // +optional + // +nullable + PendingMembers []string `json:"pendingMembers"` + + // List of namespaces that are being removed as members of the service + // mesh. + // +optional + // +nullable + TerminatingMembers []string `json:"terminatingMembers"` + + // Represents the latest available observations of this ServiceMeshMemberRoll's + // current state. + // +optional + // +nullable + Conditions []ServiceMeshMemberRollCondition `json:"conditions"` + + // Represents the latest available observations of each member's + // current state. + // +optional + // +nullable + MemberStatuses []ServiceMeshMemberStatusSummary `json:"memberStatuses"` +} + +// ServiceMeshMemberStatusSummary represents a summary status of a ServiceMeshMember. +type ServiceMeshMemberStatusSummary struct { + Namespace string `json:"namespace"` + Conditions []ServiceMeshMemberCondition `json:"conditions"` +} + +// ServiceMeshMemberRollConditionType represents the type of the condition. Condition types are: +// Reconciled, NamespaceConfigured +type ServiceMeshMemberRollConditionType string + +const ( + // ConditionTypeMemberRollReady signifies whether the namespace has been configured + // to use the mesh + ConditionTypeMemberRollReady ServiceMeshMemberRollConditionType = "Ready" +) + +type ServiceMeshMemberRollConditionReason string + +const ( + // ConditionReasonConfigured indicates that all namespaces were configured + ConditionReasonConfigured ServiceMeshMemberRollConditionReason = "Configured" + // ConditionReasonReconcileError indicates that one of the namespaces to configure could not be configured + ConditionReasonReconcileError ServiceMeshMemberRollConditionReason = "ReconcileError" + // ConditionReasonSMCPMissing indicates that the ServiceMeshControlPlane resource does not exist + ConditionReasonSMCPMissing ServiceMeshMemberRollConditionReason = "ErrSMCPMissing" + // ConditionReasonMultipleSMCP indicates that multiple ServiceMeshControlPlane resources exist in the namespace + ConditionReasonMultipleSMCP ServiceMeshMemberRollConditionReason = "ErrMultipleSMCPs" + // ConditionReasonInvalidName indicates that the ServiceMeshMemberRoll name is invalid (only "default" is allowed) + ConditionReasonInvalidName ServiceMeshMemberRollConditionReason = "ErrInvalidName" + // ConditionReasonSMCPNotReconciled indicates that reconciliation of the SMMR was skipped because the SMCP has not been reconciled + ConditionReasonSMCPNotReconciled ServiceMeshMemberRollConditionReason = "SMCPReconciling" +) + +// Condition represents a specific condition on a resource +type ServiceMeshMemberRollCondition struct { + Type ServiceMeshMemberRollConditionType `json:"type,omitempty"` + Status core.ConditionStatus `json:"status,omitempty"` + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + Reason ServiceMeshMemberRollConditionReason `json:"reason,omitempty"` + Message string `json:"message,omitempty"` +} + +// GetCondition removes a condition for the list of conditions +func (s *ServiceMeshMemberRollStatus) GetCondition(conditionType ServiceMeshMemberRollConditionType) ServiceMeshMemberRollCondition { + if s == nil { + return ServiceMeshMemberRollCondition{Type: conditionType, Status: core.ConditionUnknown} + } + for i := range s.Conditions { + if s.Conditions[i].Type == conditionType { + return s.Conditions[i] + } + } + return ServiceMeshMemberRollCondition{Type: conditionType, Status: core.ConditionUnknown} +} + +// SetCondition sets a specific condition in the list of conditions +func (s *ServiceMeshMemberRollStatus) SetCondition(condition ServiceMeshMemberRollCondition) *ServiceMeshMemberRollStatus { + if s == nil { + return nil + } + now := metav1.Now() + for i := range s.Conditions { + if s.Conditions[i].Type == condition.Type { + if s.Conditions[i].Status != condition.Status { + condition.LastTransitionTime = now + } else { + condition.LastTransitionTime = s.Conditions[i].LastTransitionTime + } + s.Conditions[i] = condition + return s + } + } + + // If the condition does not exist, + // initialize the lastTransitionTime + condition.LastTransitionTime = now + s.Conditions = append(s.Conditions, condition) + return s +} diff --git a/api/external/maistra/v1/zz_generated.deepcopy.go b/api/external/maistra/v1/zz_generated.deepcopy.go new file mode 100644 index 000000000..bbbfa76da --- /dev/null +++ b/api/external/maistra/v1/zz_generated.deepcopy.go @@ -0,0 +1,438 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1 + +import ( + 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 *ControlPlaneSpec) DeepCopyInto(out *ControlPlaneSpec) { + *out = *in + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Istio != nil { + in, out := &in.Istio, &out.Istio + *out = (*in).DeepCopy() + } + if in.ThreeScale != nil { + in, out := &in.ThreeScale, &out.ThreeScale + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneSpec. +func (in *ControlPlaneSpec) DeepCopy() *ControlPlaneSpec { + if in == nil { + return nil + } + out := new(ControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneStatus) DeepCopyInto(out *ControlPlaneStatus) { + *out = *in + in.StatusBase.DeepCopyInto(&out.StatusBase) + in.StatusType.DeepCopyInto(&out.StatusType) + in.ComponentStatusList.DeepCopyInto(&out.ComponentStatusList) + in.LastAppliedConfiguration.DeepCopyInto(&out.LastAppliedConfiguration) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneStatus. +func (in *ControlPlaneStatus) DeepCopy() *ControlPlaneStatus { + if in == nil { + return nil + } + out := new(ControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmValues. +func (in *HelmValues) DeepCopy() *HelmValues { + if in == nil { + return nil + } + out := new(HelmValues) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshControlPlane) DeepCopyInto(out *ServiceMeshControlPlane) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshControlPlane. +func (in *ServiceMeshControlPlane) DeepCopy() *ServiceMeshControlPlane { + if in == nil { + return nil + } + out := new(ServiceMeshControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshControlPlane) 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 *ServiceMeshControlPlaneList) DeepCopyInto(out *ServiceMeshControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceMeshControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshControlPlaneList. +func (in *ServiceMeshControlPlaneList) DeepCopy() *ServiceMeshControlPlaneList { + if in == nil { + return nil + } + out := new(ServiceMeshControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshControlPlaneList) 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 *ServiceMeshControlPlaneRef) DeepCopyInto(out *ServiceMeshControlPlaneRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshControlPlaneRef. +func (in *ServiceMeshControlPlaneRef) DeepCopy() *ServiceMeshControlPlaneRef { + if in == nil { + return nil + } + out := new(ServiceMeshControlPlaneRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshMember) DeepCopyInto(out *ServiceMeshMember) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMember. +func (in *ServiceMeshMember) DeepCopy() *ServiceMeshMember { + if in == nil { + return nil + } + out := new(ServiceMeshMember) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshMember) 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 *ServiceMeshMemberCondition) DeepCopyInto(out *ServiceMeshMemberCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberCondition. +func (in *ServiceMeshMemberCondition) DeepCopy() *ServiceMeshMemberCondition { + if in == nil { + return nil + } + out := new(ServiceMeshMemberCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshMemberList) DeepCopyInto(out *ServiceMeshMemberList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceMeshMember, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberList. +func (in *ServiceMeshMemberList) DeepCopy() *ServiceMeshMemberList { + if in == nil { + return nil + } + out := new(ServiceMeshMemberList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshMemberList) 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 *ServiceMeshMemberRoll) DeepCopyInto(out *ServiceMeshMemberRoll) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberRoll. +func (in *ServiceMeshMemberRoll) DeepCopy() *ServiceMeshMemberRoll { + if in == nil { + return nil + } + out := new(ServiceMeshMemberRoll) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshMemberRoll) 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 *ServiceMeshMemberRollCondition) DeepCopyInto(out *ServiceMeshMemberRollCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberRollCondition. +func (in *ServiceMeshMemberRollCondition) DeepCopy() *ServiceMeshMemberRollCondition { + if in == nil { + return nil + } + out := new(ServiceMeshMemberRollCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshMemberRollList) DeepCopyInto(out *ServiceMeshMemberRollList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceMeshMemberRoll, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberRollList. +func (in *ServiceMeshMemberRollList) DeepCopy() *ServiceMeshMemberRollList { + if in == nil { + return nil + } + out := new(ServiceMeshMemberRollList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshMemberRollList) 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 *ServiceMeshMemberRollSpec) DeepCopyInto(out *ServiceMeshMemberRollSpec) { + *out = *in + if in.Members != nil { + in, out := &in.Members, &out.Members + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberRollSpec. +func (in *ServiceMeshMemberRollSpec) DeepCopy() *ServiceMeshMemberRollSpec { + if in == nil { + return nil + } + out := new(ServiceMeshMemberRollSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshMemberRollStatus) DeepCopyInto(out *ServiceMeshMemberRollStatus) { + *out = *in + in.StatusBase.DeepCopyInto(&out.StatusBase) + if in.Members != nil { + in, out := &in.Members, &out.Members + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ConfiguredMembers != nil { + in, out := &in.ConfiguredMembers, &out.ConfiguredMembers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PendingMembers != nil { + in, out := &in.PendingMembers, &out.PendingMembers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TerminatingMembers != nil { + in, out := &in.TerminatingMembers, &out.TerminatingMembers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ServiceMeshMemberRollCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.MemberStatuses != nil { + in, out := &in.MemberStatuses, &out.MemberStatuses + *out = make([]ServiceMeshMemberStatusSummary, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberRollStatus. +func (in *ServiceMeshMemberRollStatus) DeepCopy() *ServiceMeshMemberRollStatus { + if in == nil { + return nil + } + out := new(ServiceMeshMemberRollStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshMemberSpec) DeepCopyInto(out *ServiceMeshMemberSpec) { + *out = *in + out.ControlPlaneRef = in.ControlPlaneRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberSpec. +func (in *ServiceMeshMemberSpec) DeepCopy() *ServiceMeshMemberSpec { + if in == nil { + return nil + } + out := new(ServiceMeshMemberSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshMemberStatus) DeepCopyInto(out *ServiceMeshMemberStatus) { + *out = *in + in.StatusBase.DeepCopyInto(&out.StatusBase) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ServiceMeshMemberCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberStatus. +func (in *ServiceMeshMemberStatus) DeepCopy() *ServiceMeshMemberStatus { + if in == nil { + return nil + } + out := new(ServiceMeshMemberStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshMemberStatusSummary) DeepCopyInto(out *ServiceMeshMemberStatusSummary) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ServiceMeshMemberCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshMemberStatusSummary. +func (in *ServiceMeshMemberStatusSummary) DeepCopy() *ServiceMeshMemberStatusSummary { + if in == nil { + return nil + } + out := new(ServiceMeshMemberStatusSummary) + in.DeepCopyInto(out) + return out +} diff --git a/api/external/maistra/v2/addons.go b/api/external/maistra/v2/addons.go new file mode 100644 index 000000000..2fec5a6fa --- /dev/null +++ b/api/external/maistra/v2/addons.go @@ -0,0 +1,22 @@ +package v2 + +// AddonsConfig configures additional features for use with the mesh +type AddonsConfig struct { + // Prometheus configures Prometheus specific addon capabilities + Prometheus *PrometheusAddonConfig `json:"prometheus,omitempty"` + // Stackdriver configures Stackdriver specific addon capabilities + Stackdriver *StackdriverAddonConfig `json:"stackdriver,omitempty"` + // Jaeger configures Jaeger specific addon capabilities + Jaeger *JaegerAddonConfig `json:"jaeger,omitempty"` + // Grafana configures a grafana instance to use with the mesh + // .Values.grafana.enabled, true if not null + // +optional + Grafana *GrafanaAddonConfig `json:"grafana,omitempty"` + // Kiali configures a kiali instance to use with the mesh + // .Values.kiali.enabled, true if not null + // +optional + Kiali *KialiAddonConfig `json:"kiali,omitempty"` + // ThreeScale configures the 3scale adapter + // +optional + ThreeScale *ThreeScaleAddonConfig `json:"3scale,omitempty"` +} diff --git a/api/external/maistra/v2/cluster.go b/api/external/maistra/v2/cluster.go new file mode 100644 index 000000000..d8a9c31e1 --- /dev/null +++ b/api/external/maistra/v2/cluster.go @@ -0,0 +1,76 @@ +package v2 + +// ControlPlaneClusterConfig configures aspects related to clustering. +type ControlPlaneClusterConfig struct { + // .Values.global.multiCluster.clusterName, defaults to Kubernetes + // +optional + Name string `json:"name,omitempty"` + // .Values.global.network + // XXX: not sure what the difference is between this and cluster name + // +optional + Network string `json:"network,omitempty"` + // .Values.global.multiCluster.enabled, if not null + // +optional + MultiCluster *MultiClusterConfig `json:"multiCluster,omitempty"` + // .Values.global.meshExpansion.enabled, if not null + // XXX: it's not clear whether or not there is any overlap with MultiCluster, + // i.e. does MultiCluster require mesh expansion ports to be configured on + // the ingress gateway? + // +optional + MeshExpansion *MeshExpansionConfig `json:"meshExpansion,omitempty"` +} + +// MultiClusterConfig configures aspects related to multi-cluster. +// implies the following: +// adds external to RequestedNetworkView (ISTIO_META_REQUESTED_NETWORK_VIEW) for egress gateway +// adds "global" and "{{ valueOrDefault .DeploymentMeta.Namespace \"default\" }}.global" to pod dns search suffixes +type MultiClusterConfig struct { + Enablement `json:",inline"` + // .Values.global.meshNetworks + // XXX: if non-empty, local cluster network should be configured as: + // : + // endpoints: + // - fromRegistry: + // gateways: + // - service: + // port: 443 # mtls port + // +optional + MeshNetworks map[string]MeshNetworkConfig `json:"meshNetworks,omitempty"` +} + +// MeshExpansionConfig configures aspects related to mesh expansion +type MeshExpansionConfig struct { + Enablement `json:",inline"` + // .Values.global.meshExpansion.useILB, true if not null, otherwise uses ingress gateway + // +optional + ILBGateway *GatewayConfig `json:"ilbGateway,omitempty"` +} + +// MeshNetworkConfig configures mesh networks for a multi-cluster mesh. +type MeshNetworkConfig struct { + Endpoints []MeshEndpointConfig `json:"endpoints,omitempty"` + Gateways []MeshGatewayConfig `json:"gateways,omitempty"` +} + +// MeshEndpointConfig specifies the endpoint of a mesh network. Only one of +// FromRegistry or FromCIDR may be specified +type MeshEndpointConfig struct { + // +optional + FromRegistry string `json:"fromRegistry,omitempty"` + // +optional + FromCIDR string `json:"fromCIDR,omitempty"` +} + +// MeshGatewayConfig specifies the gateway which should be used for accessing +// the network +type MeshGatewayConfig struct { + // +optional + // +deprecated + Service string `json:"service,omitempty"` + // +optional + RegistryServiceName string `json:"registryServiceName,omitempty"` + // +optional + Address string `json:"address,omitempty"` + // +optional + Port int32 `json:"port,omitempty"` +} diff --git a/api/external/maistra/v2/datadog.go b/api/external/maistra/v2/datadog.go new file mode 100644 index 000000000..7d0565432 --- /dev/null +++ b/api/external/maistra/v2/datadog.go @@ -0,0 +1,6 @@ +package v2 + +// DatadogTracerConfig configures a Datadog tracer for use with the mesh +type DatadogTracerConfig struct { + // TODO.... +} diff --git a/api/external/maistra/v2/gateways.go b/api/external/maistra/v2/gateways.go new file mode 100644 index 000000000..2c742f496 --- /dev/null +++ b/api/external/maistra/v2/gateways.go @@ -0,0 +1,165 @@ +package v2 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// GatewaysConfig configures gateways for the mesh +type GatewaysConfig struct { + Enablement `json:",inline"` + // ClusterIngress configures the istio-ingressgateway for the mesh + // works in conjunction with cluster.meshExpansion.ingress configuration + // (for enabling ILB gateway and mesh expansion ports) + // .Values.gateways.istio-ingressgateway + // +optional + ClusterIngress *ClusterIngressGatewayConfig `json:"ingress,omitempty"` + // ClusterEgress configures the istio-egressgateway for the mesh. + // .Values.gateways.istio-egressgateway + // +optional + ClusterEgress *EgressGatewayConfig `json:"egress,omitempty"` + // Other user defined ingress gateways + // .Values.gateways. + // +optional + IngressGateways map[string]*IngressGatewayConfig `json:"additionalIngress,omitempty"` + // Other user defined egress gateways + // .Values.gateways. + // +optional + EgressGateways map[string]*EgressGatewayConfig `json:"additionalEgress,omitempty"` + // Route configures the Gateway ↔ OpenShift Route integration + OpenShiftRoute *OpenShiftRouteConfig `json:"openshiftRoute,omitempty"` +} + +// OpenShiftRouteConfig represents the Gateway ↔ OpenShift Route integration +type OpenShiftRouteConfig struct { + Enablement `json:",inline"` +} + +// GatewayConfig represents the configuration for a gateway +// XXX: should standard istio secrets be configured automatically, i.e. should +// the user be forced to add these manually? +type GatewayConfig struct { + Enablement `json:",inline"` + // Namespace is the namespace within which the gateway will be installed, + // defaults to control plane namespace. + // .Values.gateways..namespace + // XXX: for the standard gateways, it might be possible that related + // resources could be installed in control plane namespace instead of the + // gateway namespace. not sure if this is a problem or not. + // +optional + Namespace string `json:"namespace,omitempty"` + // Service configures the service associated with the gateway, e.g. port + // mappings, service type, annotations/labels, etc. + // .Values.gateways..ports, .Values.gateways..type, + // .Values.gateways..loadBalancerIP, + // .Values.gateways..serviceAnnotations, + // .Values.gateways..serviceLabels + // XXX: currently there is no distinction between labels and serviceLabels + // +optional + Service GatewayServiceConfig `json:"service,omitempty"` + // The router mode to be used by the gateway. + // .Values.gateways..env.ISTIO_META_ROUTER_MODE, defaults to sni-dnat + // +optional + RouterMode RouterModeType `json:"routerMode,omitempty"` + // Volumes is used to configure additional Secret and ConfigMap volumes that + // should be mounted for the gateway's pod. + // .Values.gateways..secretVolumes, .Values.gateways..configMapVolumes + // +optional + Volumes []VolumeConfig `json:"volumes,omitempty"` + // Runtime is used to configure execution parameters for the pod/containers + // e.g. resources, replicas, etc. + // +optional + Runtime *ComponentRuntimeConfig `json:"runtime,omitempty"` + // XXX: do we need to support additionalContainers??? +} + +// EgressGatewayConfig represents gateway configuration for egress +type EgressGatewayConfig struct { + GatewayConfig `json:",inline"` + // RequestedNetworkView is a list of networks whose services should be made + // available to the gateway. This is used primarily for mesh expansion/multi-cluster. + // .Values.gateways..env.ISTIO_META_REQUESTED_NETWORK_VIEW env, defaults to empty list + // XXX: I think this is only applicable to egress gateways + // +optional + RequestedNetworkView []string `json:"requestedNetworkView,omitempty"` +} + +// IngressGatewayConfig represents gateway configuration for ingress +type IngressGatewayConfig struct { + GatewayConfig `json:",inline"` + // EnableSDS for the gateway. + // .Values.gateways..sds.enabled + // +optional + SDS *SecretDiscoveryService `json:"sds,omitempty"` +} + +// SecretDiscoveryService configures whether or not SDS is configured for the gateway +type SecretDiscoveryService struct { + Enablement `json:",inline"` + // Runtime configuration for sds sidecar + Runtime *ContainerConfig `json:"runtime,omitempty"` +} + +// ClusterIngressGatewayConfig represents gateway configuration for cluster ingress +type ClusterIngressGatewayConfig struct { + IngressGatewayConfig `json:",inline"` + // .Values.global.k8sIngress.enabled + // implies the following: + // .Values.global.k8sIngress.gatewayName will match the ingress gateway + // .Values.global.k8sIngress.enableHttps will be true if gateway service exposes port 443 + // XXX: not sure whether or not this is specific to multicluster, mesh expansion, or both + // +optional + IngressEnabled *bool `json:"ingress,omitempty"` + // MeshExpansionPorts define the port set used with multi-cluster/mesh expansion + // +optional + MeshExpansionPorts []corev1.ServicePort `json:"meshExpansionPorts,omitempty"` + // RouteConfig specifies whether to create an OpenShift Route for istio-ingressgateway deployment + // +optional + RouteConfig *Enablement `json:"routeConfig,omitempty"` +} + +// RouterModeType represents the router modes available. +type RouterModeType string + +const ( + // RouterModeTypeSNIDNAT represents sni-dnat router mode + RouterModeTypeSNIDNAT RouterModeType = "sni-dnat" + // RouterModeTypeStandard represents standard router mode + RouterModeTypeStandard RouterModeType = "standard" +) + +// GatewayServiceConfig configures the k8s Service associated with the gateway +type GatewayServiceConfig struct { + // XXX: selector is ignored + // Service details used to configure the gateway's Service resource + // +optional + corev1.ServiceSpec `json:",inline"` + // metadata to be applied to the gateway's service (annotations and labels) + // +optional + Metadata *MetadataConfig `json:"metadata,omitempty"` +} + +// VolumeConfig is used to specify volumes that should be mounted on the pod. +type VolumeConfig struct { + // Volume.Name maps to .Values.gateways... (type-name is configMapName or secretName) + // .configVolumes -> .configMapName = volume.name + // .secretVolumes -> .secretName = volume.name + // Only ConfigMap and Secret fields are supported + Volume GatewayVolume `json:"volume,omitempty"` + // Mount.Name maps to .Values.gateways...name + // .configVolumes -> .name = mount.name, .mountPath = mount.mountPath + // .secretVolumes -> .name = mount.name, .mountPath = mount.mountPath + // Only Name and MountPath fields are supported + Mount corev1.VolumeMount `json:"volumeMount,omitempty"` +} + +// GatewayVolume is a pared down version of corev1.Volume, which only supports +// specifying ConfigMap and Secret volume types. +type GatewayVolume struct { + // ConfigMap represents a configMap that should populate this volume + // +optional + ConfigMap *corev1.ConfigMapVolumeSource `json:"configMap,omitempty"` + // Secret represents a secret that should populate this volume. + // More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + // +optional + Secret *corev1.SecretVolumeSource `json:"secret,omitempty"` +} diff --git a/api/external/maistra/v2/general.go b/api/external/maistra/v2/general.go new file mode 100644 index 000000000..ff3838a58 --- /dev/null +++ b/api/external/maistra/v2/general.go @@ -0,0 +1,16 @@ +package v2 + +// GeneralConfig for control plane +type GeneralConfig struct { + // Logging represents the logging configuration for the control plane components + // XXX: Should this be separate from Proxy.Logging? + // +optional + Logging *LoggingConfig `json:"logging,omitempty"` + + // ValidationMessages configures the control plane to add validationMessages + // to the status fields of istio.io resources. This can be usefule for + // detecting configuration errors in resources. + // .Values.galley.enableAnalysis (=v2.0) + ValidationMessages *bool `json:"validationMessages,omitempty"` +} diff --git a/api/external/maistra/v2/grafana.go b/api/external/maistra/v2/grafana.go new file mode 100644 index 000000000..4d783db69 --- /dev/null +++ b/api/external/maistra/v2/grafana.go @@ -0,0 +1,68 @@ +package v2 + +// GrafanaAddonConfig configures a grafana instance for use with the mesh. Only +// one of install or address may be specified +type GrafanaAddonConfig struct { + Enablement `json:",inline"` + // Install a new grafana instance and manage with control plane + // +optional + Install *GrafanaInstallConfig `json:"install,omitempty"` + // Address is the address of an existing grafana installation + // implies .Values.kiali.dashboard.grafanaURL + // +optional + Address *string `json:"address,omitempty"` +} + +// GrafanaInstallConfig is used to configure a new installation of grafana. +type GrafanaInstallConfig struct { + // SelfManaged, true if the entire install should be managed by Maistra, false if using grafana CR (not supported) + // +optional + SelfManaged bool `json:"selfManaged,omitempty"` + // Config configures the behavior of the grafana installation + // +optional + Config *GrafanaConfig `json:"config,omitempty"` + // Service configures the k8s Service associated with the grafana installation + // XXX: grafana service config does not follow other addon components' structure + // +optional + Service *ComponentServiceConfig `json:"service,omitempty"` + // Persistence configures a PersistentVolume associated with the grafana installation + // .Values.grafana.persist, true if not null + // +optional + Persistence *ComponentPersistenceConfig `json:"persistence,omitempty"` + // Security is used to secure the grafana service. + // .Values.grafana.security.enabled, true if not null + // XXX: unused for maistra, as we use oauth-proxy + // +optional + Security *GrafanaSecurityConfig `json:"security,omitempty"` +} + +// GrafanaConfig configures the behavior of the grafana installation +type GrafanaConfig struct { + // Env allows specification of various grafana environment variables to be + // configured on the grafana container. + // .Values.grafana.env + // XXX: This is pretty cheesy... + // +optional + Env map[string]string `json:"env,omitempty"` + // EnvSecrets allows specification of secret fields into grafana environment + // variables to be configured on the grafana container + // .Values.grafana.envSecrets + // XXX: This is pretty cheesy... + // +optional + EnvSecrets map[string]string `json:"envSecrets,omitempty"` +} + +// GrafanaSecurityConfig is used to secure access to grafana +type GrafanaSecurityConfig struct { + Enablement `json:",inline"` + // SecretName is the name of a secret containing the username/password that + // should be used to access grafana. + // +optional + SecretName string `json:"secretName,omitempty"` + // UsernameKey is the name of the key within the secret identifying the username. + // +optional + UsernameKey string `json:"usernameKey,omitempty"` + // PassphraseKey is the name of the key within the secret identifying the password. + // +optional + PassphraseKey string `json:"passphraseKey,omitempty"` +} diff --git a/api/external/maistra/v2/jaeger.go b/api/external/maistra/v2/jaeger.go new file mode 100644 index 000000000..61b5d3590 --- /dev/null +++ b/api/external/maistra/v2/jaeger.go @@ -0,0 +1,98 @@ +package v2 + +import v1 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v1" + +// JaegerAddonConfig configuration specific to Jaeger integration. +// XXX: this currently deviates from upstream, which creates a jaeger all-in-one deployment manually +type JaegerAddonConfig struct { + // Name of Jaeger CR, Namespace must match control plane namespace + Name string `json:"name,omitempty"` + // Install configures a Jaeger installation, which will be created if the + // named Jaeger resource is not present. If null, the named Jaeger resource + // must exist. + // +optional + Install *JaegerInstallConfig `json:"install,omitempty"` +} + +// JaegerInstallConfig configures a Jaeger installation. +type JaegerInstallConfig struct { + // Config represents the configuration of Jaeger behavior. + // +optional + Storage *JaegerStorageConfig `json:"storage,omitempty"` + // Ingress configures k8s Ingress or OpenShift Route for Jaeger services + // .Values.tracing.jaeger.ingress.enabled, false if null + // +optional + Ingress *JaegerIngressConfig `json:"ingress,omitempty"` +} + +// JaegerStorageConfig configures the storage used by the Jaeger installation. +type JaegerStorageConfig struct { + // Type of storage to use + Type JaegerStorageType `json:"type,omitempty"` + // Memory represents configuration of in-memory storage + // implies .Values.tracing.jaeger.template=all-in-one + // +optional + Memory *JaegerMemoryStorageConfig `json:"memory,omitempty"` + // Elasticsearch represents configuration of elasticsearch storage + // implies .Values.tracing.jaeger.template=production-elasticsearch + // +optional + Elasticsearch *JaegerElasticsearchStorageConfig `json:"elasticsearch,omitempty"` +} + +// JaegerStorageType represents the type of storage configured for Jaeger +type JaegerStorageType string + +const ( + // JaegerStorageTypeMemory represents in-memory storage + JaegerStorageTypeMemory JaegerStorageType = "Memory" + // JaegerStorageTypeElasticsearch represents Elasticsearch storage + JaegerStorageTypeElasticsearch JaegerStorageType = "Elasticsearch" +) + +// JaegerMemoryStorageConfig configures in-memory storage parameters for Jaeger +type JaegerMemoryStorageConfig struct { + // MaxTraces to store + // .Values.tracing.jaeger.memory.max_traces, defaults to 100000 + // +optional + MaxTraces *int64 `json:"maxTraces,omitempty"` +} + +// JaegerElasticsearchStorageConfig configures elasticsearch storage parameters for Jaeger +type JaegerElasticsearchStorageConfig struct { + // NodeCount represents the number of elasticsearch nodes to create. + // .Values.tracing.jaeger.elasticsearch.nodeCount, defaults to 3 + // +optional + NodeCount *int32 `json:"nodeCount,omitempty"` + // Storage represents storage configuration for elasticsearch. + // .Values.tracing.jaeger.elasticsearch.storage, raw yaml + // XXX: RawExtension? + // +optional + Storage *v1.HelmValues `json:"storage,omitempty"` + // RedundancyPolicy configures the redundancy policy for elasticsearch + // .Values.tracing.jaeger.elasticsearch.redundancyPolicy, raw yaml + // +optional + RedundancyPolicy string `json:"redundancyPolicy,omitempty"` + // IndexCleaner represents the configuration for the elasticsearch index cleaner + // .Values.tracing.jaeger.elasticsearch.esIndexCleaner, raw yaml + // XXX: RawExtension? + // +optional + IndexCleaner *v1.HelmValues `json:"indexCleaner,omitempty"` +} + +// JaegerIngressConfig configures k8s Ingress or OpenShift Route for exposing +// Jaeger services. +type JaegerIngressConfig struct { + Enablement `json:",inline"` + // Metadata represents additional annotations/labels to be applied to the ingress/route. + // +optional + Metadata *MetadataConfig `json:"metadata,omitempty"` +} + +// ResourceName returns the resource name for the Jaeger resource, returning a +// sensible default if the Name field is not set ("jaeger"). +func (c JaegerAddonConfig) ResourceName() string { + if c.Name == "" { + return "jaeger" + } + return c.Name +} diff --git a/api/external/maistra/v2/kiali.go b/api/external/maistra/v2/kiali.go new file mode 100644 index 000000000..41027aca4 --- /dev/null +++ b/api/external/maistra/v2/kiali.go @@ -0,0 +1,80 @@ +package v2 + +import corev1 "k8s.io/api/core/v1" + +// KialiAddonConfig is used to configure a kiali instance for use with the mesh +type KialiAddonConfig struct { + Enablement `json:",inline"` + // Name of Kiali CR, Namespace must match control plane namespace + Name string `json:"name,omitempty"` + // Install a Kiali resource if the named Kiali resource is not present. + // +optional + Install *KialiInstallConfig `json:"install,omitempty"` +} + +// KialiInstallConfig is used to configure a kiali installation +type KialiInstallConfig struct { + // Dashboard configures the behavior of the kiali dashboard. + // +optional + Dashboard *KialiDashboardConfig `json:"dashboard,omitempty"` + // Service is used to configure the k8s Service associated with the kiali + // installation. + // XXX: provided for upstream support, only ingress is used, and then only + // for enablement and contextPath + // +optional + Service *ComponentServiceConfig `json:"service,omitempty"` + + // Deployment configures the kiali deployment. + // +optional + // +deprecated + Deployment *KialiDeploymentConfig `json:"deployment,omitempty"` +} + +// KialiDashboardConfig configures the behavior of the kiali dashboard +type KialiDashboardConfig struct { + // ViewOnly configures view_only_mode for the dashboard + // .Values.kiali.dashboard.viewOnlyMode + // +optional + ViewOnly *bool `json:"viewOnly,omitempty"` + // XXX: should the user have a choice here, or should these be configured + // automatically if they are enabled for the control plane installation? + // Grafana endpoint will be configured based on Grafana configuration + // +optional + EnableGrafana *bool `json:"enableGrafana,omitempty"` + // Prometheus endpoint will be configured based on Prometheus configuration + // +optional + EnablePrometheus *bool `json:"enablePrometheus,omitempty"` + // Tracing endpoint will be configured based on Tracing configuration + // +optional + EnableTracing *bool `json:"enableTracing,omitempty"` +} + +// KialiDeploymentConfig configures the kiali deployment +// +deprecated +// Deprecated: Use runtime.components.kiali instead. +type KialiDeploymentConfig struct { + // +optional + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` + + // If specified, the pod's scheduling constraints + // +optional + Affinity *corev1.Affinity `json:"affinity,omitempty"` + + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + + // If specified, the kiali pod's tolerations. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` +} + +// ResourceName returns the resource name for the Kiali resource, returning a +// sensible default if the Name field is not set ("kiali"). +func (c KialiAddonConfig) ResourceName() string { + if c.Name == "" { + return "kiali" + } + return c.Name +} diff --git a/api/external/maistra/v2/lightstep.go b/api/external/maistra/v2/lightstep.go new file mode 100644 index 000000000..3494818cb --- /dev/null +++ b/api/external/maistra/v2/lightstep.go @@ -0,0 +1,6 @@ +package v2 + +// LightstepTracerConfig configures a Lightstep tracer for use with the mesh +type LightstepTracerConfig struct { + // TODO.... +} diff --git a/api/external/maistra/v2/logging.go b/api/external/maistra/v2/logging.go new file mode 100644 index 000000000..0a4b80470 --- /dev/null +++ b/api/external/maistra/v2/logging.go @@ -0,0 +1,93 @@ +package v2 + +// LoggingConfig for control plane components +type LoggingConfig struct { + // ComponentLevels configures log level for specific envoy components + // .Values.global.proxy.componentLogLevel, overridden by sidecar.istio.io/componentLogLevel + // map of : + // +optional + ComponentLevels ComponentLogLevels `json:"componentLevels,omitempty"` + // LogAsJSON enables JSON logging + // .Values.global.logAsJson + // +optional + LogAsJSON *bool `json:"logAsJSON,omitempty"` +} + +// ProxyLoggingConfig configures logging for a component +type ProxyLoggingConfig struct { + // Level the log level + // .Values.global.proxy.logLevel, overridden by sidecar.istio.io/logLevel + // +optional + Level LogLevel `json:"level,omitempty"` + // ComponentLevels configures log level for specific envoy components + // .Values.global.proxy.componentLogLevel, overridden by sidecar.istio.io/componentLogLevel + // map of : + // +optional + ComponentLevels ComponentLogLevels `json:"componentLevels,omitempty"` +} + +// ComponentLogLevels represent various logging levels, e.g. trace, debug, etc. +type ComponentLogLevels map[EnvoyComponent]LogLevel + +// LogLevel represents the logging level +type LogLevel string + +const ( + // LogLevelTrace trace logging level + LogLevelTrace LogLevel = "trace" + // LogLevelDebug debug logging level + LogLevelDebug LogLevel = "debug" + // LogLevelInfo info logging level + LogLevelInfo LogLevel = "info" + // LogLevelWarning warning logging level + LogLevelWarning LogLevel = "warn" + // LogLevelWarningProxy proxy warning logging level + LogLevelWarningProxy LogLevel = "warning" + // LogLevelError error logging level + LogLevelError LogLevel = "error" + // LogLevelCritical critical logging level + LogLevelCritical LogLevel = "critical" + // LogLevelOff disable logging + LogLevelOff LogLevel = "off" +) + +// EnvoyComponent represents an envoy component to configure logging +type EnvoyComponent string + +// not a comprehensive list +const ( + EnvoyComponentAdmin EnvoyComponent = "admin" + EnvoyComponentAssert EnvoyComponent = "assert" + EnvoyComponentBacktrace EnvoyComponent = "backtrace" + EnvoyComponentClient EnvoyComponent = "client" + EnvoyComponentConfig EnvoyComponent = "config" + EnvoyComponentConnection EnvoyComponent = "connection" + EnvoyComponentConnHandler EnvoyComponent = "conn_handler" + EnvoyComponentFile EnvoyComponent = "file" + EnvoyComponentFilter EnvoyComponent = "filter" + EnvoyComponentForwardProxy EnvoyComponent = "forward_proxy" + EnvoyComponentGRPC EnvoyComponent = "grpc" + EnvoyComponentHealth EnvoyComponent = "hc" + EnvoyComponentHealthChecker EnvoyComponent = "health_checker" + EnvoyComponentHTTP EnvoyComponent = "http" + EnvoyComponentHTTP2 EnvoyComponent = "http2" + EnvoyComponentInit EnvoyComponent = "init" + EnvoyComponentIO EnvoyComponent = "io" + EnvoyComponentJWT EnvoyComponent = "jwt" + EnvoyComponentLua EnvoyComponent = "lua" + EnvoyComponentMain EnvoyComponent = "main" + EnvoyComponentMisc EnvoyComponent = "misc" + EnvoyComponentQuic EnvoyComponent = "quic" + EnvoyComponentPool EnvoyComponent = "pool" + EnvoyComponentRBAC EnvoyComponent = "rbac" + EnvoyComponentRouter EnvoyComponent = "router" + EnvoyComponentRuntime EnvoyComponent = "runtime" + EnvoyComponentStats EnvoyComponent = "stats" + EnvoyComponentSecret EnvoyComponent = "secret" + EnvoyComponentTap EnvoyComponent = "tap" + EnvoyComponentTesting EnvoyComponent = "testing" + EnvoyComponentTracing EnvoyComponent = "tracing" + EnvoyComponentUpstream EnvoyComponent = "upstream" + EnvoyComponentUDP EnvoyComponent = "udp" + EnvoyComponentWASM EnvoyComponent = "wasm" +) diff --git a/api/external/maistra/v2/policy.go b/api/external/maistra/v2/policy.go new file mode 100644 index 000000000..16a87a218 --- /dev/null +++ b/api/external/maistra/v2/policy.go @@ -0,0 +1,91 @@ +package v2 + +// PolicyConfig configures policy aspects of the mesh. +type PolicyConfig struct { + // Required, the policy implementation + // defaults to Istiod 1.6+, Mixer pre-1.6 + Type PolicyType `json:"type,omitempty"` + // Mixer configuration (legacy, v1) + // .Values.mixer.policy.enabled + // +optional + Mixer *MixerPolicyConfig `json:"mixer,omitempty"` + // Remote mixer configuration (legacy, v1) + // .Values.global.remotePolicyAddress + // +optional + Remote *RemotePolicyConfig `json:"remote,omitempty"` +} + +// PolicyType represents the type of policy implementation used by the mesh. +type PolicyType string + +const ( + // PolicyTypeNone represents disabling of policy + // XXX: note, this doesn't appear to affect Istio 1.6, i.e. no different than Istiod setting + PolicyTypeNone PolicyType = "None" + // PolicyTypeMixer represents mixer, v1 implementation + PolicyTypeMixer PolicyType = "Mixer" + // PolicyTypeRemote represents remote mixer, v1 implementation + PolicyTypeRemote PolicyType = "Remote" + // PolicyTypeIstiod represents istio, v2 implementation + PolicyTypeIstiod PolicyType = "Istiod" +) + +// MixerPolicyConfig configures a mixer implementation for policy +// .Values.mixer.policy.enabled +type MixerPolicyConfig struct { + // EnableChecks configures whether or not policy checks should be enabled. + // .Values.global.disablePolicyChecks | default "true" (false, inverted logic) + // Set the following variable to false to disable policy checks by the Mixer. + // Note that metrics will still be reported to the Mixer. + // +optional + EnableChecks *bool `json:"enableChecks,omitempty"` + // FailOpen configures policy checks to fail if mixer cannot be reached. + // .Values.global.policyCheckFailOpen, maps to MeshConfig.policyCheckFailOpen + // policyCheckFailOpen allows traffic in cases when the mixer policy service cannot be reached. + // Default is false which means the traffic is denied when the client is unable to connect to Mixer. + // +optional + FailOpen *bool `json:"failOpen,omitempty"` + // SessionAffinity configures session affinity for sidecar policy connections. + // .Values.mixer.policy.sessionAffinityEnabled + // +optional + SessionAffinity *bool `json:"sessionAffinity,omitempty"` + // Adapters configures available adapters. + // +optional + Adapters *MixerPolicyAdaptersConfig `json:"adapters,omitempty"` +} + +// MixerPolicyAdaptersConfig configures policy adapters for mixer. +type MixerPolicyAdaptersConfig struct { + // UseAdapterCRDs configures mixer to support deprecated mixer CRDs. + // .Values.mixer.policy.adapters.useAdapterCRDs, removed in istio 1.4, defaults to false + // Only supported in v1.0, where it defaulted to true + // +optional + UseAdapterCRDs *bool `json:"useAdapterCRDs,omitempty"` + // Kubernetesenv configures the use of the kubernetesenv adapter. + // .Values.mixer.policy.adapters.kubernetesenv.enabled, defaults to true + // +optional + KubernetesEnv *bool `json:"kubernetesenv,omitempty"` +} + +// RemotePolicyConfig configures a remote mixer instance for policy +type RemotePolicyConfig struct { + // Address represents the address of the mixer server. + // .Values.global.remotePolicyAddress, maps to MeshConfig.mixerCheckServer + Address string `json:"address,omitempty"` + // CreateServices specifies whether or not a k8s Service should be created for the remote policy server. + // .Values.global.createRemoteSvcEndpoints + // +optional + CreateService *bool `json:"createService,omitempty"` + // EnableChecks configures whether or not policy checks should be enabled. + // .Values.global.disablePolicyChecks | default "true" (false, inverted logic) + // Set the following variable to false to disable policy checks by the Mixer. + // Note that metrics will still be reported to the Mixer. + // +optional + EnableChecks *bool `json:"enableChecks,omitempty"` + // FailOpen configures policy checks to fail if mixer cannot be reached. + // .Values.global.policyCheckFailOpen, maps to MeshConfig.policyCheckFailOpen + // policyCheckFailOpen allows traffic in cases when the mixer policy service cannot be reached. + // Default is false which means the traffic is denied when the client is unable to connect to Mixer. + // +optional + FailOpen *bool `json:"failOpen,omitempty"` +} diff --git a/api/external/maistra/v2/prometheus.go b/api/external/maistra/v2/prometheus.go new file mode 100644 index 000000000..8be51b888 --- /dev/null +++ b/api/external/maistra/v2/prometheus.go @@ -0,0 +1,58 @@ +package v2 + +// PrometheusAddonConfig configures a prometheus instance to be used by the +// control plane. Only one of Install or Address may be specified +type PrometheusAddonConfig struct { + Enablement `json:",inline"` + // MetricsExpiryDuration is the duration to hold metrics. (mixer/v1 only) + // .Values.mixer.adapters.prometheus.metricsExpiryDuration, defaults to 10m + // +optional + MetricsExpiryDuration string `json:"metricsExpiryDuration,omitempty"` + // Scrape metrics from the pod if true. (maistra-2.0+) + // defaults to true + // .Values.meshConfig.enablePrometheusMerge + // +optional + Scrape *bool `json:"scrape,omitempty"` + // Install configuration if not using an existing prometheus installation. + // .Values.prometheus.enabled, if not null + // +optional + Install *PrometheusInstallConfig `json:"install,omitempty"` + // Address of existing prometheus installation + // implies .Values.kiali.prometheusAddr + // XXX: do we need to do anything to configure credentials for accessing + // the prometheus server? + // +optional + Address *string `json:"address,omitempty"` +} + +// PrometheusInstallConfig represents the configuration to be applied when +// installing a new instance of prometheus for use with the mesh. +type PrometheusInstallConfig struct { + // SelfManaged specifies whether or not the entire install should be managed + // by Maistra (true) or the Prometheus operator (false, not supported). + // Governs use of either prometheus charts or prometheusOperator charts. + // +optional + SelfManaged bool `json:"selfManaged,omitempty"` + // Retention specifies how long metrics should be retained by prometheus. + // .Values.prometheus.retention, defaults to 6h + // +optional + Retention string `json:"retention,omitempty"` + // ScrapeInterval specifies how frequently prometheus should scrape pods for + // metrics. + // .Values.prometheus.scrapeInterval, defaults to 15s + // +optional + ScrapeInterval string `json:"scrapeInterval,omitempty"` + // Service allows for customization of the k8s Service associated with the + // prometheus installation. + // +optional + Service *ComponentServiceConfig `json:"service,omitempty"` + // UseTLS for the prometheus server + // .Values.prometheus.provisionPrometheusCert + // 1.6+ + // ProvisionCert bool + // this seems to overlap with provision cert, as this manifests something similar to the above + // .Values.prometheus.security.enabled, version < 1.6 + // EnableSecurity bool + // +optional + UseTLS *bool `json:"useTLS,omitempty"` +} diff --git a/api/external/maistra/v2/proxy.go b/api/external/maistra/v2/proxy.go new file mode 100644 index 000000000..afb810d01 --- /dev/null +++ b/api/external/maistra/v2/proxy.go @@ -0,0 +1,387 @@ +package v2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ProxyConfig configures the default sidecar behavior for workloads. +type ProxyConfig struct { + // Logging configures logging for the sidecar. + // e.g. .Values.global.proxy.logLevel + // +optional + Logging *ProxyLoggingConfig `json:"logging,omitempty"` + // Networking represents network settings to be configured for the sidecars. + // +optional + Networking *ProxyNetworkingConfig `json:"networking,omitempty"` + // Runtime is used to customize runtime configuration for the sidecar container. + // +optional + Runtime *ProxyRuntimeConfig `json:"runtime,omitempty"` + // Injection is used to customize sidecar injection for the mesh. + // +optional + Injection *ProxyInjectionConfig `json:"injection,omitempty"` + // AdminPort configures the admin port exposed by the sidecar. + // maps to defaultConfig.proxyAdminPort, defaults to 15000 + // XXX: currently not configurable in charts + // +optional + AdminPort int32 `json:"adminPort,omitempty"` + // Concurrency configures the number of threads that should be run by the sidecar. + // .Values.global.proxy.concurrency, maps to defaultConfig.concurrency + // XXX: removed in 1.7 + // XXX: this is defaulted to 2 in our values.yaml, but should probably be 0 + // +optional + Concurrency *int32 `json:"concurrency,omitempty"` + // AccessLogging configures access logging for proxies. + // +optional + AccessLogging *ProxyAccessLoggingConfig `json:"accessLogging,omitempty"` + // EnvoyMetricsService configures reporting of Envoy metrics to an external + // service. + // .Values.global.proxy.envoyMetricsService + // +optional + EnvoyMetricsService *ProxyEnvoyServiceConfig `json:"envoyMetricsService,omitempty"` +} + +// ProxyNetworkingConfig is used to configure networking aspects of the sidecar. +type ProxyNetworkingConfig struct { + // ClusterDomain represents the domain for the cluster, defaults to cluster.local + // .Values.global.proxy.clusterDomain + // +optional + ClusterDomain string `json:"clusterDomain,omitempty"` + // maps to meshConfig.defaultConfig.connectionTimeout, defaults to 10s + // XXX: currently not exposed through values.yaml + // +optional + ConnectionTimeout string `json:"connectionTimeout,omitempty"` + // MaxConnectionAge limits how long a sidecar can be connected to pilot. + // This may be used to balance load across pilot instances, at the cost of + // system churn. + // .Values.pilot.keepaliveMaxServerConnectionAge + // +optional + MaxConnectionAge string `json:"maxConnectionAge,omitempty"` + // Initialization is used to specify how the pod's networking through the + // proxy is initialized. This configures the use of CNI or an init container. + // +optional + Initialization *ProxyNetworkInitConfig `json:"initialization,omitempty"` + // TrafficControl configures what network traffic is routed through the proxy. + // +optional + TrafficControl *ProxyTrafficControlConfig `json:"trafficControl,omitempty"` + // Protocol configures how the sidecar works with application protocols. + // +optional + Protocol *ProxyNetworkProtocolConfig `json:"protocol,omitempty"` + // DNS configures aspects of the sidecar's usage of DNS + // +optional + DNS *ProxyDNSConfig `json:"dns,omitempty"` +} + +// ProxyNetworkInitConfig is used to configure how the pod's networking through +// the proxy is initialized. +type ProxyNetworkInitConfig struct { + // Type of the network initialization implementation. + Type ProxyNetworkInitType `json:"type,omitempty"` + // InitContainer configures the use of a pod init container for initializing + // the pod's networking. + // istio_cni.enabled = false, if InitContainer is used + // +optional + InitContainer *ProxyInitContainerConfig `json:"initContainer,omitempty"` +} + +// ProxyNetworkInitType represents the type of initializer to use for network initialization +type ProxyNetworkInitType string + +const ( + // ProxyNetworkInitTypeCNI to use CNI for network initialization + ProxyNetworkInitTypeCNI ProxyNetworkInitType = "CNI" + // ProxyNetworkInitTypeInitContainer to use an init container for network initialization + ProxyNetworkInitTypeInitContainer ProxyNetworkInitType = "InitContainer" +) + +// ProxyInitContainerConfig configures execution aspects for the init container +type ProxyInitContainerConfig struct { + // Runtime configures customization of the init container (e.g. resources) + // +optional + Runtime *ContainerConfig `json:"runtime,omitempty"` +} + +// ProxyTrafficControlConfig configures what and how traffic is routed through +// the sidecar. +type ProxyTrafficControlConfig struct { + // Inbound configures what inbound traffic is routed through the sidecar + // traffic.sidecar.istio.io/includeInboundPorts defaults to * (all ports) + // +optional + Inbound ProxyInboundTrafficControlConfig `json:"inbound,omitempty"` + // Outbound configures what outbound traffic is routed through the sidecar. + // +optional + Outbound ProxyOutboundTrafficControlConfig `json:"outbound,omitempty"` +} + +// ProxyNetworkInterceptionMode represents the InterceptMode types. +type ProxyNetworkInterceptionMode string + +const ( + // ProxyNetworkInterceptionModeRedirect requests iptables use REDIRECT to route inbound traffic through the sidecar. + ProxyNetworkInterceptionModeRedirect ProxyNetworkInterceptionMode = "REDIRECT" + // ProxyNetworkInterceptionModeTProxy requests iptables use TPROXY to route inbound traffic through the sidecar. + ProxyNetworkInterceptionModeTProxy ProxyNetworkInterceptionMode = "TPROXY" +) + +// ProxyInboundTrafficControlConfig configures what inbound traffic is +// routed through the sidecar. +type ProxyInboundTrafficControlConfig struct { + // InterceptionMode specifies how traffic is directed through the sidecar. + // maps to meshConfig.defaultConfig.interceptionMode, overridden by sidecar.istio.io/interceptionMode + // XXX: currently not configurable through values.yaml + // +optional + InterceptionMode ProxyNetworkInterceptionMode `json:"interceptionMode,omitempty"` + // IncludedPorts to be routed through the sidecar. * or comma separated list of integers + // .Values.global.proxy.includeInboundPorts, defaults to * (all ports), overridden by traffic.sidecar.istio.io/includeInboundPorts + // +optional + IncludedPorts []string `json:"includedPorts,omitempty"` + // ExcludedPorts to be routed around the sidecar. + // .Values.global.proxy.excludeInboundPorts, defaults to empty list, overridden by traffic.sidecar.istio.io/excludeInboundPorts + // +optional + ExcludedPorts []int32 `json:"excludedPorts,omitempty"` +} + +// ProxyOutboundTrafficControlConfig configure what outbound traffic is routed +// through the sidecar +type ProxyOutboundTrafficControlConfig struct { + // IncludedIPRanges specifies which outbound IP ranges should be routed through the sidecar. + // .Values.global.proxy.includeIPRanges, overridden by traffic.sidecar.istio.io/includeOutboundIPRanges + // * or comma separated list of CIDR + // +optional + IncludedIPRanges []string `json:"includedIPRanges,omitempty"` + // ExcludedIPRanges specifies which outbound IP ranges should _not_ be routed through the sidecar. + // .Values.global.proxy.excludeIPRanges, overridden by traffic.sidecar.istio.io/excludeOutboundIPRanges + // * or comma separated list of CIDR + // +optional + ExcludedIPRanges []string `json:"excludedIPRanges,omitempty"` + // ExcludedPorts specifies which outbound ports should _not_ be routed through the sidecar. + // .Values.global.proxy.excludeOutboundPorts, overridden by traffic.sidecar.istio.io/excludeOutboundPorts + // comma separated list of integers + // +optional + ExcludedPorts []int32 `json:"excludedPorts,omitempty"` + // Policy specifies what outbound traffic is allowed through the sidecar. + // .Values.global.outboundTrafficPolicy.mode + // +optional + Policy ProxyOutboundTrafficPolicy `json:"policy,omitempty"` +} + +// ProxyOutboundTrafficPolicy represents the outbound traffic policy type. +type ProxyOutboundTrafficPolicy string + +const ( + // ProxyOutboundTrafficPolicyAllowAny allows all traffic through the sidecar. + ProxyOutboundTrafficPolicyAllowAny ProxyOutboundTrafficPolicy = "ALLOW_ANY" + // ProxyOutboundTrafficPolicyRegistryOnly only allows traffic destined for a + // service in the service registry through the sidecar. This limits outbound + // traffic to only other services in the mesh. + ProxyOutboundTrafficPolicyRegistryOnly ProxyOutboundTrafficPolicy = "REGISTRY_ONLY" +) + +// ProxyNetworkProtocolConfig configures the sidecar's protocol handling. +type ProxyNetworkProtocolConfig struct { + // AutoDetect configures automatic detection of connection protocols. + // +optional + AutoDetect *ProxyNetworkAutoProtocolDetectionConfig `json:"autoDetect,omitempty"` +} + +// ProxyNetworkAutoProtocolDetectionConfig configures automatic protocol detection for the proxies. +type ProxyNetworkAutoProtocolDetectionConfig struct { + // DetectionTimeout specifies how much time the sidecar will spend determining + // the protocol being used for the connection before reverting to raw TCP. + // .Values.global.proxy.protocolDetectionTimeout, maps to protocolDetectionTimeout + // +optional + Timeout string `json:"timeout,omitempty"` + // EnableInboundSniffing enables protocol sniffing on inbound traffic. + // .Values.pilot.enableProtocolSniffingForInbound + // only supported for v1.1 + // +optional + Inbound *bool `json:"inbound,omitempty"` + // EnableOutboundSniffing enables protocol sniffing on outbound traffic. + // .Values.pilot.enableProtocolSniffingForOutbound + // only supported for v1.1 + // +optional + Outbound *bool `json:"outbound,omitempty"` +} + +// ProxyDNSConfig is used to configure aspects of the sidecar's DNS usage. +type ProxyDNSConfig struct { + // SearchSuffixes are additional search suffixes to be used when resolving + // names. + // .Values.global.podDNSSearchNamespaces + // Custom DNS config for the pod to resolve names of services in other + // clusters. Use this to add additional search domains, and other settings. + // see + // https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#dns-config + // This does not apply to gateway pods as they typically need a different + // set of DNS settings than the normal application pods (e.g., in + // multicluster scenarios). + // NOTE: If using templates, follow the pattern in the commented example below. + // podDNSSearchNamespaces: + // - global + // - "{{ valueOrDefault .DeploymentMeta.Namespace \"default\" }}.global" + // +optional + SearchSuffixes []string `json:"searchSuffixes,omitempty"` + // RefreshRate configures the DNS refresh rate for Envoy cluster of type STRICT_DNS + // This must be given it terms of seconds. For example, 300s is valid but 5m is invalid. + // .Values.global.proxy.dnsRefreshRate, default 300s + // +optional + RefreshRate string `json:"refreshRate,omitempty"` +} + +// ProxyRuntimeConfig customizes the runtime parameters of the sidecar container. +type ProxyRuntimeConfig struct { + // Readiness configures the readiness probe behavior for the injected pod. + // +optional + Readiness *ProxyReadinessConfig `json:"readiness,omitempty"` + // Container configures the sidecar container. + // +optional + Container *ContainerConfig `json:"container,omitempty"` +} + +// ProxyReadinessConfig configures the readiness probe for the sidecar. +type ProxyReadinessConfig struct { + // RewriteApplicationProbes specifies whether or not the injector should + // rewrite application container probes to be routed through the sidecar. + // .Values.sidecarInjectorWebhook.rewriteAppHTTPProbe, defaults to false + // rewrite probes for application pods to route through sidecar + // +optional + RewriteApplicationProbes bool `json:"rewriteApplicationProbes,omitempty"` + // StatusPort specifies the port number to be used for status. + // .Values.global.proxy.statusPort, overridden by status.sidecar.istio.io/port, defaults to 15020 + // Default port for Pilot agent health checks. A value of 0 will disable health checking. + // XXX: this has no affect on which port is actually used for status. + // +optional + StatusPort int32 `json:"statusPort,omitempty"` + // InitialDelaySeconds specifies the initial delay for the readiness probe + // .Values.global.proxy.readinessInitialDelaySeconds, overridden by readiness.status.sidecar.istio.io/initialDelaySeconds, defaults to 1 + // +optional + InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"` + // PeriodSeconds specifies the period over which the probe is checked. + // .Values.global.proxy.readinessPeriodSeconds, overridden by readiness.status.sidecar.istio.io/periodSeconds, defaults to 2 + // +optional + PeriodSeconds int32 `json:"periodSeconds,omitempty"` + // FailureThreshold represents the number of consecutive failures before the container is marked as not ready. + // .Values.global.proxy.readinessFailureThreshold, overridden by readiness.status.sidecar.istio.io/failureThreshold, defaults to 30 + // +optional + FailureThreshold int32 `json:"failureThreshold,omitempty"` +} + +// ProxyInjectionConfig configures sidecar injection for the mesh. +type ProxyInjectionConfig struct { + // AutoInject configures automatic injection of sidecar proxies + // .Values.global.proxy.autoInject + // .Values.sidecarInjectorWebhook.enableNamespacesByDefault + // +optional + AutoInject *bool `json:"autoInject,omitempty"` + // AlwaysInjectSelector allows specification of a label selector that when + // matched will always inject a sidecar into the pod. + // .Values.sidecarInjectorWebhook.alwaysInjectSelector + // +optional + AlwaysInjectSelector []metav1.LabelSelector `json:"alwaysInjectSelector,omitempty"` + // NeverInjectSelector allows specification of a label selector that when + // matched will never inject a sidecar into the pod. This takes precedence + // over AlwaysInjectSelector. + // .Values.sidecarInjectorWebhook.neverInjectSelector + // +optional + NeverInjectSelector []metav1.LabelSelector `json:"neverInjectSelector,omitempty"` + // InjectedAnnotations allows specification of additional annotations to be + // added to pods that have sidecars injected in them. + // .Values.sidecarInjectorWebhook.injectedAnnotations + // +optional + InjectedAnnotations map[string]string `json:"injectedAnnotations,omitempty"` +} + +// ProxyAccessLoggingConfig configures access logging for proxies. Multiple +// access logs can be configured. +type ProxyAccessLoggingConfig struct { + // File configures access logging to the file system + // +optional + File *ProxyFileAccessLogConfig `json:"file,omitempty"` + // File configures access logging to an envoy service + // .Values.global.proxy.envoyAccessLogService + // +optional + EnvoyService *ProxyEnvoyServiceConfig `json:"envoyService,omitempty"` +} + +// ProxyFileAccessLogConfig configures details related to file access log +type ProxyFileAccessLogConfig struct { + // Name is the name of the file to which access log entries will be written. + // If Name is not specified, no log entries will be written to a file. + // .Values.global.proxy.accessLogFile + // +optional + Name string `json:"name,omitempty"` + // Encoding to use when writing access log entries. Currently, JSON or TEXT + // may be specified. + // .Values.global.proxy.accessLogEncoding + // +optional + Encoding string `json:"encoding,omitempty"` + // Format to use when writing access log entries. + // .Values.global.proxy.accessLogFormat + // +optional + Format string `json:"format,omitempty"` +} + +// ProxyEnvoyServiceConfig configures reporting to an external Envoy service. +type ProxyEnvoyServiceConfig struct { + // Enable sending Envoy metrics to the service. + // .Values.global.proxy.(envoyAccessLogService|envoyMetricsService).enabled + Enablement `json:",inline"` + // Address of the service specified as host:port. + // .Values.global.proxy.(envoyAccessLogService|envoyMetricsService).host + // .Values.global.proxy.(envoyAccessLogService|envoyMetricsService).port + // +optional + Address string `json:"address,omitempty"` + // TCPKeepalive configures keepalive settings to use when connecting to the + // service. + // .Values.global.proxy.(envoyAccessLogService|envoyMetricsService).tcpKeepalive + // +optional + TCPKeepalive *EnvoyServiceTCPKeepalive `json:"tcpKeepalive,omitempty"` + // TLSSettings configures TLS settings to use when connecting to the service. + // .Values.global.proxy.(envoyAccessLogService|envoyMetricsService).tlsSettings + // +optional + TLSSettings *EnvoyServiceClientTLSSettings `json:"tlsSettings,omitempty"` +} + +// EnvoyServiceTCPKeepalive configures keepalive settings for the Envoy service. +// Provides the same interface as networking.v1alpha3.istio.io, ConnectionPoolSettings_TCPSettings_TcpKeepalive +type EnvoyServiceTCPKeepalive struct { + // Probes represents the number of successive probe failures after which the + // connection should be considered "dead." + // +optional + Probes uint32 `json:"probes,omitempty"` + // Time represents the length of idle time that must elapse before a probe + // is sent. + // +optional + Time string `json:"time,omitempty"` + // Interval represents the interval between probes. + // +optional + Interval string `json:"interval,omitempty"` +} + +// EnvoyServiceClientTLSSettings configures TLS settings for the Envoy service. +// Provides the same interface as networking.v1alpha3.istio.io, ClientTLSSettings +type EnvoyServiceClientTLSSettings struct { + // Mode represents the TLS mode to apply to the connection. The following + // values are supported: DISABLE, SIMPLE, MUTUAL, ISTIO_MUTUAL + // +optional + Mode string `json:"mode,omitempty"` + // ClientCertificate represents the file name containing the client certificate + // to show to the Envoy service, e.g. /etc/istio/als/cert-chain.pem + // +optional + ClientCertificate string `json:"clientCertificate,omitempty"` + // PrivateKey represents the file name containing the private key used by + // the client, e.g. /etc/istio/als/key.pem + // +optional + PrivateKey string `json:"privateKey,omitempty"` + // CACertificates represents the file name containing the root certificates + // for the CA, e.g. /etc/istio/als/root-cert.pem + // +optional + CACertificates string `json:"caCertificates,omitempty"` + // SNIHost represents the host name presented to the server during TLS + // handshake, e.g. als.somedomain + // +optional + SNIHost string `json:"sni,omitempty"` + // SubjectAltNames represents the list of alternative names that may be used + // to verify the servers identity, e.g. [als.someotherdomain] + // +optional + SubjectAltNames []string `json:"subjectAltNames,omitempty"` +} diff --git a/api/external/maistra/v2/register.go b/api/external/maistra/v2/register.go new file mode 100644 index 000000000..5ab21faf7 --- /dev/null +++ b/api/external/maistra/v2/register.go @@ -0,0 +1,26 @@ +// NOTE: Boilerplate only. Ignore this file. + +// Package v2 contains API Schema definitions for the maistra v2 API group +// +k8s:deepcopy-gen=package,register +// +groupName=maistra.io +package v2 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +const ( + // APIGroup for maistr.io + APIGroup = "maistra.io" + // APIVersion for v2 + APIVersion = "v2" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: APIGroup, Version: APIVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} +) diff --git a/api/external/maistra/v2/runtime.go b/api/external/maistra/v2/runtime.go new file mode 100644 index 000000000..38733ef4d --- /dev/null +++ b/api/external/maistra/v2/runtime.go @@ -0,0 +1,344 @@ +package v2 + +import ( + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + v1 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v1" +) + +// ControlPlaneRuntimeConfig configures execution parameters for control plane +// componets. +type ControlPlaneRuntimeConfig struct { + // Components allows specifying execution parameters for specific control plane + // componets. The key of the map is the component name to which the settings + // should be applied. + // +optional + Components map[ControlPlaneComponentName]*ComponentRuntimeConfig `json:"components,omitempty"` + // Defaults will be merged into specific component config. + // .Values.global.defaultResources, e.g. + // +optional + Defaults *DefaultRuntimeConfig `json:"defaults,omitempty"` +} + +// ControlPlaneComponentName simple type for control plane component names +type ControlPlaneComponentName string + +const ( + // ControlPlaneComponentNameSecurity - security (citadel) + ControlPlaneComponentNameSecurity ControlPlaneComponentName = "security" + // ControlPlaneComponentNameGalley - galley + ControlPlaneComponentNameGalley ControlPlaneComponentName = "galley" + // ControlPlaneComponentNamePilot - pilot + ControlPlaneComponentNamePilot ControlPlaneComponentName = "pilot" + // ControlPlaneComponentNameMixer - mixer + ControlPlaneComponentNameMixer ControlPlaneComponentName = "mixer" + // ControlPlaneComponentNameMixerPolicy - mixer.policy + ControlPlaneComponentNameMixerPolicy ControlPlaneComponentName = "mixer.policy" + // ControlPlaneComponentNameMixerTelemetry - mixer.telemetry + ControlPlaneComponentNameMixerTelemetry ControlPlaneComponentName = "mixer.telemetry" + // ControlPlaneComponentNameGlobalOauthProxy - global.oauthproxy + ControlPlaneComponentNameGlobalOauthProxy ControlPlaneComponentName = "global.oauthproxy" + // ControlPlaneComponentNameSidecarInjectoryWebhook - sidecarInjectorWebhook + ControlPlaneComponentNameSidecarInjectoryWebhook ControlPlaneComponentName = "sidecarInjectorWebhook" + // ControlPlaneComponentNameTracing - tracing + ControlPlaneComponentNameTracing ControlPlaneComponentName = "tracing" + // ControlPlaneComponentNameTracingJaeger - tracing.jaeger + ControlPlaneComponentNameTracingJaeger ControlPlaneComponentName = "tracing.jaeger" + // ControlPlaneComponentNameTracingJaegerElasticsearch - tracing.jaeger.elasticsearch + ControlPlaneComponentNameTracingJaegerElasticsearch ControlPlaneComponentName = "tracing.jaeger.elasticsearch" + // ControlPlaneComponentNameTracingJaegerAgent - tracing.jaeger.agent + ControlPlaneComponentNameTracingJaegerAgent ControlPlaneComponentName = "tracing.jaeger.agent" + // ControlPlaneComponentNameTracingJaegerAllInOne - tracing.jaeger.allInOne + ControlPlaneComponentNameTracingJaegerAllInOne ControlPlaneComponentName = "tracing.jaeger.allInOne" + // ControlPlaneComponentNameTracingJaegerCollector - tracing.jaeger.collector + ControlPlaneComponentNameTracingJaegerCollector ControlPlaneComponentName = "tracing.jaeger.collector" + // ControlPlaneComponentNameTracingJaegerQuery - tracing.jaeger.query + ControlPlaneComponentNameTracingJaegerQuery ControlPlaneComponentName = "tracing.jaeger.query" + // ControlPlaneComponentNamePrometheus - prometheus + ControlPlaneComponentNamePrometheus ControlPlaneComponentName = "prometheus" + // ControlPlaneComponentNameKiali - kiali + ControlPlaneComponentNameKiali ControlPlaneComponentName = "kiali" + // ControlPlaneComponentNameGrafana - grafana + ControlPlaneComponentNameGrafana ControlPlaneComponentName = "grafana" + // ControlPlaneComponentNameThreeScale - 3scale + ControlPlaneComponentNameThreeScale ControlPlaneComponentName = "3scale" + // ControlPlaneComponentNameWASMCacher - wasm-extensions cacher + ControlPlaneComponentNameWASMCacher ControlPlaneComponentName = "wasmExtensions.cacher" + // ControlPlaneComponentNameRateLimiting - rateLimiting + ControlPlaneComponentNameRateLimiting ControlPlaneComponentName = "rateLimiting.rls" +) + +// ControlPlaneComponentNames - supported runtime components +var ControlPlaneComponentNames = []ControlPlaneComponentName{ + ControlPlaneComponentNameSecurity, + ControlPlaneComponentNameGalley, + ControlPlaneComponentNamePilot, + ControlPlaneComponentNameMixer, + ControlPlaneComponentNameMixerPolicy, + ControlPlaneComponentNameMixerTelemetry, + ControlPlaneComponentNameGlobalOauthProxy, + ControlPlaneComponentNameSidecarInjectoryWebhook, + ControlPlaneComponentNameTracing, + ControlPlaneComponentNameTracingJaeger, + ControlPlaneComponentNameTracingJaegerElasticsearch, + ControlPlaneComponentNameTracingJaegerAgent, + ControlPlaneComponentNameTracingJaegerAllInOne, + ControlPlaneComponentNameTracingJaegerCollector, + ControlPlaneComponentNameTracingJaegerQuery, + ControlPlaneComponentNamePrometheus, + ControlPlaneComponentNameKiali, + ControlPlaneComponentNameGrafana, + ControlPlaneComponentNameThreeScale, + ControlPlaneComponentNameWASMCacher, + ControlPlaneComponentNameRateLimiting, +} + +// ComponentRuntimeConfig allows for partial customization of a component's +// runtime configuration (Deployment, PodTemplate, auto scaling, pod disruption, etc.) +type ComponentRuntimeConfig struct { + // Deployment specific overrides + // +optional + Deployment *DeploymentRuntimeConfig `json:"deployment,omitempty"` + + // Pod specific overrides + // +optional + Pod *PodRuntimeConfig `json:"pod,omitempty"` + + // .Values.*.resource, imagePullPolicy, etc. + // +optional + Container *ContainerConfig `json:"container,omitempty"` +} + +// DeploymentRuntimeConfig allow customization of a component's Deployment +// resource, including additional labels/annotations, replica count, autoscaling, +// rollout strategy, etc. +type DeploymentRuntimeConfig struct { + // Number of desired pods. This is a pointer to distinguish between explicit + // zero and not specified. Defaults to 1. + // +optional + // .Values.*.replicaCount + Replicas *int32 `json:"replicas,omitempty"` + + // The deployment strategy to use to replace existing pods with new ones. + // +optional + // +patchStrategy=retainKeys + // .Values.*.rollingMaxSurge, rollingMaxUnavailable, etc. + Strategy *appsv1.DeploymentStrategy `json:"strategy,omitempty" patchStrategy:"retainKeys"` + + // Autoscaling specifies the configuration for a HorizontalPodAutoscaler + // to be applied to this deployment. Null indicates no auto scaling. + // .Values.*.autoscale* fields + // +optional + AutoScaling *AutoScalerConfig `json:"autoScaling,omitempty"` +} + +// CommonDeploymentRuntimeConfig represents deployment settings common to both +// default and component specific settings +type CommonDeploymentRuntimeConfig struct { + // .Values.global.podDisruptionBudget.enabled, if not null + // XXX: this is currently a global setting, not per component. perhaps + // this should only be available on the defaults? + // +optional + PodDisruption *PodDisruptionBudget `json:"podDisruption,omitempty"` +} + +// AutoScalerConfig is used to configure autoscaling for a deployment +type AutoScalerConfig struct { + Enablement `json:",inline"` + // lower limit for the number of pods that can be set by the autoscaler, default 1. + // +optional + MinReplicas *int32 `json:"minReplicas,omitempty"` + // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. + // +optional + MaxReplicas *int32 `json:"maxReplicas,omitempty"` + // target average CPU utilization (represented as a percentage of requested CPU) over all the pods; + // if not specified the default autoscaling policy will be used. + // +optional + TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"` +} + +// PodRuntimeConfig is used to customize pod configuration for a component +type PodRuntimeConfig struct { + CommonPodRuntimeConfig `json:",inline"` + + // Metadata allows additional annotations/labels to be applied to the pod + // .Values.*.podAnnotations + // XXX: currently, additional lables are not supported + // +optional + Metadata *MetadataConfig `json:"metadata,omitempty"` + + // If specified, the pod's scheduling constraints + // +optional + // .Values.podAntiAffinityLabelSelector, podAntiAffinityTermLabelSelector, nodeSelector + // NodeAffinity is not supported at this time + // PodAffinity is not supported at this time + Affinity *Affinity `json:"affinity,omitempty"` +} + +// CommonPodRuntimeConfig represents pod settings common to both defaults and +// component specific configuration +type CommonPodRuntimeConfig struct { + // NodeSelector is a selector which must be true for the pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + // .Values.nodeSelector + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + + // If specified, the pod's tolerations. + // +optional + // .Values.tolerations + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + + // .Values.global.priorityClassName + // XXX: currently, this is only a global setting. maybe only allow setting in global runtime defaults? + // +optional + PriorityClassName string `json:"priorityClassName,omitempty"` +} + +// Affinity is the structure used by Istio for specifying Pod affinity +// XXX: istio does not support full corev1.Affinity settings, hence the special +// types here. +type Affinity struct { + // +optional + NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty"` + // +optional + PodAffinity *corev1.PodAffinity `json:"podAffinity,omitempty"` + // XXX: use corev1.PodAntiAffinity instead, the only things not supported are namespaces and weighting + // +optional + PodAntiAffinity PodAntiAffinity `json:"podAntiAffinity,omitempty"` +} + +// PodAntiAffinity configures anti affinity for pod scheduling +type PodAntiAffinity struct { + *corev1.PodAntiAffinity `json:",inline"` + + // +optional + RequiredDuringScheduling []PodAntiAffinityTerm `json:"requiredDuringScheduling,omitempty"` + // +optional + PreferredDuringScheduling []PodAntiAffinityTerm `json:"preferredDuringScheduling,omitempty"` +} + +// PodAntiAffinityTerm is a simplified version of corev1.PodAntiAffinityTerm +type PodAntiAffinityTerm struct { + metav1.LabelSelectorRequirement `json:",inline"` + // This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching + // the labelSelector in the specified namespaces, where co-located is defined as running on a node + // whose value of the label with key topologyKey matches that of any node on which any of the + // selected pods is running. + // Empty topologyKey is not allowed. + // +optional + TopologyKey string `json:"topologyKey,omitempty"` +} + +// ContainerConfig to be applied to containers in a pod, in a deployment +type ContainerConfig struct { + CommonContainerConfig `json:",inline"` + // +optional + Image string `json:"imageName,omitempty"` + // +optional + Env map[string]string `json:"env,omitempty"` +} + +// CommonContainerConfig represents container settings common to both defaults +// and component specific configuration. +type CommonContainerConfig struct { + // +optional + ImageRegistry string `json:"imageRegistry,omitempty"` + // +optional + ImageTag string `json:"imageTag,omitempty"` + // +optional + ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + // +optional + ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` + // +optional + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` +} + +// PodDisruptionBudget details +// XXX: currently only configurable globally (i.e. no component values.yaml equivalent) +type PodDisruptionBudget struct { + Enablement `json:",inline"` + // +optional + MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` + // +optional + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` +} + +// DefaultRuntimeConfig specifies default execution parameters to apply to +// control plane deployments/pods when no specific component overrides have been +// specified. These settings will be merged with component specific settings. +type DefaultRuntimeConfig struct { + // Deployment defaults + // +optional + Deployment *CommonDeploymentRuntimeConfig `json:"deployment,omitempty"` + // Pod defaults + // +optional + Pod *CommonPodRuntimeConfig `json:"pod,omitempty"` + // Container overrides to be merged with component specific overrides. + // +optional + Container *CommonContainerConfig `json:"container,omitempty"` +} + +// MetadataConfig represents additional metadata to be applied to resources +type MetadataConfig struct { + // +optional + Labels map[string]string `json:"labels,omitempty"` + // +optional + Annotations map[string]string `json:"annotations,omitempty"` +} + +// ComponentServiceConfig is used to customize the service associated with a component. +type ComponentServiceConfig struct { + // Metadata represents additional annotations/labels to be applied to the + // component's service. + // +optional + Metadata *MetadataConfig `json:"metadata,omitempty"` + // NodePort specifies a NodePort for the component's Service. + // .Values..service.nodePort.port, ...enabled is true if not null + // +optional + NodePort *int32 `json:"nodePort,omitempty"` + // Ingress specifies details for accessing the component's service through + // a k8s Ingress or OpenShift Route. + // +optional + Ingress *ComponentIngressConfig `json:"ingress,omitempty"` +} + +// ComponentIngressConfig is used to customize a k8s Ingress or OpenShift Route +// for the service associated with a component. +type ComponentIngressConfig struct { + Enablement `json:",inline"` + // Metadata represents additional metadata to be applied to the ingress/route. + // +optional + Metadata *MetadataConfig `json:"metadata,omitempty"` + // Hosts represents a list of host names to configure. Note, OpenShift route + // only supports a single host name per route. An empty host name implies + // a default host name for the Route. + // XXX: is a host name required for k8s Ingress? + // +optional + Hosts []string `json:"hosts,omitempty"` + // ContextPath represents the context path to the service. + // +optional + ContextPath string `json:"contextPath,omitempty"` + // TLS is used to configure TLS for the Ingress/Route + // XXX: should this be something like RawExtension, as the configuration differs between Route and Ingress? + // +optional + TLS *v1.HelmValues `json:"tls,omitempty"` +} + +// ComponentPersistenceConfig is used to configure persistence for a component. +type ComponentPersistenceConfig struct { + Enablement `json:",inline"` + // StorageClassName for the PersistentVolumeClaim + // +optional + StorageClassName string `json:"storageClassName,omitempty"` + // AccessMode for the PersistentVolumeClaim + // +optional + AccessMode corev1.PersistentVolumeAccessMode `json:"accessMode,omitempty"` + // Resources to request for the PersistentVolumeClaim + // +optional + Resources *corev1.ResourceRequirements `json:"capacity,omitempty"` +} diff --git a/api/external/maistra/v2/security.go b/api/external/maistra/v2/security.go new file mode 100644 index 000000000..0147f5c6b --- /dev/null +++ b/api/external/maistra/v2/security.go @@ -0,0 +1,295 @@ +package v2 + +// SecurityConfig specifies security aspects of the control plane. +type SecurityConfig struct { + // Trust configures trust aspects associated with mutual TLS clients. + // +optional + Trust *TrustConfig `json:"trust,omitempty"` + // CertificateAuthority configures the certificate authority used by the + // control plane to create and sign client certs and server keys. + // +optional + CertificateAuthority *CertificateAuthorityConfig `json:"certificateAuthority,omitempty"` + // Identity configures the types of user tokens used by clients. + // +optional + Identity *IdentityConfig `json:"identity,omitempty"` + // ControlPlane configures mutual TLS for control plane communication. + // +optional + ControlPlane *ControlPlaneSecurityConfig `json:"controlPlane,omitempty"` + // DataPlane configures mutual TLS for data plane communication. + // +optional + DataPlane *DataPlaneSecurityConfig `json:"dataPlane,omitempty"` + // Manages network policies that allows communication between namespace members and control plane, defaults to `true` + // If false, operator does not create any NetworkPolicy resource, and users are responsible for managing them + // .Values.global.manageNetworkPolicy + // +optional + ManageNetworkPolicy *bool `json:"manageNetworkPolicy,omitempty"` + // JwksResolverCA is the configuration for injecting a trusted CA into the JWKSResolver. + // +optional + JwksResolverCA string `json:"jwksResolverCA,omitempty"` +} + +// TrustConfig configures trust aspects associated with mutual TLS clients +type TrustConfig struct { + // Domain specifies the trust domain to be used by the mesh. + // .Values.global.trustDomain, maps to trustDomain + // The trust domain corresponds to the trust root of a system. + // Refer to https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md#21-trust-domain + // +optional + Domain string `json:"domain,omitempty"` + // AdditionalDomains are additional SPIFFE trust domains that are accepted as trusted. + // .Values.global.trustDomainAliases, maps to trustDomainAliases + // Any service with the identity "td1/ns/foo/sa/a-service-account", "td2/ns/foo/sa/a-service-account", + // or "td3/ns/foo/sa/a-service-account" will be treated the same in the Istio mesh. + // +optional + AdditionalDomains []string `json:"additionalDomains,omitempty"` +} + +// CertificateAuthorityConfig configures the certificate authority implementation +// used by the control plane. +type CertificateAuthorityConfig struct { + // Type is the certificate authority to use. + Type CertificateAuthorityType `json:"type,omitempty"` + // Istiod is the configuration for Istio's internal certificate authority implementation. + // each of these produces a CAEndpoint, i.e. CA_ADDR + // +optional + Istiod *IstiodCertificateAuthorityConfig `json:"istiod,omitempty"` + // Custom is the configuration for a custom certificate authority. + // +optional + Custom *CustomCertificateAuthorityConfig `json:"custom,omitempty"` + CertManager *CertManagerCertificateAuthorityConfig `json:"cert-manager,omitempty"` +} + +// CertificateAuthorityType represents the type of CertificateAuthority implementation. +type CertificateAuthorityType string + +const ( + // CertificateAuthorityTypeIstiod represents Istio's internal certificate authority implementation + CertificateAuthorityTypeIstiod CertificateAuthorityType = "Istiod" + // CertificateAuthorityTypeCustom represents a custom certificate authority implementation + CertificateAuthorityTypeCustom CertificateAuthorityType = "Custom" + // CertificateAuthorityTypeCertManager represents a cert-manager istio-csr certificate authority implementation + CertificateAuthorityTypeCertManager CertificateAuthorityType = "cert-manager" +) + +// IstiodCertificateAuthorityConfig is the configuration for Istio's internal +// certificate authority implementation. +type IstiodCertificateAuthorityConfig struct { + // Type of certificate signer to use. + Type IstioCertificateSignerType `json:"type,omitempty"` + // SelfSigned configures istiod to generate and use a self-signed certificate for the root. + // +optional + SelfSigned *IstioSelfSignedCertificateSignerConfig `json:"selfSigned,omitempty"` + // PrivateKey configures istiod to use a user specified private key/cert when signing certificates. + // +optional + PrivateKey *IstioPrivateKeyCertificateSignerConfig `json:"privateKey,omitempty"` + // WorkloadCertTTLDefault is the default TTL for generated workload + // certificates. Used if not specified in CSR (<= 0) + // env DEFAULT_WORKLOAD_CERT_TTL, 1.6 + // --workload-cert-ttl, citadel, pre-1.6 + // defaults to 24 hours + // +optional + WorkloadCertTTLDefault string `json:"workloadCertTTLDefault,omitempty"` + // WorkloadCertTTLMax is the maximum TTL for generated workload certificates. + // env MAX_WORKLOAD_CERT_TTL + // --max-workload-cert-ttl, citadel, pre-1.6 + // defaults to 90 days + // +optional + WorkloadCertTTLMax string `json:"workloadCertTTLMax,omitempty"` +} + +// IstioCertificateSignerType represents the certificate signer implementation used by istiod. +type IstioCertificateSignerType string + +const ( + // IstioCertificateSignerTypePrivateKey is the signer type used when signing with a user specified private key. + IstioCertificateSignerTypePrivateKey IstioCertificateSignerType = "PrivateKey" + // IstioCertificateSignerTypeSelfSigned is the signer type used when signing with a generated, self-signed certificate. + IstioCertificateSignerTypeSelfSigned IstioCertificateSignerType = "SelfSigned" +) + +// IstioSelfSignedCertificateSignerConfig is the configuration for using a +// self-signed root certificate. +type IstioSelfSignedCertificateSignerConfig struct { + // TTL for self-signed root certificate + // env CITADEL_SELF_SIGNED_CA_CERT_TTL + // default is 10 years + // +optional + TTL string `json:"ttl,omitempty"` + // GracePeriod percentile for self-signed cert + // env CITADEL_SELF_SIGNED_ROOT_CERT_GRACE_PERIOD_PERCENTILE + // default is 20% + // +optional + GracePeriod string `json:"gracePeriod,omitempty"` + // CheckPeriod is the interval with which certificate is checked for rotation + // env CITADEL_SELF_SIGNED_ROOT_CERT_CHECK_INTERVAL + // default is 1 hour, zero or negative value disables cert rotation + // +optional + CheckPeriod string `json:"checkPeriod,omitempty"` + // EnableJitter to use jitter for cert rotation + // env CITADEL_ENABLE_JITTER_FOR_ROOT_CERT_ROTATOR + // defaults to true + // +optional + EnableJitter *bool `json:"enableJitter,omitempty"` + // Org is the Org value in the certificate. + // XXX: currently uses TrustDomain. I don't think this is configurable. + // +optional + // Org string `json:"org,omitempty"` +} + +// IstioPrivateKeyCertificateSignerConfig is the configuration when using a user +// supplied private key/cert for signing. +// XXX: nothing in here is currently configurable, except RootCADir +type IstioPrivateKeyCertificateSignerConfig struct { + // hard coded to use a secret named cacerts + // +optional + // EncryptionSecret string `json:"encryptionSecret,omitempty"` + // ROOT_CA_DIR, defaults to /etc/cacerts + // Mount directory for encryption secret + // XXX: currently, not configurable in the charts + // +optional + RootCADir string `json:"rootCADir,omitempty"` + // hard coded to ca-key.pem + // +optional + // SigningKeyFile string `json:"signingKeyFile,omitempty"` + // hard coded to ca-cert.pem + // +optional + // SigningCertFile string `json:"signingCertFile,omitempty"` + // hard coded to root-cert.pem + // +optional + // RootCertFile string `json:"rootCertFile,omitempty"` + // hard coded to cert-chain.pem + // +optional + // CertChainFile string `json:"certChainFile,omitempty"` +} + +// CustomCertificateAuthorityConfig is the configuration for a custom +// certificate authority. +type CustomCertificateAuthorityConfig struct { + // Address is the grpc address for an Istio compatible certificate authority endpoint. + // .Values.global.caAddress + // XXX: assumption is this is a grpc endpoint that provides methods like istio.v1.auth.IstioCertificateService/CreateCertificate + Address string `json:"address,omitempty"` +} + +type CertManagerCertificateAuthorityConfig struct { + // Address is the grpc address for an Istio compatible certificate authority endpoint. + // .Values.global.caAddress + Address string `json:"address,omitempty"` + PilotCertSecretName string `json:"pilotSecretName,omitempty"` + RootCAConfigMapName string `json:"rootCAConfigMapName,omitempty"` +} + +// IdentityConfig configures the types of user tokens used by clients +type IdentityConfig struct { + // Type is the type of identity tokens being used. + // .Values.global.jwtPolicy + Type IdentityConfigType `json:"type,omitempty"` + // ThirdParty configures istiod to use a third-party token provider for + // identifying users. (basically uses a custom audience, e.g. istio-ca) + // XXX: this is only supported on OCP 4.4+ + // +optional + ThirdParty *ThirdPartyIdentityConfig `json:"thirdParty,omitempty"` +} + +// IdentityConfigType represents the identity implementation being used. +type IdentityConfigType string + +const ( + // IdentityConfigTypeKubernetes specifies Kubernetes as the token provider. + IdentityConfigTypeKubernetes IdentityConfigType = "Kubernetes" // first-party-jwt + // IdentityConfigTypeThirdParty specifies a third-party token provider. + IdentityConfigTypeThirdParty IdentityConfigType = "ThirdParty" // third-party-jwt +) + +// ThirdPartyIdentityConfig configures a third-party token provider for use with +// istiod. +type ThirdPartyIdentityConfig struct { + // TokenPath is the path to the token used to identify the workload. + // default /var/run/secrets/tokens/istio-token + // XXX: projects service account token with specified audience (istio-ca) + // XXX: not configurable + // +optional + // TokenPath string `json:"tokenPath,omitempty"` + + // Issuer is the URL of the issuer. + // env TOKEN_ISSUER, defaults to iss in specified token + // only supported in 1.6+ + // +optional + Issuer string `json:"issuer,omitempty"` + // Audience is the audience for whom the token is intended. + // env AUDIENCE + // .Values.global.sds.token.aud, defaults to istio-ca + // +optional + Audience string `json:"audience,omitempty"` +} + +// ControlPlaneSecurityConfig is the mutual TLS configuration specific to the +// control plane. +type ControlPlaneSecurityConfig struct { + // Enable mutual TLS for the control plane components. + // .Values.global.controlPlaneSecurityEnabled + // +optional + MTLS *bool `json:"mtls,omitempty"` + // CertProvider is the certificate authority used to generate the serving + // certificates for the control plane components. + // .Values.global.pilotCertProvider + // Provider used to generate serving certs for istiod (pilot) + // +optional + CertProvider ControlPlaneCertProviderType `json:"certProvider,omitempty"` + + // TLS configures aspects of TLS listeners created by control plane components. + // +optional + TLS *ControlPlaneTLSConfig `json:"tls,omitempty"` +} + +// DataPlaneSecurityConfig is the mutual TLS configuration specific to the +// control plane. +type DataPlaneSecurityConfig struct { + // Enable mutual TLS by default. + // .Values.global.mtls.enabled + MTLS *bool `json:"mtls,omitempty"` + // Auto configures the mesh to automatically detect whether or not mutual + // TLS is required for a specific connection. + // .Values.global.mtls.auto + // +optional + AutoMTLS *bool `json:"automtls,omitempty"` +} + +// ControlPlaneCertProviderType represents the provider used to generate serving +// certificates for the control plane. +type ControlPlaneCertProviderType string + +const ( + // ControlPlaneCertProviderTypeIstiod identifies istiod as the provider generating the serving certifications. + ControlPlaneCertProviderTypeIstiod ControlPlaneCertProviderType = "Istiod" + // ControlPlaneCertProviderTypeKubernetes identifies Kubernetes as the provider generating the serving certificates. + ControlPlaneCertProviderTypeKubernetes ControlPlaneCertProviderType = "Kubernetes" + // ControlPlaneCertProviderTypeCustom identifies a custom provider has generated the serving certificates. + // XXX: Not quite sure what this means. Presumably, the key and cert chain have been mounted specially + ControlPlaneCertProviderTypeCustom ControlPlaneCertProviderType = "Custom" +) + +// ControlPlaneTLSConfig configures settings on TLS listeners created by +// control plane components, e.g. webhooks, grpc (if mtls is enabled), etc. +type ControlPlaneTLSConfig struct { + // CipherSuites configures the cipher suites that are available for use by + // TLS listeners. + // .Values.global.tls.cipherSuites + // +optional + CipherSuites []string `json:"cipherSuites,omitempty"` + // ECDHCurves configures the ECDH curves that are available for use by + // TLS listeners. + // .Values.global.tls.ecdhCurves + // +optional + ECDHCurves []string `json:"ecdhCurves,omitempty"` + // MinProtocolVersion the minimum TLS version that should be supported by + // the listeners. + // .Values.global.tls.minProtocolVersion + // +optional + MinProtocolVersion string `json:"minProtocolVersion,omitempty"` + // MaxProtocolVersion the maximum TLS version that should be supported by + // the listeners. + // .Values.global.tls.maxProtocolVersion + // +optional + MaxProtocolVersion string `json:"maxProtocolVersion,omitempty"` +} diff --git a/api/external/maistra/v2/servicemeshcontrolplane_types.go b/api/external/maistra/v2/servicemeshcontrolplane_types.go new file mode 100644 index 000000000..a8dbd9163 --- /dev/null +++ b/api/external/maistra/v2/servicemeshcontrolplane_types.go @@ -0,0 +1,204 @@ +package v2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kuadrant/kuadrant-operator/api/external/maistra/status" + v1 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v1" +) + +const ( + ControlPlaneModeKey = "controlPlaneMode" + ControlPlaneModeValueClusterScoped = "ClusterScoped" + ControlPlaneModeValueMultiTenant = "MultiTenant" +) + +func init() { + SchemeBuilder.Register(&ServiceMeshControlPlane{}, &ServiceMeshControlPlaneList{}) +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceMeshControlPlane is the Schema for the controlplanes API +// +k8s:openapi-gen=true +// +kubebuilder:storageversion +// +kubebuilder:resource:shortName=smcp,categories=maistra-io +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.annotations.readyComponentCount",description="How many of the total number of components are ready" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].reason",description="Whether or not the control plane installation is up to date and ready to handle requests." +// +kubebuilder:printcolumn:name="Profiles",type="string",JSONPath=".status.appliedSpec.profiles",description="The configuration profiles applied to the configuration." +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.chartVersion",description="The actual current version of the control plane installation." +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The age of the object" +// +kubebuilder:printcolumn:name="Image Registry",type="string",JSONPath=".status.appliedSpec.runtime.defaults.container.registry",description="The image registry used as the base for all component images.",priority=1 +type ServiceMeshControlPlane struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // The specification of the desired state of this ServiceMeshControlPlane. + // This includes the configuration options for all components that comprise + // the control plane. + // +kubebuilder:validation:Required + Spec ControlPlaneSpec `json:"spec"` + + // The current status of this ServiceMeshControlPlane and the components + // that comprise the control plane. This data may be out of date by some + // window of time. + // +optional + Status ControlPlaneStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceMeshControlPlaneList contains a list of ServiceMeshControlPlane +type ServiceMeshControlPlaneList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceMeshControlPlane `json:"items"` +} + +// ControlPlaneStatus defines the observed state of ServiceMeshControlPlane +// ControlPlaneStatus represents the current state of a ServiceMeshControlPlane. +type ControlPlaneStatus struct { + status.StatusBase `json:",inline"` + + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + status.StatusType `json:",inline"` + + // The generation observed by the controller during the most recent + // reconciliation. The information in the status pertains to this particular + // generation of the object. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // The version of the operator that last processed this resource. + OperatorVersion string `json:"operatorVersion,omitempty"` + + // The version of the charts that were last processed for this resource. + ChartVersion string `json:"chartVersion,omitempty"` + + // The list of components comprising the control plane and their statuses. + status.ComponentStatusList `json:",inline"` + + // The readiness status of components & owned resources + Readiness ReadinessStatus `json:"readiness"` + + // The resulting specification of the configuration options after all profiles + // have been applied. + // +optional + AppliedSpec ControlPlaneSpec `json:"appliedSpec,omitempty"` + + // The resulting values.yaml used to generate the charts. + // +optional + AppliedValues v1.ControlPlaneSpec `json:"appliedValues,omitempty"` +} + +// ReadinessStatus contains readiness information for each deployed component. +type ReadinessStatus struct { + // The readiness status of components + // +optional + Components ReadinessMap `json:"components,omitempty"` +} + +type ReadinessMap map[string][]string + +// GetReconciledVersion returns the reconciled version, or a default for older resources +func (s *ControlPlaneStatus) GetReconciledVersion() string { + if s == nil { + return status.ComposeReconciledVersion("0.0.0", 0) + } + return status.ComposeReconciledVersion(s.OperatorVersion, s.ObservedGeneration) +} + +// ControlPlaneSpec represents the configuration for installing a control plane +type ControlPlaneSpec struct { + // XXX: the resource name is intended to be used as the revision name, which + // is used by istio.io/rev labels/annotations to specify which control plane + // workloads should be connecting with. + + // Profiles selects the profile to use for default values. Defaults to + // "default" when not set. + // +optional + Profiles []string `json:"profiles,omitempty"` + + // Version specifies what Maistra version of the control plane to install. + // When creating a new ServiceMeshControlPlane with an empty version, the + // admission webhook sets the version to the current version. + // +optional + Version string `json:"version,omitempty"` + // Cluster is the general configuration of the cluster (cluster name, + // network name, multi-cluster, mesh expansion, etc.) + // +optional + Cluster *ControlPlaneClusterConfig `json:"cluster,omitempty"` + // General represents general control plane configuration that does not + // logically fit in another area. + // +optional + General *GeneralConfig `json:"general,omitempty"` + // Policy configures policy checking for the control plane. + // .Values.policy.enabled, true if not null + // +optional + Policy *PolicyConfig `json:"policy,omitempty"` + // Proxy configures the default behavior for sidecars. Many values were + // previously exposed through .Values.global.proxy + // +optional + Proxy *ProxyConfig `json:"proxy,omitempty"` + // Security configures aspects of security for the control plane. + // +optional + Security *SecurityConfig `json:"security,omitempty"` + // Telemetry configures telemetry for the mesh. + // .Values.mixer.telemetry.enabled, true if not null. 1.6, .Values.telemetry.enabled + // +optional + Telemetry *TelemetryConfig `json:"telemetry,omitempty"` + // Tracing configures tracing for the mesh. + // +optional + Tracing *TracingConfig `json:"tracing,omitempty"` + // Gateways configures gateways for the mesh + // .Values.gateways.* + // +optional + Gateways *GatewaysConfig `json:"gateways,omitempty"` + // Runtime configuration for pilot (and galley, etc., pre 2.0) + // +optional + Runtime *ControlPlaneRuntimeConfig `json:"runtime,omitempty"` + // Addons is used to configure additional features beyond core control plane + // components, e.g. visualization, metric storage, etc. + // +optional + Addons *AddonsConfig `json:"addons,omitempty"` + // TechPreview contains switches for features that are not GA yet. + // +optional + TechPreview *v1.HelmValues `json:"techPreview,omitempty"` +} + +// Enablement is a common definition for features that can be enabled +type Enablement struct { + // Enabled specifies whether or not this feature is enabled + Enabled *bool `json:"enabled,omitempty"` +} + +func (s ControlPlaneSpec) IsKialiEnabled() bool { + return s.Addons != nil && + s.Addons.Kiali != nil && + s.Addons.Kiali.Enabled != nil && + *s.Addons.Kiali.Enabled +} + +func (s ControlPlaneSpec) IsPrometheusEnabled() bool { + return s.Addons != nil && + s.Addons.Prometheus != nil && + s.Addons.Prometheus.Enabled != nil && + *s.Addons.Prometheus.Enabled +} + +func (s ControlPlaneSpec) IsGrafanaEnabled() bool { + return s.Addons != nil && s.Addons.Grafana != nil && s.Addons.Grafana.Enabled != nil && *s.Addons.Grafana.Enabled +} + +func (s ControlPlaneSpec) IsJaegerEnabled() bool { + return s.Tracing != nil && s.Tracing.Type == TracerTypeJaeger +} + +func (s ControlPlaneSpec) IsClusterScoped() (bool, error) { + controlPlaneMode, _, err := s.TechPreview.GetString(ControlPlaneModeKey) + if err != nil { + return false, err + } + return controlPlaneMode == ControlPlaneModeValueClusterScoped, nil +} diff --git a/api/external/maistra/v2/stackdriver.go b/api/external/maistra/v2/stackdriver.go new file mode 100644 index 000000000..16c3105be --- /dev/null +++ b/api/external/maistra/v2/stackdriver.go @@ -0,0 +1,97 @@ +package v2 + +import ( + v1 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v1" +) + +// StackdriverAddonConfig configuration specific to Stackdriver integration. +type StackdriverAddonConfig struct { + // Configuration for Stackdriver tracer. Applies when Addons.Tracer.Type=Stackdriver + Tracer *StackdriverTracerConfig `json:"tracer,omitempty"` + // Configuration for Stackdriver telemetry plugins. Applies when telemetry + // is enabled + Telemetry *StackdriverTelemetryConfig `json:"telemetry,omitempty"` +} + +// StackdriverTracerConfig configures the Stackdriver tracer +type StackdriverTracerConfig struct { + // .Values.global.tracer.stackdriver.debug + // +optional + Debug *bool `json:"debug,omitempty"` + // .Values.global.tracer.stackdriver.maxNumberOfAttributes + // +optional + MaxNumberOfAttributes *int64 `json:"maxNumberOfAttributes,omitempty"` + // .Values.global.tracer.stackdriver.maxNumberOfAnnotations + // +optional + MaxNumberOfAnnotations *int64 `json:"maxNumberOfAnnotations,omitempty"` + // .Values.global.tracer.stackdriver.maxNumberOfMessageEvents + // +optional + MaxNumberOfMessageEvents *int64 `json:"maxNumberOfMessageEvents,omitempty"` +} + +// StackdriverTelemetryConfig adds telemetry filters for Stackdriver. +type StackdriverTelemetryConfig struct { + // Enable installation of Stackdriver telemetry filters (mixer or v2/envoy). + // These will only be installed if this is enabled an telemetry is enabled. + Enablement `json:",inline"` + // Auth configuration for stackdriver adapter (mixer/v1 telemetry only) + // .Values.mixer.adapters.stackdriver.auth + // +optional + Auth *StackdriverAuthConfig `json:"auth,omitempty"` + // EnableContextGraph for stackdriver adapter (edge reporting) + // .Values.mixer.adapters.stackdriver.contextGraph.enabled, defaults to false + // .Values.telemetry.v2.stackdriver.topology, defaults to false + // +optional + EnableContextGraph *bool `json:"enableContextGraph,omitempty"` + // EnableLogging for stackdriver adapter + // .Values.mixer.adapters.stackdriver.logging.enabled, defaults to true + // .Values.telemetry.v2.stackdriver.logging, defaults to false + // +optional + EnableLogging *bool `json:"enableLogging,omitempty"` + // EnableMetrics for stackdriver adapter + // .Values.mixer.adapters.stackdriver.metrics.enabled, defaults to true + // .Values.telemetry.v2.stackdriver.monitoring??? defaults to false + // +optional + EnableMetrics *bool `json:"enableMetrics,omitempty"` + // DisableOutbound disables intallation of sidecar outbound filter + // .Values.telemetry.v2.stackdriver.disableOutbound, defaults to false + // +optional + // DisableOutbound bool `json:"disableOutbound,omitempty"` + // AccessLogging configures access logging for stackdriver + AccessLogging *StackdriverAccessLogTelemetryConfig `json:"accessLogging,omitempty"` + // ConfigOverride apply custom configuration to Stackdriver filters (v2 + // telemetry only) + // .Values.telemetry.v2.stackdriver.configOverride + // +optional + ConfigOverride *v1.HelmValues `json:"configOverride,omitempty"` +} + +// StackdriverAuthConfig is the auth config for stackdriver. Only one field may be set +type StackdriverAuthConfig struct { + // AppCredentials if true, use default app credentials. + // .Values.mixer.adapters.stackdriver.auth.appCredentials, defaults to false + // +optional + AppCredentials *bool `json:"appCredentials,omitempty"` + // APIKey use the specified key. + // .Values.mixer.adapters.stackdriver.auth.apiKey + // +optional + APIKey string `json:"apiKey,omitempty"` + // ServiceAccountPath use the path to the service account. + // .Values.mixer.adapters.stackdriver.auth.serviceAccountPath + // +optional + ServiceAccountPath string `json:"serviceAccountPath,omitempty"` +} + +// StackdriverAccessLogTelemetryConfig for v2 telemetry. +type StackdriverAccessLogTelemetryConfig struct { + // Enable installation of access log filter. + // .Values.telemetry.v2.accessLogPolicy.enabled + Enablement `json:",inline"` + // LogWindowDuration configures the log window duration for access logs. + // defaults to 43200s + // To reduce the number of successful logs, default log window duration is + // set to 12 hours. + // .Values.telemetry.v2.accessLogPolicy.logWindowDuration + // +optional + LogWindowDuration string `json:"logWindowDuration,omitempty"` +} diff --git a/api/external/maistra/v2/telemetry.go b/api/external/maistra/v2/telemetry.go new file mode 100644 index 000000000..eaf5597cc --- /dev/null +++ b/api/external/maistra/v2/telemetry.go @@ -0,0 +1,119 @@ +package v2 + +// TelemetryConfig for the mesh +type TelemetryConfig struct { + // Type of telemetry implementation to use. + Type TelemetryType `json:"type,omitempty"` + // Mixer represents legacy, v1 telemetry. + // implies .Values.telemetry.v1.enabled, if not null + // +optional + Mixer *MixerTelemetryConfig `json:"mixer,omitempty"` + // Remote represents a remote, legacy, v1 telemetry. + // +optional + Remote *RemoteTelemetryConfig `json:"remote,omitempty"` +} + +// TelemetryType represents the telemetry implementation used. +type TelemetryType string + +const ( + // TelemetryTypeNone disables telemetry + TelemetryTypeNone TelemetryType = "None" + // TelemetryTypeMixer represents mixer telemetry, v1 + TelemetryTypeMixer TelemetryType = "Mixer" + // TelemetryTypeRemote represents remote mixer telemetry server, v1 + TelemetryTypeRemote TelemetryType = "Remote" + // TelemetryTypeIstiod represents istio, v2 + TelemetryTypeIstiod TelemetryType = "Istiod" +) + +// MixerTelemetryConfig is the configuration for legacy, v1 mixer telemetry. +// .Values.telemetry.v1.enabled +type MixerTelemetryConfig struct { + // SessionAffinity configures session affinity for sidecar telemetry connections. + // .Values.mixer.telemetry.sessionAffinityEnabled, maps to MeshConfig.sidecarToTelemetrySessionAffinity + // +optional + SessionAffinity *bool `json:"sessionAffinity,omitempty"` + // Loadshedding configuration for telemetry + // .Values.mixer.telemetry.loadshedding + // +optional + Loadshedding *TelemetryLoadSheddingConfig `json:"loadshedding,omitempty"` + // Batching settings used when sending telemetry. + // +optional + Batching *TelemetryBatchingConfig `json:"batching,omitempty"` + // Adapters configures the adapters used by mixer telemetry. + // +optional + Adapters *MixerTelemetryAdaptersConfig `json:"adapters,omitempty"` +} + +// TelemetryLoadSheddingConfig configures how mixer telemetry loadshedding behaves +type TelemetryLoadSheddingConfig struct { + // Mode represents the loadshedding mode applied to mixer when it becomes + // overloaded. Valid values: disabled, logonly or enforce + // .Values.mixer.telemetry.loadshedding.mode + // +optional + Mode string `json:"mode,omitempty"` + // LatencyThreshold -- + // .Values.mixer.telemetry.loadshedding.latencyThreshold + // +optional + LatencyThreshold string `json:"latencyThreshold,omitempty"` +} + +// TelemetryBatchingConfig configures how telemetry data is batched. +type TelemetryBatchingConfig struct { + // MaxEntries represents the maximum number of entries to collect before sending them to mixer. + // .Values.mixer.telemetry.reportBatchMaxEntries, maps to MeshConfig.reportBatchMaxEntries + // Set reportBatchMaxEntries to 0 to use the default batching behavior (i.e., every 100 requests). + // A positive value indicates the number of requests that are batched before telemetry data + // is sent to the mixer server + // +optional + MaxEntries *int32 `json:"maxEntries,omitempty"` + // MaxTime represents the maximum amount of time to hold entries before sending them to mixer. + // .Values.mixer.telemetry.reportBatchMaxTime, maps to MeshConfig.reportBatchMaxTime + // Set reportBatchMaxTime to 0 to use the default batching behavior (i.e., every 1 second). + // A positive time value indicates the maximum wait time since the last request will telemetry data + // be batched before being sent to the mixer server + // +optional + MaxTime string `json:"maxTime,omitempty"` +} + +// MixerTelemetryAdaptersConfig is the configuration for mixer telemetry adapters. +type MixerTelemetryAdaptersConfig struct { + // UseAdapterCRDs specifies whether or not mixer should support deprecated CRDs. + // .Values.mixer.adapters.useAdapterCRDs, removed in istio 1.4, defaults to false + // XXX: i think this can be removed completely + // +optional + UseAdapterCRDs *bool `json:"useAdapterCRDs,omitempty"` + // KubernetesEnv enables support for the kubernetesenv adapter. + // .Values.mixer.adapters.kubernetesenv.enabled, defaults to true + // +optional + KubernetesEnv *bool `json:"kubernetesenv,omitempty"` + // Stdio enables and configures the stdio adapter. + // +optional + Stdio *MixerTelemetryStdioConfig `json:"stdio,omitempty"` +} + +// MixerTelemetryStdioConfig configures the stdio adapter for mixer telemetry. +type MixerTelemetryStdioConfig struct { + // .Values.mixer.adapters.stdio.enabled + Enablement `json:",inline"` + // OutputAsJSON if true. + // .Values.mixer.adapters.stdio.outputAsJson, defaults to false + // +optional + OutputAsJSON *bool `json:"outputAsJSON,omitempty"` +} + +// RemoteTelemetryConfig configures a remote, legacy, v1 mixer telemetry. +// .Values.telemetry.v1.enabled true +type RemoteTelemetryConfig struct { + // Address is the address of the remote telemetry server + // .Values.global.remoteTelemetryAddress, maps to MeshConfig.mixerReportServer + Address string `json:"address,omitempty"` + // CreateService for the remote server. + // .Values.global.createRemoteSvcEndpoints + // +optional + CreateService *bool `json:"createService,omitempty"` + // Batching settings used when sending telemetry. + // +optional + Batching *TelemetryBatchingConfig `json:"batching,omitempty"` +} diff --git a/api/external/maistra/v2/threescale.go b/api/external/maistra/v2/threescale.go new file mode 100644 index 000000000..890e48a95 --- /dev/null +++ b/api/external/maistra/v2/threescale.go @@ -0,0 +1,130 @@ +package v2 + +// ThreeScaleAddonConfig represents configuration options for the installation of the +// 3scale adapter. The options are structured similarly to what is defined by +// the 3scale ConfigMap. +type ThreeScaleAddonConfig struct { + Enablement `json:",inline"` + + // ListenerAddr sets the listen address for the gRPC server. + // PARAM_THREESCALE_LISTEN_ADDR + // +optional + ListenAddr *int32 `json:"listen_addr,omitempty"` + // LogGRPC controls whether the log includes gRPC info + // PARAM_THREESCALE_LOG_GRPC + // +optional + LogGRPC *bool `json:"log_grpc,omitempty"` + // LogJSON controls whether the log is formatted as JSON + // PARAM_THREESCALE_LOG_JSON + // +optional + LogJSON *bool `json:"log_json,omitempty"` + // LogLevel sets the minimum log output level. Accepted values are one of: + // debug, info, warn, error, none + // PARAM_THREESCALE_LOG_LEVEL + // +optional + LogLevel string `json:"log_level,omitempty"` + + // Metrics configures metrics specific details + // +optional + Metrics *ThreeScaleMetricsConfig `json:"metrics,omitempty"` + + // System configures system specific details + // +optional + System *ThreeScaleSystemConfig `json:"system,omitempty"` + + // Client configures client specific details + // +optional + Client *ThreeScaleClientConfig `json:"client,omitempty"` + + // GRPC configures gRPC specific details + // +optional + GRPC *ThreeScaleGRPCConfig `json:"grpc,omitempty"` + + // Backend configures backend specific details + // +optional + Backend *ThreeScaleBackendConfig `json:"backend,omitempty"` +} + +// ThreeScaleMetricsConfig represents 3scale adapter options for its 'metrics' +// section. +type ThreeScaleMetricsConfig struct { + // Port sets the port which 3scale /metrics endpoint can be scrapped from + // PARAM_THREESCALE_METRICS_PORT + // +optional + Port *int32 `json:"port,omitempty"` + // Report controls whether 3scale system and backend metrics are collected + // and reported to Prometheus + // PARAM_THREESCALE_REPORT_METRICS + // +optional + Report *bool `json:"report,omitempty"` +} + +// ThreeScaleSystemConfig represents 3scale adapter options for its 'system' +// section. +type ThreeScaleSystemConfig struct { + // CacheMaxSize is the max number of items that can be stored in the cache + // at any time. Set to 0 to disable caching + // PARAM_THREESCALE_CACHE_ENTRIES_MAX + // +optional + CacheMaxSize *int64 `json:"cache_max_size,omitempty"` + // CacheRefreshRetries sets the number of times unreachable hosts will be + // retried during a cache update loop + // PARAM_THREESCALE_CACHE_REFRESH_RETRIES + // +optional + CacheRefreshRetries *int32 `json:"cache_refresh_retries,omitempty"` + // CacheRefreshInterval is the time period in seconds, before a background + // process attempts to refresh cached entries + // PARAM_THREESCALE_CACHE_REFRESH_SECONDS + // +optional + CacheRefreshInterval *int32 `json:"cache_refresh_interval,omitempty"` + // CacheTTL is the time period, in seconds, to wait before purging expired + // items from the cache + // PARAM_THREESCALE_CACHE_TTL_SECONDS + // +optional + CacheTTL *int32 `json:"cache_ttl,omitempty"` +} + +// ThreeScaleClientConfig represents 3scale adapter options for its 'client' +// section. +type ThreeScaleClientConfig struct { + // AllowInsecureConnections skips certificate verification when calling + // 3scale API's. Enabling is not recommended + // PARAM_THREESCALE_ALLOW_INSECURE_CONN + // +optional + AllowInsecureConnections *bool `json:"allow_insecure_connections,omitempty"` + // Timeout sets the number of seconds to wait before terminating requests + // to 3scale System and Backend + // PARAM_THREESCALE_CLIENT_TIMEOUT_SECONDS + // +optional + Timeout *int32 `json:"timeout,omitempty"` +} + +// ThreeScaleGRPCConfig represents 3scale adapter options for its 'grpc' +// section. +type ThreeScaleGRPCConfig struct { + // MaxConnTimeout sets the maximum amount of seconds (+/-10% jitter) a + // connection may exist before it will be closed + // PARAM_THREESCALE_GRPC_CONN_MAX_SECONDS + // +optional + MaxConnTimeout *int32 `json:"max_conn_timeout,omitempty"` +} + +// ThreeScaleBackendConfig represents 3scale adapter options for its 'backend' +// section. +type ThreeScaleBackendConfig struct { + // EnableCache if true, attempts to create an in-memory apisonator cache for + // authorization requests + // PARAM_THREESCALE_USE_CACHED_BACKEND + // +optional + EnableCache *bool `json:"enable_cache,omitempty"` + // CacheFlushInterval sets the interval at which metrics get reported from + // the cache to 3scale + // PARAM_THREESCALE_BACKEND_CACHE_FLUSH_INTERVAL_SECONDS + // +optional + CacheFlushInterval *int32 `json:"cache_flush_interval,omitempty"` + // PolicyFailClosed if true, request will fail if 3scale Apisonator is + // unreachable + // PARAM_THREESCALE_BACKEND_CACHE_POLICY_FAIL_CLOSED + // +optional + PolicyFailClosed *bool `json:"policy_fail_closed,omitempty"` +} diff --git a/api/external/maistra/v2/tracing.go b/api/external/maistra/v2/tracing.go new file mode 100644 index 000000000..290bc4693 --- /dev/null +++ b/api/external/maistra/v2/tracing.go @@ -0,0 +1,31 @@ +package v2 + +// TracingConfig configures tracing solutions for the mesh. +// .Values.global.enableTracing +type TracingConfig struct { + // Type represents the type of tracer to be installed. + Type TracerType `json:"type,omitempty"` + // Sampling sets the mesh-wide trace sampling percentage. Should be between + // 0.0 - 100.0. Precision to 0.01, scaled as 0 to 10000, e.g.: 100% = 10000, + // 1% = 100 + // .Values.pilot.traceSampling + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=10000 + // +optional + Sampling *int32 `json:"sampling,omitempty"` +} + +// TracerType represents the tracer type to use +type TracerType string + +const ( + // TracerTypeNone is used to represent no tracer + TracerTypeNone TracerType = "None" + // TracerTypeJaeger is used to represent Jaeger as the tracer + TracerTypeJaeger TracerType = "Jaeger" + // TracerTypeStackdriver is used to represent Stackdriver as the tracer + TracerTypeStackdriver TracerType = "Stackdriver" + // TracerTypeZipkin TracerType = "Zipkin" + // TracerTypeLightstep TracerType = "Lightstep" + // TracerTypeDatadog TracerType = "Datadog" +) diff --git a/api/external/maistra/v2/zipkin.go b/api/external/maistra/v2/zipkin.go new file mode 100644 index 000000000..322ad69a4 --- /dev/null +++ b/api/external/maistra/v2/zipkin.go @@ -0,0 +1,6 @@ +package v2 + +// ZipkinTracerConfig configures a Zipkin tracer for use with the mesh +type ZipkinTracerConfig struct { + // TODO.... +} diff --git a/api/external/maistra/v2/zz_generated.deepcopy.go b/api/external/maistra/v2/zz_generated.deepcopy.go new file mode 100644 index 000000000..fe4bc560b --- /dev/null +++ b/api/external/maistra/v2/zz_generated.deepcopy.go @@ -0,0 +1,3131 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v2 + +import ( + appsv1 "k8s.io/api/apps/v1" + "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddonsConfig) DeepCopyInto(out *AddonsConfig) { + *out = *in + if in.Prometheus != nil { + in, out := &in.Prometheus, &out.Prometheus + *out = new(PrometheusAddonConfig) + (*in).DeepCopyInto(*out) + } + if in.Stackdriver != nil { + in, out := &in.Stackdriver, &out.Stackdriver + *out = new(StackdriverAddonConfig) + (*in).DeepCopyInto(*out) + } + if in.Jaeger != nil { + in, out := &in.Jaeger, &out.Jaeger + *out = new(JaegerAddonConfig) + (*in).DeepCopyInto(*out) + } + if in.Grafana != nil { + in, out := &in.Grafana, &out.Grafana + *out = new(GrafanaAddonConfig) + (*in).DeepCopyInto(*out) + } + if in.Kiali != nil { + in, out := &in.Kiali, &out.Kiali + *out = new(KialiAddonConfig) + (*in).DeepCopyInto(*out) + } + if in.ThreeScale != nil { + in, out := &in.ThreeScale, &out.ThreeScale + *out = new(ThreeScaleAddonConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonsConfig. +func (in *AddonsConfig) DeepCopy() *AddonsConfig { + if in == nil { + return nil + } + out := new(AddonsConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Affinity) DeepCopyInto(out *Affinity) { + *out = *in + if in.NodeAffinity != nil { + in, out := &in.NodeAffinity, &out.NodeAffinity + *out = new(v1.NodeAffinity) + (*in).DeepCopyInto(*out) + } + if in.PodAffinity != nil { + in, out := &in.PodAffinity, &out.PodAffinity + *out = new(v1.PodAffinity) + (*in).DeepCopyInto(*out) + } + in.PodAntiAffinity.DeepCopyInto(&out.PodAntiAffinity) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Affinity. +func (in *Affinity) DeepCopy() *Affinity { + if in == nil { + return nil + } + out := new(Affinity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScalerConfig) DeepCopyInto(out *AutoScalerConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.MinReplicas != nil { + in, out := &in.MinReplicas, &out.MinReplicas + *out = new(int32) + **out = **in + } + if in.MaxReplicas != nil { + in, out := &in.MaxReplicas, &out.MaxReplicas + *out = new(int32) + **out = **in + } + if in.TargetCPUUtilizationPercentage != nil { + in, out := &in.TargetCPUUtilizationPercentage, &out.TargetCPUUtilizationPercentage + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalerConfig. +func (in *AutoScalerConfig) DeepCopy() *AutoScalerConfig { + if in == nil { + return nil + } + out := new(AutoScalerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertManagerCertificateAuthorityConfig) DeepCopyInto(out *CertManagerCertificateAuthorityConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertManagerCertificateAuthorityConfig. +func (in *CertManagerCertificateAuthorityConfig) DeepCopy() *CertManagerCertificateAuthorityConfig { + if in == nil { + return nil + } + out := new(CertManagerCertificateAuthorityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityConfig) DeepCopyInto(out *CertificateAuthorityConfig) { + *out = *in + if in.Istiod != nil { + in, out := &in.Istiod, &out.Istiod + *out = new(IstiodCertificateAuthorityConfig) + (*in).DeepCopyInto(*out) + } + if in.Custom != nil { + in, out := &in.Custom, &out.Custom + *out = new(CustomCertificateAuthorityConfig) + **out = **in + } + if in.CertManager != nil { + in, out := &in.CertManager, &out.CertManager + *out = new(CertManagerCertificateAuthorityConfig) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityConfig. +func (in *CertificateAuthorityConfig) DeepCopy() *CertificateAuthorityConfig { + if in == nil { + return nil + } + out := new(CertificateAuthorityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterIngressGatewayConfig) DeepCopyInto(out *ClusterIngressGatewayConfig) { + *out = *in + in.IngressGatewayConfig.DeepCopyInto(&out.IngressGatewayConfig) + if in.IngressEnabled != nil { + in, out := &in.IngressEnabled, &out.IngressEnabled + *out = new(bool) + **out = **in + } + if in.MeshExpansionPorts != nil { + in, out := &in.MeshExpansionPorts, &out.MeshExpansionPorts + *out = make([]v1.ServicePort, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RouteConfig != nil { + in, out := &in.RouteConfig, &out.RouteConfig + *out = new(Enablement) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngressGatewayConfig. +func (in *ClusterIngressGatewayConfig) DeepCopy() *ClusterIngressGatewayConfig { + if in == nil { + return nil + } + out := new(ClusterIngressGatewayConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonContainerConfig) DeepCopyInto(out *CommonContainerConfig) { + *out = *in + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(v1.ResourceRequirements) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonContainerConfig. +func (in *CommonContainerConfig) DeepCopy() *CommonContainerConfig { + if in == nil { + return nil + } + out := new(CommonContainerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonDeploymentRuntimeConfig) DeepCopyInto(out *CommonDeploymentRuntimeConfig) { + *out = *in + if in.PodDisruption != nil { + in, out := &in.PodDisruption, &out.PodDisruption + *out = new(PodDisruptionBudget) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonDeploymentRuntimeConfig. +func (in *CommonDeploymentRuntimeConfig) DeepCopy() *CommonDeploymentRuntimeConfig { + if in == nil { + return nil + } + out := new(CommonDeploymentRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonPodRuntimeConfig) DeepCopyInto(out *CommonPodRuntimeConfig) { + *out = *in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonPodRuntimeConfig. +func (in *CommonPodRuntimeConfig) DeepCopy() *CommonPodRuntimeConfig { + if in == nil { + return nil + } + out := new(CommonPodRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentIngressConfig) DeepCopyInto(out *ComponentIngressConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(MetadataConfig) + (*in).DeepCopyInto(*out) + } + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentIngressConfig. +func (in *ComponentIngressConfig) DeepCopy() *ComponentIngressConfig { + if in == nil { + return nil + } + out := new(ComponentIngressConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ComponentLogLevels) DeepCopyInto(out *ComponentLogLevels) { + { + in := &in + *out = make(ComponentLogLevels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentLogLevels. +func (in ComponentLogLevels) DeepCopy() ComponentLogLevels { + if in == nil { + return nil + } + out := new(ComponentLogLevels) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentPersistenceConfig) DeepCopyInto(out *ComponentPersistenceConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(v1.ResourceRequirements) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentPersistenceConfig. +func (in *ComponentPersistenceConfig) DeepCopy() *ComponentPersistenceConfig { + if in == nil { + return nil + } + out := new(ComponentPersistenceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentRuntimeConfig) DeepCopyInto(out *ComponentRuntimeConfig) { + *out = *in + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = new(DeploymentRuntimeConfig) + (*in).DeepCopyInto(*out) + } + if in.Pod != nil { + in, out := &in.Pod, &out.Pod + *out = new(PodRuntimeConfig) + (*in).DeepCopyInto(*out) + } + if in.Container != nil { + in, out := &in.Container, &out.Container + *out = new(ContainerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentRuntimeConfig. +func (in *ComponentRuntimeConfig) DeepCopy() *ComponentRuntimeConfig { + if in == nil { + return nil + } + out := new(ComponentRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentServiceConfig) DeepCopyInto(out *ComponentServiceConfig) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(MetadataConfig) + (*in).DeepCopyInto(*out) + } + if in.NodePort != nil { + in, out := &in.NodePort, &out.NodePort + *out = new(int32) + **out = **in + } + if in.Ingress != nil { + in, out := &in.Ingress, &out.Ingress + *out = new(ComponentIngressConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentServiceConfig. +func (in *ComponentServiceConfig) DeepCopy() *ComponentServiceConfig { + if in == nil { + return nil + } + out := new(ComponentServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContainerConfig) DeepCopyInto(out *ContainerConfig) { + *out = *in + in.CommonContainerConfig.DeepCopyInto(&out.CommonContainerConfig) + if in.Env != nil { + in, out := &in.Env, &out.Env + *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 ContainerConfig. +func (in *ContainerConfig) DeepCopy() *ContainerConfig { + if in == nil { + return nil + } + out := new(ContainerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClusterConfig) DeepCopyInto(out *ControlPlaneClusterConfig) { + *out = *in + if in.MultiCluster != nil { + in, out := &in.MultiCluster, &out.MultiCluster + *out = new(MultiClusterConfig) + (*in).DeepCopyInto(*out) + } + if in.MeshExpansion != nil { + in, out := &in.MeshExpansion, &out.MeshExpansion + *out = new(MeshExpansionConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClusterConfig. +func (in *ControlPlaneClusterConfig) DeepCopy() *ControlPlaneClusterConfig { + if in == nil { + return nil + } + out := new(ControlPlaneClusterConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneRuntimeConfig) DeepCopyInto(out *ControlPlaneRuntimeConfig) { + *out = *in + if in.Components != nil { + in, out := &in.Components, &out.Components + *out = make(map[ControlPlaneComponentName]*ComponentRuntimeConfig, len(*in)) + for key, val := range *in { + var outVal *ComponentRuntimeConfig + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(ComponentRuntimeConfig) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.Defaults != nil { + in, out := &in.Defaults, &out.Defaults + *out = new(DefaultRuntimeConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneRuntimeConfig. +func (in *ControlPlaneRuntimeConfig) DeepCopy() *ControlPlaneRuntimeConfig { + if in == nil { + return nil + } + out := new(ControlPlaneRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneSecurityConfig) DeepCopyInto(out *ControlPlaneSecurityConfig) { + *out = *in + if in.MTLS != nil { + in, out := &in.MTLS, &out.MTLS + *out = new(bool) + **out = **in + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(ControlPlaneTLSConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneSecurityConfig. +func (in *ControlPlaneSecurityConfig) DeepCopy() *ControlPlaneSecurityConfig { + if in == nil { + return nil + } + out := new(ControlPlaneSecurityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneSpec) DeepCopyInto(out *ControlPlaneSpec) { + *out = *in + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Cluster != nil { + in, out := &in.Cluster, &out.Cluster + *out = new(ControlPlaneClusterConfig) + (*in).DeepCopyInto(*out) + } + if in.General != nil { + in, out := &in.General, &out.General + *out = new(GeneralConfig) + (*in).DeepCopyInto(*out) + } + if in.Policy != nil { + in, out := &in.Policy, &out.Policy + *out = new(PolicyConfig) + (*in).DeepCopyInto(*out) + } + if in.Proxy != nil { + in, out := &in.Proxy, &out.Proxy + *out = new(ProxyConfig) + (*in).DeepCopyInto(*out) + } + if in.Security != nil { + in, out := &in.Security, &out.Security + *out = new(SecurityConfig) + (*in).DeepCopyInto(*out) + } + if in.Telemetry != nil { + in, out := &in.Telemetry, &out.Telemetry + *out = new(TelemetryConfig) + (*in).DeepCopyInto(*out) + } + if in.Tracing != nil { + in, out := &in.Tracing, &out.Tracing + *out = new(TracingConfig) + (*in).DeepCopyInto(*out) + } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = new(GatewaysConfig) + (*in).DeepCopyInto(*out) + } + if in.Runtime != nil { + in, out := &in.Runtime, &out.Runtime + *out = new(ControlPlaneRuntimeConfig) + (*in).DeepCopyInto(*out) + } + if in.Addons != nil { + in, out := &in.Addons, &out.Addons + *out = new(AddonsConfig) + (*in).DeepCopyInto(*out) + } + if in.TechPreview != nil { + in, out := &in.TechPreview, &out.TechPreview + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneSpec. +func (in *ControlPlaneSpec) DeepCopy() *ControlPlaneSpec { + if in == nil { + return nil + } + out := new(ControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneStatus) DeepCopyInto(out *ControlPlaneStatus) { + *out = *in + in.StatusBase.DeepCopyInto(&out.StatusBase) + in.StatusType.DeepCopyInto(&out.StatusType) + in.ComponentStatusList.DeepCopyInto(&out.ComponentStatusList) + in.Readiness.DeepCopyInto(&out.Readiness) + in.AppliedSpec.DeepCopyInto(&out.AppliedSpec) + in.AppliedValues.DeepCopyInto(&out.AppliedValues) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneStatus. +func (in *ControlPlaneStatus) DeepCopy() *ControlPlaneStatus { + if in == nil { + return nil + } + out := new(ControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneTLSConfig) DeepCopyInto(out *ControlPlaneTLSConfig) { + *out = *in + if in.CipherSuites != nil { + in, out := &in.CipherSuites, &out.CipherSuites + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ECDHCurves != nil { + in, out := &in.ECDHCurves, &out.ECDHCurves + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTLSConfig. +func (in *ControlPlaneTLSConfig) DeepCopy() *ControlPlaneTLSConfig { + if in == nil { + return nil + } + out := new(ControlPlaneTLSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CustomCertificateAuthorityConfig) DeepCopyInto(out *CustomCertificateAuthorityConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomCertificateAuthorityConfig. +func (in *CustomCertificateAuthorityConfig) DeepCopy() *CustomCertificateAuthorityConfig { + if in == nil { + return nil + } + out := new(CustomCertificateAuthorityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataPlaneSecurityConfig) DeepCopyInto(out *DataPlaneSecurityConfig) { + *out = *in + if in.MTLS != nil { + in, out := &in.MTLS, &out.MTLS + *out = new(bool) + **out = **in + } + if in.AutoMTLS != nil { + in, out := &in.AutoMTLS, &out.AutoMTLS + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataPlaneSecurityConfig. +func (in *DataPlaneSecurityConfig) DeepCopy() *DataPlaneSecurityConfig { + if in == nil { + return nil + } + out := new(DataPlaneSecurityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatadogTracerConfig) DeepCopyInto(out *DatadogTracerConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatadogTracerConfig. +func (in *DatadogTracerConfig) DeepCopy() *DatadogTracerConfig { + if in == nil { + return nil + } + out := new(DatadogTracerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultRuntimeConfig) DeepCopyInto(out *DefaultRuntimeConfig) { + *out = *in + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = new(CommonDeploymentRuntimeConfig) + (*in).DeepCopyInto(*out) + } + if in.Pod != nil { + in, out := &in.Pod, &out.Pod + *out = new(CommonPodRuntimeConfig) + (*in).DeepCopyInto(*out) + } + if in.Container != nil { + in, out := &in.Container, &out.Container + *out = new(CommonContainerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultRuntimeConfig. +func (in *DefaultRuntimeConfig) DeepCopy() *DefaultRuntimeConfig { + if in == nil { + return nil + } + out := new(DefaultRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentRuntimeConfig) DeepCopyInto(out *DeploymentRuntimeConfig) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Strategy != nil { + in, out := &in.Strategy, &out.Strategy + *out = new(appsv1.DeploymentStrategy) + (*in).DeepCopyInto(*out) + } + if in.AutoScaling != nil { + in, out := &in.AutoScaling, &out.AutoScaling + *out = new(AutoScalerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentRuntimeConfig. +func (in *DeploymentRuntimeConfig) DeepCopy() *DeploymentRuntimeConfig { + if in == nil { + return nil + } + out := new(DeploymentRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EgressGatewayConfig) DeepCopyInto(out *EgressGatewayConfig) { + *out = *in + in.GatewayConfig.DeepCopyInto(&out.GatewayConfig) + if in.RequestedNetworkView != nil { + in, out := &in.RequestedNetworkView, &out.RequestedNetworkView + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EgressGatewayConfig. +func (in *EgressGatewayConfig) DeepCopy() *EgressGatewayConfig { + if in == nil { + return nil + } + out := new(EgressGatewayConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Enablement) DeepCopyInto(out *Enablement) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Enablement. +func (in *Enablement) DeepCopy() *Enablement { + if in == nil { + return nil + } + out := new(Enablement) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyServiceClientTLSSettings) DeepCopyInto(out *EnvoyServiceClientTLSSettings) { + *out = *in + if in.SubjectAltNames != nil { + in, out := &in.SubjectAltNames, &out.SubjectAltNames + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyServiceClientTLSSettings. +func (in *EnvoyServiceClientTLSSettings) DeepCopy() *EnvoyServiceClientTLSSettings { + if in == nil { + return nil + } + out := new(EnvoyServiceClientTLSSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyServiceTCPKeepalive) DeepCopyInto(out *EnvoyServiceTCPKeepalive) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyServiceTCPKeepalive. +func (in *EnvoyServiceTCPKeepalive) DeepCopy() *EnvoyServiceTCPKeepalive { + if in == nil { + return nil + } + out := new(EnvoyServiceTCPKeepalive) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfig) DeepCopyInto(out *GatewayConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + in.Service.DeepCopyInto(&out.Service) + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]VolumeConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Runtime != nil { + in, out := &in.Runtime, &out.Runtime + *out = new(ComponentRuntimeConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfig. +func (in *GatewayConfig) DeepCopy() *GatewayConfig { + if in == nil { + return nil + } + out := new(GatewayConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayServiceConfig) DeepCopyInto(out *GatewayServiceConfig) { + *out = *in + in.ServiceSpec.DeepCopyInto(&out.ServiceSpec) + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(MetadataConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayServiceConfig. +func (in *GatewayServiceConfig) DeepCopy() *GatewayServiceConfig { + if in == nil { + return nil + } + out := new(GatewayServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayVolume) DeepCopyInto(out *GatewayVolume) { + *out = *in + if in.ConfigMap != nil { + in, out := &in.ConfigMap, &out.ConfigMap + *out = new(v1.ConfigMapVolumeSource) + (*in).DeepCopyInto(*out) + } + if in.Secret != nil { + in, out := &in.Secret, &out.Secret + *out = new(v1.SecretVolumeSource) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayVolume. +func (in *GatewayVolume) DeepCopy() *GatewayVolume { + if in == nil { + return nil + } + out := new(GatewayVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewaysConfig) DeepCopyInto(out *GatewaysConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.ClusterIngress != nil { + in, out := &in.ClusterIngress, &out.ClusterIngress + *out = new(ClusterIngressGatewayConfig) + (*in).DeepCopyInto(*out) + } + if in.ClusterEgress != nil { + in, out := &in.ClusterEgress, &out.ClusterEgress + *out = new(EgressGatewayConfig) + (*in).DeepCopyInto(*out) + } + if in.IngressGateways != nil { + in, out := &in.IngressGateways, &out.IngressGateways + *out = make(map[string]*IngressGatewayConfig, len(*in)) + for key, val := range *in { + var outVal *IngressGatewayConfig + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(IngressGatewayConfig) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.EgressGateways != nil { + in, out := &in.EgressGateways, &out.EgressGateways + *out = make(map[string]*EgressGatewayConfig, len(*in)) + for key, val := range *in { + var outVal *EgressGatewayConfig + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(EgressGatewayConfig) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.OpenShiftRoute != nil { + in, out := &in.OpenShiftRoute, &out.OpenShiftRoute + *out = new(OpenShiftRouteConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaysConfig. +func (in *GatewaysConfig) DeepCopy() *GatewaysConfig { + if in == nil { + return nil + } + out := new(GatewaysConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeneralConfig) DeepCopyInto(out *GeneralConfig) { + *out = *in + if in.Logging != nil { + in, out := &in.Logging, &out.Logging + *out = new(LoggingConfig) + (*in).DeepCopyInto(*out) + } + if in.ValidationMessages != nil { + in, out := &in.ValidationMessages, &out.ValidationMessages + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeneralConfig. +func (in *GeneralConfig) DeepCopy() *GeneralConfig { + if in == nil { + return nil + } + out := new(GeneralConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GrafanaAddonConfig) DeepCopyInto(out *GrafanaAddonConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Install != nil { + in, out := &in.Install, &out.Install + *out = new(GrafanaInstallConfig) + (*in).DeepCopyInto(*out) + } + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaAddonConfig. +func (in *GrafanaAddonConfig) DeepCopy() *GrafanaAddonConfig { + if in == nil { + return nil + } + out := new(GrafanaAddonConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GrafanaConfig) DeepCopyInto(out *GrafanaConfig) { + *out = *in + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.EnvSecrets != nil { + in, out := &in.EnvSecrets, &out.EnvSecrets + *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 GrafanaConfig. +func (in *GrafanaConfig) DeepCopy() *GrafanaConfig { + if in == nil { + return nil + } + out := new(GrafanaConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GrafanaInstallConfig) DeepCopyInto(out *GrafanaInstallConfig) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = new(GrafanaConfig) + (*in).DeepCopyInto(*out) + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(ComponentServiceConfig) + (*in).DeepCopyInto(*out) + } + if in.Persistence != nil { + in, out := &in.Persistence, &out.Persistence + *out = new(ComponentPersistenceConfig) + (*in).DeepCopyInto(*out) + } + if in.Security != nil { + in, out := &in.Security, &out.Security + *out = new(GrafanaSecurityConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaInstallConfig. +func (in *GrafanaInstallConfig) DeepCopy() *GrafanaInstallConfig { + if in == nil { + return nil + } + out := new(GrafanaInstallConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GrafanaSecurityConfig) DeepCopyInto(out *GrafanaSecurityConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaSecurityConfig. +func (in *GrafanaSecurityConfig) DeepCopy() *GrafanaSecurityConfig { + if in == nil { + return nil + } + out := new(GrafanaSecurityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityConfig) DeepCopyInto(out *IdentityConfig) { + *out = *in + if in.ThirdParty != nil { + in, out := &in.ThirdParty, &out.ThirdParty + *out = new(ThirdPartyIdentityConfig) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityConfig. +func (in *IdentityConfig) DeepCopy() *IdentityConfig { + if in == nil { + return nil + } + out := new(IdentityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressGatewayConfig) DeepCopyInto(out *IngressGatewayConfig) { + *out = *in + in.GatewayConfig.DeepCopyInto(&out.GatewayConfig) + if in.SDS != nil { + in, out := &in.SDS, &out.SDS + *out = new(SecretDiscoveryService) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressGatewayConfig. +func (in *IngressGatewayConfig) DeepCopy() *IngressGatewayConfig { + if in == nil { + return nil + } + out := new(IngressGatewayConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IstioPrivateKeyCertificateSignerConfig) DeepCopyInto(out *IstioPrivateKeyCertificateSignerConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioPrivateKeyCertificateSignerConfig. +func (in *IstioPrivateKeyCertificateSignerConfig) DeepCopy() *IstioPrivateKeyCertificateSignerConfig { + if in == nil { + return nil + } + out := new(IstioPrivateKeyCertificateSignerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IstioSelfSignedCertificateSignerConfig) DeepCopyInto(out *IstioSelfSignedCertificateSignerConfig) { + *out = *in + if in.EnableJitter != nil { + in, out := &in.EnableJitter, &out.EnableJitter + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioSelfSignedCertificateSignerConfig. +func (in *IstioSelfSignedCertificateSignerConfig) DeepCopy() *IstioSelfSignedCertificateSignerConfig { + if in == nil { + return nil + } + out := new(IstioSelfSignedCertificateSignerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IstiodCertificateAuthorityConfig) DeepCopyInto(out *IstiodCertificateAuthorityConfig) { + *out = *in + if in.SelfSigned != nil { + in, out := &in.SelfSigned, &out.SelfSigned + *out = new(IstioSelfSignedCertificateSignerConfig) + (*in).DeepCopyInto(*out) + } + if in.PrivateKey != nil { + in, out := &in.PrivateKey, &out.PrivateKey + *out = new(IstioPrivateKeyCertificateSignerConfig) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstiodCertificateAuthorityConfig. +func (in *IstiodCertificateAuthorityConfig) DeepCopy() *IstiodCertificateAuthorityConfig { + if in == nil { + return nil + } + out := new(IstiodCertificateAuthorityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JaegerAddonConfig) DeepCopyInto(out *JaegerAddonConfig) { + *out = *in + if in.Install != nil { + in, out := &in.Install, &out.Install + *out = new(JaegerInstallConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerAddonConfig. +func (in *JaegerAddonConfig) DeepCopy() *JaegerAddonConfig { + if in == nil { + return nil + } + out := new(JaegerAddonConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JaegerElasticsearchStorageConfig) DeepCopyInto(out *JaegerElasticsearchStorageConfig) { + *out = *in + if in.NodeCount != nil { + in, out := &in.NodeCount, &out.NodeCount + *out = new(int32) + **out = **in + } + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = (*in).DeepCopy() + } + if in.IndexCleaner != nil { + in, out := &in.IndexCleaner, &out.IndexCleaner + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerElasticsearchStorageConfig. +func (in *JaegerElasticsearchStorageConfig) DeepCopy() *JaegerElasticsearchStorageConfig { + if in == nil { + return nil + } + out := new(JaegerElasticsearchStorageConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JaegerIngressConfig) DeepCopyInto(out *JaegerIngressConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(MetadataConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerIngressConfig. +func (in *JaegerIngressConfig) DeepCopy() *JaegerIngressConfig { + if in == nil { + return nil + } + out := new(JaegerIngressConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JaegerInstallConfig) DeepCopyInto(out *JaegerInstallConfig) { + *out = *in + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = new(JaegerStorageConfig) + (*in).DeepCopyInto(*out) + } + if in.Ingress != nil { + in, out := &in.Ingress, &out.Ingress + *out = new(JaegerIngressConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerInstallConfig. +func (in *JaegerInstallConfig) DeepCopy() *JaegerInstallConfig { + if in == nil { + return nil + } + out := new(JaegerInstallConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JaegerMemoryStorageConfig) DeepCopyInto(out *JaegerMemoryStorageConfig) { + *out = *in + if in.MaxTraces != nil { + in, out := &in.MaxTraces, &out.MaxTraces + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerMemoryStorageConfig. +func (in *JaegerMemoryStorageConfig) DeepCopy() *JaegerMemoryStorageConfig { + if in == nil { + return nil + } + out := new(JaegerMemoryStorageConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JaegerStorageConfig) DeepCopyInto(out *JaegerStorageConfig) { + *out = *in + if in.Memory != nil { + in, out := &in.Memory, &out.Memory + *out = new(JaegerMemoryStorageConfig) + (*in).DeepCopyInto(*out) + } + if in.Elasticsearch != nil { + in, out := &in.Elasticsearch, &out.Elasticsearch + *out = new(JaegerElasticsearchStorageConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerStorageConfig. +func (in *JaegerStorageConfig) DeepCopy() *JaegerStorageConfig { + if in == nil { + return nil + } + out := new(JaegerStorageConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KialiAddonConfig) DeepCopyInto(out *KialiAddonConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Install != nil { + in, out := &in.Install, &out.Install + *out = new(KialiInstallConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KialiAddonConfig. +func (in *KialiAddonConfig) DeepCopy() *KialiAddonConfig { + if in == nil { + return nil + } + out := new(KialiAddonConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KialiDashboardConfig) DeepCopyInto(out *KialiDashboardConfig) { + *out = *in + if in.ViewOnly != nil { + in, out := &in.ViewOnly, &out.ViewOnly + *out = new(bool) + **out = **in + } + if in.EnableGrafana != nil { + in, out := &in.EnableGrafana, &out.EnableGrafana + *out = new(bool) + **out = **in + } + if in.EnablePrometheus != nil { + in, out := &in.EnablePrometheus, &out.EnablePrometheus + *out = new(bool) + **out = **in + } + if in.EnableTracing != nil { + in, out := &in.EnableTracing, &out.EnableTracing + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KialiDashboardConfig. +func (in *KialiDashboardConfig) DeepCopy() *KialiDashboardConfig { + if in == nil { + return nil + } + out := new(KialiDashboardConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KialiDeploymentConfig) DeepCopyInto(out *KialiDeploymentConfig) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(v1.ResourceRequirements) + (*in).DeepCopyInto(*out) + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KialiDeploymentConfig. +func (in *KialiDeploymentConfig) DeepCopy() *KialiDeploymentConfig { + if in == nil { + return nil + } + out := new(KialiDeploymentConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KialiInstallConfig) DeepCopyInto(out *KialiInstallConfig) { + *out = *in + if in.Dashboard != nil { + in, out := &in.Dashboard, &out.Dashboard + *out = new(KialiDashboardConfig) + (*in).DeepCopyInto(*out) + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(ComponentServiceConfig) + (*in).DeepCopyInto(*out) + } + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = new(KialiDeploymentConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KialiInstallConfig. +func (in *KialiInstallConfig) DeepCopy() *KialiInstallConfig { + if in == nil { + return nil + } + out := new(KialiInstallConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LightstepTracerConfig) DeepCopyInto(out *LightstepTracerConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LightstepTracerConfig. +func (in *LightstepTracerConfig) DeepCopy() *LightstepTracerConfig { + if in == nil { + return nil + } + out := new(LightstepTracerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoggingConfig) DeepCopyInto(out *LoggingConfig) { + *out = *in + if in.ComponentLevels != nil { + in, out := &in.ComponentLevels, &out.ComponentLevels + *out = make(ComponentLogLevels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.LogAsJSON != nil { + in, out := &in.LogAsJSON, &out.LogAsJSON + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoggingConfig. +func (in *LoggingConfig) DeepCopy() *LoggingConfig { + if in == nil { + return nil + } + out := new(LoggingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshEndpointConfig) DeepCopyInto(out *MeshEndpointConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshEndpointConfig. +func (in *MeshEndpointConfig) DeepCopy() *MeshEndpointConfig { + if in == nil { + return nil + } + out := new(MeshEndpointConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshExpansionConfig) DeepCopyInto(out *MeshExpansionConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.ILBGateway != nil { + in, out := &in.ILBGateway, &out.ILBGateway + *out = new(GatewayConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshExpansionConfig. +func (in *MeshExpansionConfig) DeepCopy() *MeshExpansionConfig { + if in == nil { + return nil + } + out := new(MeshExpansionConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshGatewayConfig) DeepCopyInto(out *MeshGatewayConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshGatewayConfig. +func (in *MeshGatewayConfig) DeepCopy() *MeshGatewayConfig { + if in == nil { + return nil + } + out := new(MeshGatewayConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshNetworkConfig) DeepCopyInto(out *MeshNetworkConfig) { + *out = *in + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]MeshEndpointConfig, len(*in)) + copy(*out, *in) + } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = make([]MeshGatewayConfig, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshNetworkConfig. +func (in *MeshNetworkConfig) DeepCopy() *MeshNetworkConfig { + if in == nil { + return nil + } + out := new(MeshNetworkConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetadataConfig) DeepCopyInto(out *MetadataConfig) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *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 MetadataConfig. +func (in *MetadataConfig) DeepCopy() *MetadataConfig { + if in == nil { + return nil + } + out := new(MetadataConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MixerPolicyAdaptersConfig) DeepCopyInto(out *MixerPolicyAdaptersConfig) { + *out = *in + if in.UseAdapterCRDs != nil { + in, out := &in.UseAdapterCRDs, &out.UseAdapterCRDs + *out = new(bool) + **out = **in + } + if in.KubernetesEnv != nil { + in, out := &in.KubernetesEnv, &out.KubernetesEnv + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixerPolicyAdaptersConfig. +func (in *MixerPolicyAdaptersConfig) DeepCopy() *MixerPolicyAdaptersConfig { + if in == nil { + return nil + } + out := new(MixerPolicyAdaptersConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MixerPolicyConfig) DeepCopyInto(out *MixerPolicyConfig) { + *out = *in + if in.EnableChecks != nil { + in, out := &in.EnableChecks, &out.EnableChecks + *out = new(bool) + **out = **in + } + if in.FailOpen != nil { + in, out := &in.FailOpen, &out.FailOpen + *out = new(bool) + **out = **in + } + if in.SessionAffinity != nil { + in, out := &in.SessionAffinity, &out.SessionAffinity + *out = new(bool) + **out = **in + } + if in.Adapters != nil { + in, out := &in.Adapters, &out.Adapters + *out = new(MixerPolicyAdaptersConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixerPolicyConfig. +func (in *MixerPolicyConfig) DeepCopy() *MixerPolicyConfig { + if in == nil { + return nil + } + out := new(MixerPolicyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MixerTelemetryAdaptersConfig) DeepCopyInto(out *MixerTelemetryAdaptersConfig) { + *out = *in + if in.UseAdapterCRDs != nil { + in, out := &in.UseAdapterCRDs, &out.UseAdapterCRDs + *out = new(bool) + **out = **in + } + if in.KubernetesEnv != nil { + in, out := &in.KubernetesEnv, &out.KubernetesEnv + *out = new(bool) + **out = **in + } + if in.Stdio != nil { + in, out := &in.Stdio, &out.Stdio + *out = new(MixerTelemetryStdioConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixerTelemetryAdaptersConfig. +func (in *MixerTelemetryAdaptersConfig) DeepCopy() *MixerTelemetryAdaptersConfig { + if in == nil { + return nil + } + out := new(MixerTelemetryAdaptersConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MixerTelemetryConfig) DeepCopyInto(out *MixerTelemetryConfig) { + *out = *in + if in.SessionAffinity != nil { + in, out := &in.SessionAffinity, &out.SessionAffinity + *out = new(bool) + **out = **in + } + if in.Loadshedding != nil { + in, out := &in.Loadshedding, &out.Loadshedding + *out = new(TelemetryLoadSheddingConfig) + **out = **in + } + if in.Batching != nil { + in, out := &in.Batching, &out.Batching + *out = new(TelemetryBatchingConfig) + (*in).DeepCopyInto(*out) + } + if in.Adapters != nil { + in, out := &in.Adapters, &out.Adapters + *out = new(MixerTelemetryAdaptersConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixerTelemetryConfig. +func (in *MixerTelemetryConfig) DeepCopy() *MixerTelemetryConfig { + if in == nil { + return nil + } + out := new(MixerTelemetryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MixerTelemetryStdioConfig) DeepCopyInto(out *MixerTelemetryStdioConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.OutputAsJSON != nil { + in, out := &in.OutputAsJSON, &out.OutputAsJSON + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixerTelemetryStdioConfig. +func (in *MixerTelemetryStdioConfig) DeepCopy() *MixerTelemetryStdioConfig { + if in == nil { + return nil + } + out := new(MixerTelemetryStdioConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MultiClusterConfig) DeepCopyInto(out *MultiClusterConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.MeshNetworks != nil { + in, out := &in.MeshNetworks, &out.MeshNetworks + *out = make(map[string]MeshNetworkConfig, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterConfig. +func (in *MultiClusterConfig) DeepCopy() *MultiClusterConfig { + if in == nil { + return nil + } + out := new(MultiClusterConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenShiftRouteConfig) DeepCopyInto(out *OpenShiftRouteConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenShiftRouteConfig. +func (in *OpenShiftRouteConfig) DeepCopy() *OpenShiftRouteConfig { + if in == nil { + return nil + } + out := new(OpenShiftRouteConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodAntiAffinity) DeepCopyInto(out *PodAntiAffinity) { + *out = *in + if in.PodAntiAffinity != nil { + in, out := &in.PodAntiAffinity, &out.PodAntiAffinity + *out = new(v1.PodAntiAffinity) + (*in).DeepCopyInto(*out) + } + if in.RequiredDuringScheduling != nil { + in, out := &in.RequiredDuringScheduling, &out.RequiredDuringScheduling + *out = make([]PodAntiAffinityTerm, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PreferredDuringScheduling != nil { + in, out := &in.PreferredDuringScheduling, &out.PreferredDuringScheduling + *out = make([]PodAntiAffinityTerm, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodAntiAffinity. +func (in *PodAntiAffinity) DeepCopy() *PodAntiAffinity { + if in == nil { + return nil + } + out := new(PodAntiAffinity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodAntiAffinityTerm) DeepCopyInto(out *PodAntiAffinityTerm) { + *out = *in + in.LabelSelectorRequirement.DeepCopyInto(&out.LabelSelectorRequirement) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodAntiAffinityTerm. +func (in *PodAntiAffinityTerm) DeepCopy() *PodAntiAffinityTerm { + if in == nil { + return nil + } + out := new(PodAntiAffinityTerm) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodDisruptionBudget) DeepCopyInto(out *PodDisruptionBudget) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.MinAvailable != nil { + in, out := &in.MinAvailable, &out.MinAvailable + *out = new(intstr.IntOrString) + **out = **in + } + if in.MaxUnavailable != nil { + in, out := &in.MaxUnavailable, &out.MaxUnavailable + *out = new(intstr.IntOrString) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDisruptionBudget. +func (in *PodDisruptionBudget) DeepCopy() *PodDisruptionBudget { + if in == nil { + return nil + } + out := new(PodDisruptionBudget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodRuntimeConfig) DeepCopyInto(out *PodRuntimeConfig) { + *out = *in + in.CommonPodRuntimeConfig.DeepCopyInto(&out.CommonPodRuntimeConfig) + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(MetadataConfig) + (*in).DeepCopyInto(*out) + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(Affinity) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodRuntimeConfig. +func (in *PodRuntimeConfig) DeepCopy() *PodRuntimeConfig { + if in == nil { + return nil + } + out := new(PodRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyConfig) DeepCopyInto(out *PolicyConfig) { + *out = *in + if in.Mixer != nil { + in, out := &in.Mixer, &out.Mixer + *out = new(MixerPolicyConfig) + (*in).DeepCopyInto(*out) + } + if in.Remote != nil { + in, out := &in.Remote, &out.Remote + *out = new(RemotePolicyConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyConfig. +func (in *PolicyConfig) DeepCopy() *PolicyConfig { + if in == nil { + return nil + } + out := new(PolicyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrometheusAddonConfig) DeepCopyInto(out *PrometheusAddonConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Scrape != nil { + in, out := &in.Scrape, &out.Scrape + *out = new(bool) + **out = **in + } + if in.Install != nil { + in, out := &in.Install, &out.Install + *out = new(PrometheusInstallConfig) + (*in).DeepCopyInto(*out) + } + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusAddonConfig. +func (in *PrometheusAddonConfig) DeepCopy() *PrometheusAddonConfig { + if in == nil { + return nil + } + out := new(PrometheusAddonConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrometheusInstallConfig) DeepCopyInto(out *PrometheusInstallConfig) { + *out = *in + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(ComponentServiceConfig) + (*in).DeepCopyInto(*out) + } + if in.UseTLS != nil { + in, out := &in.UseTLS, &out.UseTLS + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusInstallConfig. +func (in *PrometheusInstallConfig) DeepCopy() *PrometheusInstallConfig { + if in == nil { + return nil + } + out := new(PrometheusInstallConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyAccessLoggingConfig) DeepCopyInto(out *ProxyAccessLoggingConfig) { + *out = *in + if in.File != nil { + in, out := &in.File, &out.File + *out = new(ProxyFileAccessLogConfig) + **out = **in + } + if in.EnvoyService != nil { + in, out := &in.EnvoyService, &out.EnvoyService + *out = new(ProxyEnvoyServiceConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyAccessLoggingConfig. +func (in *ProxyAccessLoggingConfig) DeepCopy() *ProxyAccessLoggingConfig { + if in == nil { + return nil + } + out := new(ProxyAccessLoggingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig) { + *out = *in + if in.Logging != nil { + in, out := &in.Logging, &out.Logging + *out = new(ProxyLoggingConfig) + (*in).DeepCopyInto(*out) + } + if in.Networking != nil { + in, out := &in.Networking, &out.Networking + *out = new(ProxyNetworkingConfig) + (*in).DeepCopyInto(*out) + } + if in.Runtime != nil { + in, out := &in.Runtime, &out.Runtime + *out = new(ProxyRuntimeConfig) + (*in).DeepCopyInto(*out) + } + if in.Injection != nil { + in, out := &in.Injection, &out.Injection + *out = new(ProxyInjectionConfig) + (*in).DeepCopyInto(*out) + } + if in.Concurrency != nil { + in, out := &in.Concurrency, &out.Concurrency + *out = new(int32) + **out = **in + } + if in.AccessLogging != nil { + in, out := &in.AccessLogging, &out.AccessLogging + *out = new(ProxyAccessLoggingConfig) + (*in).DeepCopyInto(*out) + } + if in.EnvoyMetricsService != nil { + in, out := &in.EnvoyMetricsService, &out.EnvoyMetricsService + *out = new(ProxyEnvoyServiceConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig. +func (in *ProxyConfig) DeepCopy() *ProxyConfig { + if in == nil { + return nil + } + out := new(ProxyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyDNSConfig) DeepCopyInto(out *ProxyDNSConfig) { + *out = *in + if in.SearchSuffixes != nil { + in, out := &in.SearchSuffixes, &out.SearchSuffixes + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyDNSConfig. +func (in *ProxyDNSConfig) DeepCopy() *ProxyDNSConfig { + if in == nil { + return nil + } + out := new(ProxyDNSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyEnvoyServiceConfig) DeepCopyInto(out *ProxyEnvoyServiceConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.TCPKeepalive != nil { + in, out := &in.TCPKeepalive, &out.TCPKeepalive + *out = new(EnvoyServiceTCPKeepalive) + **out = **in + } + if in.TLSSettings != nil { + in, out := &in.TLSSettings, &out.TLSSettings + *out = new(EnvoyServiceClientTLSSettings) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyEnvoyServiceConfig. +func (in *ProxyEnvoyServiceConfig) DeepCopy() *ProxyEnvoyServiceConfig { + if in == nil { + return nil + } + out := new(ProxyEnvoyServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyFileAccessLogConfig) DeepCopyInto(out *ProxyFileAccessLogConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyFileAccessLogConfig. +func (in *ProxyFileAccessLogConfig) DeepCopy() *ProxyFileAccessLogConfig { + if in == nil { + return nil + } + out := new(ProxyFileAccessLogConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyInboundTrafficControlConfig) DeepCopyInto(out *ProxyInboundTrafficControlConfig) { + *out = *in + if in.IncludedPorts != nil { + in, out := &in.IncludedPorts, &out.IncludedPorts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedPorts != nil { + in, out := &in.ExcludedPorts, &out.ExcludedPorts + *out = make([]int32, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyInboundTrafficControlConfig. +func (in *ProxyInboundTrafficControlConfig) DeepCopy() *ProxyInboundTrafficControlConfig { + if in == nil { + return nil + } + out := new(ProxyInboundTrafficControlConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyInitContainerConfig) DeepCopyInto(out *ProxyInitContainerConfig) { + *out = *in + if in.Runtime != nil { + in, out := &in.Runtime, &out.Runtime + *out = new(ContainerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyInitContainerConfig. +func (in *ProxyInitContainerConfig) DeepCopy() *ProxyInitContainerConfig { + if in == nil { + return nil + } + out := new(ProxyInitContainerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyInjectionConfig) DeepCopyInto(out *ProxyInjectionConfig) { + *out = *in + if in.AutoInject != nil { + in, out := &in.AutoInject, &out.AutoInject + *out = new(bool) + **out = **in + } + if in.AlwaysInjectSelector != nil { + in, out := &in.AlwaysInjectSelector, &out.AlwaysInjectSelector + *out = make([]metav1.LabelSelector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NeverInjectSelector != nil { + in, out := &in.NeverInjectSelector, &out.NeverInjectSelector + *out = make([]metav1.LabelSelector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InjectedAnnotations != nil { + in, out := &in.InjectedAnnotations, &out.InjectedAnnotations + *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 ProxyInjectionConfig. +func (in *ProxyInjectionConfig) DeepCopy() *ProxyInjectionConfig { + if in == nil { + return nil + } + out := new(ProxyInjectionConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyLoggingConfig) DeepCopyInto(out *ProxyLoggingConfig) { + *out = *in + if in.ComponentLevels != nil { + in, out := &in.ComponentLevels, &out.ComponentLevels + *out = make(ComponentLogLevels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyLoggingConfig. +func (in *ProxyLoggingConfig) DeepCopy() *ProxyLoggingConfig { + if in == nil { + return nil + } + out := new(ProxyLoggingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyNetworkAutoProtocolDetectionConfig) DeepCopyInto(out *ProxyNetworkAutoProtocolDetectionConfig) { + *out = *in + if in.Inbound != nil { + in, out := &in.Inbound, &out.Inbound + *out = new(bool) + **out = **in + } + if in.Outbound != nil { + in, out := &in.Outbound, &out.Outbound + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyNetworkAutoProtocolDetectionConfig. +func (in *ProxyNetworkAutoProtocolDetectionConfig) DeepCopy() *ProxyNetworkAutoProtocolDetectionConfig { + if in == nil { + return nil + } + out := new(ProxyNetworkAutoProtocolDetectionConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyNetworkInitConfig) DeepCopyInto(out *ProxyNetworkInitConfig) { + *out = *in + if in.InitContainer != nil { + in, out := &in.InitContainer, &out.InitContainer + *out = new(ProxyInitContainerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyNetworkInitConfig. +func (in *ProxyNetworkInitConfig) DeepCopy() *ProxyNetworkInitConfig { + if in == nil { + return nil + } + out := new(ProxyNetworkInitConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyNetworkProtocolConfig) DeepCopyInto(out *ProxyNetworkProtocolConfig) { + *out = *in + if in.AutoDetect != nil { + in, out := &in.AutoDetect, &out.AutoDetect + *out = new(ProxyNetworkAutoProtocolDetectionConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyNetworkProtocolConfig. +func (in *ProxyNetworkProtocolConfig) DeepCopy() *ProxyNetworkProtocolConfig { + if in == nil { + return nil + } + out := new(ProxyNetworkProtocolConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyNetworkingConfig) DeepCopyInto(out *ProxyNetworkingConfig) { + *out = *in + if in.Initialization != nil { + in, out := &in.Initialization, &out.Initialization + *out = new(ProxyNetworkInitConfig) + (*in).DeepCopyInto(*out) + } + if in.TrafficControl != nil { + in, out := &in.TrafficControl, &out.TrafficControl + *out = new(ProxyTrafficControlConfig) + (*in).DeepCopyInto(*out) + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(ProxyNetworkProtocolConfig) + (*in).DeepCopyInto(*out) + } + if in.DNS != nil { + in, out := &in.DNS, &out.DNS + *out = new(ProxyDNSConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyNetworkingConfig. +func (in *ProxyNetworkingConfig) DeepCopy() *ProxyNetworkingConfig { + if in == nil { + return nil + } + out := new(ProxyNetworkingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyOutboundTrafficControlConfig) DeepCopyInto(out *ProxyOutboundTrafficControlConfig) { + *out = *in + if in.IncludedIPRanges != nil { + in, out := &in.IncludedIPRanges, &out.IncludedIPRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedIPRanges != nil { + in, out := &in.ExcludedIPRanges, &out.ExcludedIPRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedPorts != nil { + in, out := &in.ExcludedPorts, &out.ExcludedPorts + *out = make([]int32, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyOutboundTrafficControlConfig. +func (in *ProxyOutboundTrafficControlConfig) DeepCopy() *ProxyOutboundTrafficControlConfig { + if in == nil { + return nil + } + out := new(ProxyOutboundTrafficControlConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyReadinessConfig) DeepCopyInto(out *ProxyReadinessConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyReadinessConfig. +func (in *ProxyReadinessConfig) DeepCopy() *ProxyReadinessConfig { + if in == nil { + return nil + } + out := new(ProxyReadinessConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyRuntimeConfig) DeepCopyInto(out *ProxyRuntimeConfig) { + *out = *in + if in.Readiness != nil { + in, out := &in.Readiness, &out.Readiness + *out = new(ProxyReadinessConfig) + **out = **in + } + if in.Container != nil { + in, out := &in.Container, &out.Container + *out = new(ContainerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyRuntimeConfig. +func (in *ProxyRuntimeConfig) DeepCopy() *ProxyRuntimeConfig { + if in == nil { + return nil + } + out := new(ProxyRuntimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyTrafficControlConfig) DeepCopyInto(out *ProxyTrafficControlConfig) { + *out = *in + in.Inbound.DeepCopyInto(&out.Inbound) + in.Outbound.DeepCopyInto(&out.Outbound) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyTrafficControlConfig. +func (in *ProxyTrafficControlConfig) DeepCopy() *ProxyTrafficControlConfig { + if in == nil { + return nil + } + out := new(ProxyTrafficControlConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ReadinessMap) DeepCopyInto(out *ReadinessMap) { + { + in := &in + *out = make(ReadinessMap, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make([]string, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadinessMap. +func (in ReadinessMap) DeepCopy() ReadinessMap { + if in == nil { + return nil + } + out := new(ReadinessMap) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReadinessStatus) DeepCopyInto(out *ReadinessStatus) { + *out = *in + if in.Components != nil { + in, out := &in.Components, &out.Components + *out = make(ReadinessMap, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make([]string, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadinessStatus. +func (in *ReadinessStatus) DeepCopy() *ReadinessStatus { + if in == nil { + return nil + } + out := new(ReadinessStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemotePolicyConfig) DeepCopyInto(out *RemotePolicyConfig) { + *out = *in + if in.CreateService != nil { + in, out := &in.CreateService, &out.CreateService + *out = new(bool) + **out = **in + } + if in.EnableChecks != nil { + in, out := &in.EnableChecks, &out.EnableChecks + *out = new(bool) + **out = **in + } + if in.FailOpen != nil { + in, out := &in.FailOpen, &out.FailOpen + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemotePolicyConfig. +func (in *RemotePolicyConfig) DeepCopy() *RemotePolicyConfig { + if in == nil { + return nil + } + out := new(RemotePolicyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemoteTelemetryConfig) DeepCopyInto(out *RemoteTelemetryConfig) { + *out = *in + if in.CreateService != nil { + in, out := &in.CreateService, &out.CreateService + *out = new(bool) + **out = **in + } + if in.Batching != nil { + in, out := &in.Batching, &out.Batching + *out = new(TelemetryBatchingConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteTelemetryConfig. +func (in *RemoteTelemetryConfig) DeepCopy() *RemoteTelemetryConfig { + if in == nil { + return nil + } + out := new(RemoteTelemetryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretDiscoveryService) DeepCopyInto(out *SecretDiscoveryService) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Runtime != nil { + in, out := &in.Runtime, &out.Runtime + *out = new(ContainerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretDiscoveryService. +func (in *SecretDiscoveryService) DeepCopy() *SecretDiscoveryService { + if in == nil { + return nil + } + out := new(SecretDiscoveryService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityConfig) DeepCopyInto(out *SecurityConfig) { + *out = *in + if in.Trust != nil { + in, out := &in.Trust, &out.Trust + *out = new(TrustConfig) + (*in).DeepCopyInto(*out) + } + if in.CertificateAuthority != nil { + in, out := &in.CertificateAuthority, &out.CertificateAuthority + *out = new(CertificateAuthorityConfig) + (*in).DeepCopyInto(*out) + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityConfig) + (*in).DeepCopyInto(*out) + } + if in.ControlPlane != nil { + in, out := &in.ControlPlane, &out.ControlPlane + *out = new(ControlPlaneSecurityConfig) + (*in).DeepCopyInto(*out) + } + if in.DataPlane != nil { + in, out := &in.DataPlane, &out.DataPlane + *out = new(DataPlaneSecurityConfig) + (*in).DeepCopyInto(*out) + } + if in.ManageNetworkPolicy != nil { + in, out := &in.ManageNetworkPolicy, &out.ManageNetworkPolicy + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityConfig. +func (in *SecurityConfig) DeepCopy() *SecurityConfig { + if in == nil { + return nil + } + out := new(SecurityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshControlPlane) DeepCopyInto(out *ServiceMeshControlPlane) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshControlPlane. +func (in *ServiceMeshControlPlane) DeepCopy() *ServiceMeshControlPlane { + if in == nil { + return nil + } + out := new(ServiceMeshControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshControlPlane) 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 *ServiceMeshControlPlaneList) DeepCopyInto(out *ServiceMeshControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceMeshControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshControlPlaneList. +func (in *ServiceMeshControlPlaneList) DeepCopy() *ServiceMeshControlPlaneList { + if in == nil { + return nil + } + out := new(ServiceMeshControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshControlPlaneList) 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 *StackdriverAccessLogTelemetryConfig) DeepCopyInto(out *StackdriverAccessLogTelemetryConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackdriverAccessLogTelemetryConfig. +func (in *StackdriverAccessLogTelemetryConfig) DeepCopy() *StackdriverAccessLogTelemetryConfig { + if in == nil { + return nil + } + out := new(StackdriverAccessLogTelemetryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StackdriverAddonConfig) DeepCopyInto(out *StackdriverAddonConfig) { + *out = *in + if in.Tracer != nil { + in, out := &in.Tracer, &out.Tracer + *out = new(StackdriverTracerConfig) + (*in).DeepCopyInto(*out) + } + if in.Telemetry != nil { + in, out := &in.Telemetry, &out.Telemetry + *out = new(StackdriverTelemetryConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackdriverAddonConfig. +func (in *StackdriverAddonConfig) DeepCopy() *StackdriverAddonConfig { + if in == nil { + return nil + } + out := new(StackdriverAddonConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StackdriverAuthConfig) DeepCopyInto(out *StackdriverAuthConfig) { + *out = *in + if in.AppCredentials != nil { + in, out := &in.AppCredentials, &out.AppCredentials + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackdriverAuthConfig. +func (in *StackdriverAuthConfig) DeepCopy() *StackdriverAuthConfig { + if in == nil { + return nil + } + out := new(StackdriverAuthConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StackdriverTelemetryConfig) DeepCopyInto(out *StackdriverTelemetryConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(StackdriverAuthConfig) + (*in).DeepCopyInto(*out) + } + if in.EnableContextGraph != nil { + in, out := &in.EnableContextGraph, &out.EnableContextGraph + *out = new(bool) + **out = **in + } + if in.EnableLogging != nil { + in, out := &in.EnableLogging, &out.EnableLogging + *out = new(bool) + **out = **in + } + if in.EnableMetrics != nil { + in, out := &in.EnableMetrics, &out.EnableMetrics + *out = new(bool) + **out = **in + } + if in.AccessLogging != nil { + in, out := &in.AccessLogging, &out.AccessLogging + *out = new(StackdriverAccessLogTelemetryConfig) + (*in).DeepCopyInto(*out) + } + if in.ConfigOverride != nil { + in, out := &in.ConfigOverride, &out.ConfigOverride + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackdriverTelemetryConfig. +func (in *StackdriverTelemetryConfig) DeepCopy() *StackdriverTelemetryConfig { + if in == nil { + return nil + } + out := new(StackdriverTelemetryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StackdriverTracerConfig) DeepCopyInto(out *StackdriverTracerConfig) { + *out = *in + if in.Debug != nil { + in, out := &in.Debug, &out.Debug + *out = new(bool) + **out = **in + } + if in.MaxNumberOfAttributes != nil { + in, out := &in.MaxNumberOfAttributes, &out.MaxNumberOfAttributes + *out = new(int64) + **out = **in + } + if in.MaxNumberOfAnnotations != nil { + in, out := &in.MaxNumberOfAnnotations, &out.MaxNumberOfAnnotations + *out = new(int64) + **out = **in + } + if in.MaxNumberOfMessageEvents != nil { + in, out := &in.MaxNumberOfMessageEvents, &out.MaxNumberOfMessageEvents + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackdriverTracerConfig. +func (in *StackdriverTracerConfig) DeepCopy() *StackdriverTracerConfig { + if in == nil { + return nil + } + out := new(StackdriverTracerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TelemetryBatchingConfig) DeepCopyInto(out *TelemetryBatchingConfig) { + *out = *in + if in.MaxEntries != nil { + in, out := &in.MaxEntries, &out.MaxEntries + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryBatchingConfig. +func (in *TelemetryBatchingConfig) DeepCopy() *TelemetryBatchingConfig { + if in == nil { + return nil + } + out := new(TelemetryBatchingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TelemetryConfig) DeepCopyInto(out *TelemetryConfig) { + *out = *in + if in.Mixer != nil { + in, out := &in.Mixer, &out.Mixer + *out = new(MixerTelemetryConfig) + (*in).DeepCopyInto(*out) + } + if in.Remote != nil { + in, out := &in.Remote, &out.Remote + *out = new(RemoteTelemetryConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryConfig. +func (in *TelemetryConfig) DeepCopy() *TelemetryConfig { + if in == nil { + return nil + } + out := new(TelemetryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TelemetryLoadSheddingConfig) DeepCopyInto(out *TelemetryLoadSheddingConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryLoadSheddingConfig. +func (in *TelemetryLoadSheddingConfig) DeepCopy() *TelemetryLoadSheddingConfig { + if in == nil { + return nil + } + out := new(TelemetryLoadSheddingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThirdPartyIdentityConfig) DeepCopyInto(out *ThirdPartyIdentityConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThirdPartyIdentityConfig. +func (in *ThirdPartyIdentityConfig) DeepCopy() *ThirdPartyIdentityConfig { + if in == nil { + return nil + } + out := new(ThirdPartyIdentityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThreeScaleAddonConfig) DeepCopyInto(out *ThreeScaleAddonConfig) { + *out = *in + in.Enablement.DeepCopyInto(&out.Enablement) + if in.ListenAddr != nil { + in, out := &in.ListenAddr, &out.ListenAddr + *out = new(int32) + **out = **in + } + if in.LogGRPC != nil { + in, out := &in.LogGRPC, &out.LogGRPC + *out = new(bool) + **out = **in + } + if in.LogJSON != nil { + in, out := &in.LogJSON, &out.LogJSON + *out = new(bool) + **out = **in + } + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = new(ThreeScaleMetricsConfig) + (*in).DeepCopyInto(*out) + } + if in.System != nil { + in, out := &in.System, &out.System + *out = new(ThreeScaleSystemConfig) + (*in).DeepCopyInto(*out) + } + if in.Client != nil { + in, out := &in.Client, &out.Client + *out = new(ThreeScaleClientConfig) + (*in).DeepCopyInto(*out) + } + if in.GRPC != nil { + in, out := &in.GRPC, &out.GRPC + *out = new(ThreeScaleGRPCConfig) + (*in).DeepCopyInto(*out) + } + if in.Backend != nil { + in, out := &in.Backend, &out.Backend + *out = new(ThreeScaleBackendConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThreeScaleAddonConfig. +func (in *ThreeScaleAddonConfig) DeepCopy() *ThreeScaleAddonConfig { + if in == nil { + return nil + } + out := new(ThreeScaleAddonConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThreeScaleBackendConfig) DeepCopyInto(out *ThreeScaleBackendConfig) { + *out = *in + if in.EnableCache != nil { + in, out := &in.EnableCache, &out.EnableCache + *out = new(bool) + **out = **in + } + if in.CacheFlushInterval != nil { + in, out := &in.CacheFlushInterval, &out.CacheFlushInterval + *out = new(int32) + **out = **in + } + if in.PolicyFailClosed != nil { + in, out := &in.PolicyFailClosed, &out.PolicyFailClosed + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThreeScaleBackendConfig. +func (in *ThreeScaleBackendConfig) DeepCopy() *ThreeScaleBackendConfig { + if in == nil { + return nil + } + out := new(ThreeScaleBackendConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThreeScaleClientConfig) DeepCopyInto(out *ThreeScaleClientConfig) { + *out = *in + if in.AllowInsecureConnections != nil { + in, out := &in.AllowInsecureConnections, &out.AllowInsecureConnections + *out = new(bool) + **out = **in + } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThreeScaleClientConfig. +func (in *ThreeScaleClientConfig) DeepCopy() *ThreeScaleClientConfig { + if in == nil { + return nil + } + out := new(ThreeScaleClientConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThreeScaleGRPCConfig) DeepCopyInto(out *ThreeScaleGRPCConfig) { + *out = *in + if in.MaxConnTimeout != nil { + in, out := &in.MaxConnTimeout, &out.MaxConnTimeout + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThreeScaleGRPCConfig. +func (in *ThreeScaleGRPCConfig) DeepCopy() *ThreeScaleGRPCConfig { + if in == nil { + return nil + } + out := new(ThreeScaleGRPCConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThreeScaleMetricsConfig) DeepCopyInto(out *ThreeScaleMetricsConfig) { + *out = *in + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) + **out = **in + } + if in.Report != nil { + in, out := &in.Report, &out.Report + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThreeScaleMetricsConfig. +func (in *ThreeScaleMetricsConfig) DeepCopy() *ThreeScaleMetricsConfig { + if in == nil { + return nil + } + out := new(ThreeScaleMetricsConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThreeScaleSystemConfig) DeepCopyInto(out *ThreeScaleSystemConfig) { + *out = *in + if in.CacheMaxSize != nil { + in, out := &in.CacheMaxSize, &out.CacheMaxSize + *out = new(int64) + **out = **in + } + if in.CacheRefreshRetries != nil { + in, out := &in.CacheRefreshRetries, &out.CacheRefreshRetries + *out = new(int32) + **out = **in + } + if in.CacheRefreshInterval != nil { + in, out := &in.CacheRefreshInterval, &out.CacheRefreshInterval + *out = new(int32) + **out = **in + } + if in.CacheTTL != nil { + in, out := &in.CacheTTL, &out.CacheTTL + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThreeScaleSystemConfig. +func (in *ThreeScaleSystemConfig) DeepCopy() *ThreeScaleSystemConfig { + if in == nil { + return nil + } + out := new(ThreeScaleSystemConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TracingConfig) DeepCopyInto(out *TracingConfig) { + *out = *in + if in.Sampling != nil { + in, out := &in.Sampling, &out.Sampling + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TracingConfig. +func (in *TracingConfig) DeepCopy() *TracingConfig { + if in == nil { + return nil + } + out := new(TracingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TrustConfig) DeepCopyInto(out *TrustConfig) { + *out = *in + if in.AdditionalDomains != nil { + in, out := &in.AdditionalDomains, &out.AdditionalDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrustConfig. +func (in *TrustConfig) DeepCopy() *TrustConfig { + if in == nil { + return nil + } + out := new(TrustConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeConfig) DeepCopyInto(out *VolumeConfig) { + *out = *in + in.Volume.DeepCopyInto(&out.Volume) + in.Mount.DeepCopyInto(&out.Mount) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeConfig. +func (in *VolumeConfig) DeepCopy() *VolumeConfig { + if in == nil { + return nil + } + out := new(VolumeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ZipkinTracerConfig) DeepCopyInto(out *ZipkinTracerConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZipkinTracerConfig. +func (in *ZipkinTracerConfig) DeepCopy() *ZipkinTracerConfig { + if in == nil { + return nil + } + out := new(ZipkinTracerConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/external/maistra/version/version.go b/api/external/maistra/version/version.go new file mode 100644 index 000000000..f5c52a6ea --- /dev/null +++ b/api/external/maistra/version/version.go @@ -0,0 +1,48 @@ +package version + +import ( + "fmt" + "runtime" +) + +var ( + buildVersion = "unknown" + buildGitRevision = "unknown" + buildStatus = "unknown" + buildTag = "unknown" + + // Minimum supported mesh version (nil (all), "v2_0", "v2_1" etc) + minimumSupportedVersion = "v2.0" + + // Info exports the build version information. + Info BuildInfo +) + +// BuildInfo describes version information about the binary build. +type BuildInfo struct { + Version string + GitRevision string + BuildStatus string + GitTag string + GoVersion string + GoArch string + OperatorSDK string + MinimumSupportedVersion string +} + +func (b BuildInfo) String() string { + return fmt.Sprintf("%#v", b) +} + +func init() { + Info = BuildInfo{ + Version: buildVersion, + GitRevision: buildGitRevision, + BuildStatus: buildStatus, + GitTag: buildTag, + GoVersion: runtime.Version(), + GoArch: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), + OperatorSDK: "v0.18.0", + MinimumSupportedVersion: minimumSupportedVersion, + } +} diff --git a/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml b/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml index c401ff9a0..41fb79bf2 100644 --- a/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml @@ -76,6 +76,12 @@ spec: - patch - update - watch + - apiGroups: + - "" + resources: + - pods + verbs: + - update - apiGroups: - apiextensions.k8s.io resources: @@ -287,6 +293,28 @@ spec: - patch - update - watch + - apiGroups: + - maistra.io + resources: + - servicemeshcontrolplanes + verbs: + - get + - list + - patch + - update + - watch + - apiGroups: + - maistra.io + resources: + - servicemeshmemberrolls + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - networking.istio.io resources: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index fc3190c65..8a0862ea8 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -35,6 +35,12 @@ rules: - patch - update - watch +- apiGroups: + - "" + resources: + - pods + verbs: + - update - apiGroups: - apiextensions.k8s.io resources: @@ -246,6 +252,28 @@ rules: - patch - update - watch +- apiGroups: + - maistra.io + resources: + - servicemeshcontrolplanes + verbs: + - get + - list + - patch + - update + - watch +- apiGroups: + - maistra.io + resources: + - servicemeshmemberrolls + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - networking.istio.io resources: diff --git a/controllers/kuadrant_controller.go b/controllers/kuadrant_controller.go index b702e74d3..5b4688328 100644 --- a/controllers/kuadrant_controller.go +++ b/controllers/kuadrant_controller.go @@ -23,6 +23,8 @@ import ( "github.com/go-logr/logr" authorinov1beta1 "github.com/kuadrant/authorino-operator/api/v1beta1" + maistrav1 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v1" + maistrav2 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v2" limitadorv1alpha1 "github.com/kuadrant/limitador-operator/api/v1alpha1" "golang.org/x/sync/errgroup" "google.golang.org/protobuf/encoding/protojson" @@ -32,6 +34,7 @@ import ( iopv1alpha1 "istio.io/istio/operator/pkg/apis/istio/v1alpha1" appsv1 "k8s.io/api/apps/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" + apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" @@ -81,6 +84,9 @@ type KuadrantReconciler struct { //+kubebuilder:rbac:groups="security.istio.io",resources=authorizationpolicies,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=install.istio.io,resources=istiooperators,verbs=get;list;watch;create;update;patch //+kubebuilder:rbac:groups=extensions.istio.io,resources=wasmplugins,verbs=get;list;watch;create;update;delete;patch +//+kubebuilder:rbac:groups=maistra.io,resources=servicemeshcontrolplanes,verbs=get;list;watch;update;patch +//+kubebuilder:rbac:groups=maistra.io,resources=servicemeshmemberrolls,verbs=get;list;watch;create;update;delete;patch +//+kubebuilder:rbac:groups="",resources=pods,verbs=update // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. @@ -112,7 +118,7 @@ func (r *KuadrantReconciler) Reconcile(eventCtx context.Context, req ctrl.Reques if kObj.GetDeletionTimestamp() != nil && controllerutil.ContainsFinalizer(kObj, kuadrantFinalizer) { logger.V(1).Info("Handling removal of kuadrant object") - if err := r.unregisterExternalAuthorizer(ctx); err != nil { + if err := r.unregisterExternalAuthorizer(ctx, kObj); err != nil { return ctrl.Result{}, err } @@ -170,14 +176,29 @@ func (r *KuadrantReconciler) Reconcile(eventCtx context.Context, req ctrl.Reques return ctrl.Result{}, nil } -func (r *KuadrantReconciler) unregisterExternalAuthorizer(ctx context.Context) error { +func (r *KuadrantReconciler) unregisterExternalAuthorizer(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error { + logger, _ := logr.FromContext(ctx) + + err := r.unregisterExternalAuthorizerIstio(ctx) + + if err != nil && apimeta.IsNoMatchError(err) { + err = r.unregisterExternalAuthorizerOSSM(ctx, kObj) + } + + if err != nil { + logger.Error(err, "failed fo get service mesh control plane") + } + + return err +} + +func (r *KuadrantReconciler) unregisterExternalAuthorizerIstio(ctx context.Context) error { logger, _ := logr.FromContext(ctx) iop := &iopv1alpha1.IstioOperator{} - iopKey := client.ObjectKey{Name: iopName(), Namespace: iopNamespace()} + iopKey := client.ObjectKey{Name: controlPlaneProviderName(), Namespace: controlPlaneProviderNamespace()} if err := r.Client().Get(ctx, iopKey, iop); err != nil { - // It should exists, NotFound also considered as error - logger.Error(err, "failed to get istiooperator object", "key", iopKey) + logger.V(1).Info("failed to get istiooperator object", "key", iopKey, "err", err) return err } @@ -214,24 +235,118 @@ func (r *KuadrantReconciler) unregisterExternalAuthorizer(ctx context.Context) e return nil } +func (r *KuadrantReconciler) unregisterExternalAuthorizerOSSM(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error { + logger, _ := logr.FromContext(ctx) + + if err := r.unregisterFromServiceMeshMemberRoll(ctx, kObj); err != nil { + return err + } + + smcp := &maistrav2.ServiceMeshControlPlane{} + + smcpKey := client.ObjectKey{Name: controlPlaneProviderName(), Namespace: controlPlaneProviderNamespace()} + if err := r.Client().Get(ctx, smcpKey, smcp); err != nil { + logger.V(1).Info("failed to get servicemeshcontrolplane object", "key", smcp, "err", err) + return err + } + + if smcp.Spec.TechPreview == nil { + smcp.Spec.TechPreview = maistrav1.NewHelmValues(nil) + } + + var meshConfig *istiomeshv1alpha1.MeshConfig + + if conf, found, err := smcp.Spec.TechPreview.GetMap("meshConfig"); err != nil { + return err + } else if found { + meshConfigStruct, err := structpb.NewStruct(conf) + if err != nil { + return err + } + meshConfig, _ = meshConfigFromStruct(meshConfigStruct) + } else { + meshConfig = &istiomeshv1alpha1.MeshConfig{} + } + extensionProviders := extensionProvidersFromMeshConfig(meshConfig) + + if !hasKuadrantAuthorizer(extensionProviders) { + return nil + } + + for idx, extensionProvider := range extensionProviders { + name := extensionProvider.Name + if name == extAuthorizerName { + // deletes the element in the array + extensionProviders = append(extensionProviders[:idx], extensionProviders[idx+1:]...) + meshConfig.ExtensionProviders = extensionProviders + meshConfigStruct, err := meshConfigToStruct(meshConfig) + if err != nil { + return err + } + smcp.Spec.TechPreview.SetField("meshConfig", meshConfigStruct.AsMap()) + break + } + } + + logger.Info("remove external authorizer from meshconfig") + if err := r.Client().Update(ctx, smcp); err != nil { + return err + } + + return nil +} + +func (r *KuadrantReconciler) unregisterFromServiceMeshMemberRoll(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error { + return r.ReconcileResource(ctx, &maistrav1.ServiceMeshMemberRoll{}, buildServiceMeshMemberRoll(kObj), func(existingObj, desiredObj client.Object) (bool, error) { + existing, ok := existingObj.(*maistrav1.ServiceMeshMemberRoll) + if !ok { + return false, fmt.Errorf("%T is not a *maistrav1.ServiceMeshMemberRoll", existingObj) + } + desired, ok := desiredObj.(*maistrav1.ServiceMeshMemberRoll) + if !ok { + return false, fmt.Errorf("%T is not a *maistrav1.ServiceMeshMemberRoll", desiredObj) + } + desired.Spec.Members = []string{} + + update := false + for _, member := range existing.Spec.Members { + if member == kObj.Namespace { + update = true + } else { + desired.Spec.Members = append(desired.Spec.Members, member) + } + } + existing.Spec.Members = desired.Spec.Members + return update, nil + }) +} + func (r *KuadrantReconciler) registerExternalAuthorizer(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error { logger, _ := logr.FromContext(ctx) + + err := r.registerExternalAuthorizerIstio(ctx, kObj) + + if err != nil && apimeta.IsNoMatchError(err) { + err = r.registerExternalAuthorizerOSSM(ctx, kObj) + } + + if err != nil { + logger.Error(err, "failed fo get service mesh control plane") + } + + return err +} + +func (r *KuadrantReconciler) registerExternalAuthorizerIstio(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error { + logger, _ := logr.FromContext(ctx) iop := &iopv1alpha1.IstioOperator{} - iopKey := client.ObjectKey{Name: iopName(), Namespace: iopNamespace()} + iopKey := client.ObjectKey{Name: controlPlaneProviderName(), Namespace: controlPlaneProviderNamespace()} if err := r.Client().Get(ctx, iopKey, iop); err != nil { - // It should exists, NotFound also considered as error - logger.Error(err, "failed to get istiooperator object", "key", iopKey) + logger.V(1).Info("failed to get istiooperator object", "key", iopKey, "err", err) return err } - //meshConfig: - // extensionProviders: - // - envoyExtAuthzGrpc: - // port: POST - // service: AUTHORINO SERVICE - // name: kuadrant-authorization - if iop.Spec == nil { iop.Spec = &istioapiv1alpha1.IstioOperatorSpec{} } @@ -260,6 +375,75 @@ func (r *KuadrantReconciler) registerExternalAuthorizer(ctx context.Context, kOb return nil } +func (r *KuadrantReconciler) registerExternalAuthorizerOSSM(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error { + logger, _ := logr.FromContext(ctx) + + if err := r.registerToServiceMeshMemberRoll(ctx, kObj); err != nil { + return err + } + + smcp := &maistrav2.ServiceMeshControlPlane{} + + smcpKey := client.ObjectKey{Name: controlPlaneProviderName(), Namespace: controlPlaneProviderNamespace()} + if err := r.Client().Get(ctx, smcpKey, smcp); err != nil { + logger.V(1).Info("failed to get servicemeshcontrolplane object", "key", smcp, "err", err) + return err + } + + if smcp.Spec.TechPreview == nil { + smcp.Spec.TechPreview = maistrav1.NewHelmValues(nil) + } + + var meshConfig *istiomeshv1alpha1.MeshConfig + + if conf, found, err := smcp.Spec.TechPreview.GetMap("meshConfig"); err != nil { + return err + } else if found { + meshConfigStruct, err := structpb.NewStruct(conf) + if err != nil { + return err + } + meshConfig, _ = meshConfigFromStruct(meshConfigStruct) + } else { + meshConfig = &istiomeshv1alpha1.MeshConfig{} + } + extensionProviders := extensionProvidersFromMeshConfig(meshConfig) + + if hasKuadrantAuthorizer(extensionProviders) { + return nil + } + + meshConfig.ExtensionProviders = append(meshConfig.ExtensionProviders, createKuadrantAuthorizer(kObj.Namespace)) + meshConfigStruct, err := meshConfigToStruct(meshConfig) + if err != nil { + return err + } + smcp.Spec.TechPreview.SetField("meshConfig", meshConfigStruct.AsMap()) + logger.Info("adding external authorizer to meshconfig") + if err := r.Client().Update(ctx, smcp); err != nil { + return err + } + + return nil +} + +func (r *KuadrantReconciler) registerToServiceMeshMemberRoll(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error { + return r.ReconcileResource(ctx, &maistrav1.ServiceMeshMemberRoll{}, buildServiceMeshMemberRoll(kObj), func(existingObj, _ client.Object) (bool, error) { + existing, ok := existingObj.(*maistrav1.ServiceMeshMemberRoll) + if !ok { + return false, fmt.Errorf("%T is not a *maistrav1.ServiceMeshMemberRoll", existingObj) + } + + for _, member := range existing.Spec.Members { + if member == kObj.Namespace { + return false, nil + } + } + existing.Spec.Members = append(existing.Spec.Members, kObj.Namespace) + return true, nil + }) +} + func (r *KuadrantReconciler) reconcileSpec(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) (ctrl.Result, error) { if err := r.registerExternalAuthorizer(ctx, kObj); err != nil { return ctrl.Result{}, err @@ -276,28 +460,31 @@ func (r *KuadrantReconciler) reconcileSpec(ctx context.Context, kObj *kuadrantv1 return ctrl.Result{}, nil } -func iopName() string { +func controlPlaneProviderName() string { return common.FetchEnv("ISTIOOPERATOR_NAME", "istiocontrolplane") } -func iopNamespace() string { +func controlPlaneProviderNamespace() string { return common.FetchEnv("ISTIOOPERATOR_NAMESPACE", "istio-system") } -func hasKuadrantAuthorizer(extensionProviders []*istiomeshv1alpha1.MeshConfig_ExtensionProvider) bool { - // IstioOperator - // - //meshConfig: - // extensionProviders: - // - envoyExtAuthzGrpc: - // port: POST - // service: AUTHORINO SERVICE - // name: kuadrant-authorization - - if len(extensionProviders) == 0 { - return false +func buildServiceMeshMemberRoll(kObj *kuadrantv1beta1.Kuadrant) *maistrav1.ServiceMeshMemberRoll { + return &maistrav1.ServiceMeshMemberRoll{ + TypeMeta: metav1.TypeMeta{ + Kind: "ServiceMeshMemberRoll", + APIVersion: maistrav1.SchemeGroupVersion.String(), + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + Namespace: controlPlaneProviderNamespace(), + }, + Spec: maistrav1.ServiceMeshMemberRollSpec{ + Members: []string{kObj.Namespace}, + }, } +} +func hasKuadrantAuthorizer(extensionProviders []*istiomeshv1alpha1.MeshConfig_ExtensionProvider) bool { for _, extensionProvider := range extensionProviders { if extensionProvider.Name == extAuthorizerName { return true @@ -439,6 +626,13 @@ func (r *KuadrantReconciler) reconcileAuthorino(ctx context.Context, kObj *kuadr return r.ReconcileResource(ctx, &authorinov1beta1.Authorino{}, authorino, reconcilers.CreateOnlyMutator) } +// Builds the Istio/OSSM MeshConfig from a compatible structure: +// meshConfig: +// extensionProviders: +// - envoyExtAuthzGrpc: +// port: +// service: +// name: kuadrant-authorization func meshConfigFromStruct(structure *structpb.Struct) (*istiomeshv1alpha1.MeshConfig, error) { if structure == nil { return &istiomeshv1alpha1.MeshConfig{}, nil diff --git a/main.go b/main.go index 4c88c4df1..d855c162d 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,7 @@ import ( _ "k8s.io/client-go/plugin/pkg/client/auth" authorinoopv1beta1 "github.com/kuadrant/authorino-operator/api/v1beta1" + maistraapis "github.com/kuadrant/kuadrant-operator/api/external/maistra" limitadorv1alpha1 "github.com/kuadrant/limitador-operator/api/v1alpha1" istioextensionv1alpha1 "istio.io/client-go/pkg/apis/extensions/v1alpha1" istionetworkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" @@ -70,6 +71,7 @@ func init() { utilruntime.Must(istioextensionv1alpha1.AddToScheme(scheme)) utilruntime.Must(apiextv1.AddToScheme(scheme)) utilruntime.Must(istioapis.AddToScheme(scheme)) + utilruntime.Must(maistraapis.AddToScheme(scheme)) utilruntime.Must(kuadrantv1beta1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme From 6e734944f46e94eccec013ac787f151b415d8c6d Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Thu, 8 Dec 2022 11:48:41 -0500 Subject: [PATCH 03/11] Updated workflows --- .github/workflows/build-images.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 28da6e334..d4423d0d5 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -69,6 +69,9 @@ jobs: - name: Run make bundle if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }} run: make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.ref_name }} + - name: Run make bundle (main) + if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} + run: make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=latest VERSION=0.0.0 - name: Git diff run: git diff - name: Install qemu dependency @@ -114,8 +117,14 @@ jobs: id: add-latest-tag run: | echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV - - name: Generate Catalog Content - run: make catalog + - name: Run make catalog-generate + if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }} + run: make catalog-generate REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.ref_name }} + - name: Run make catalog-generate (main) + if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} + run: make catalog-generate REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=latest VERSION=0.0.0 + - name: Git diff + run: git diff - name: Install qemu dependency run: | sudo apt-get update @@ -127,9 +136,8 @@ jobs: image: kuadrant-operator-catalog tags: ${{ env.IMG_TAGS }} platforms: linux/amd64,linux/arm64 - context: ./catalog dockerfiles: | - ./catalog/kuadrant-operator-catalog.Dockerfile + ./catalog.Dockerfile - name: Push Image if: ${{ !env.ACT }} id: push-to-quay From 9234e9ecbf03222adb0483f8c838cc0aa64e9462 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Thu, 8 Dec 2022 21:13:38 -0500 Subject: [PATCH 04/11] Skip lint'ing --- api/external/maistra/status/status.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/external/maistra/status/status.go b/api/external/maistra/status/status.go index 06a29c6b8..7ec671c9b 100644 --- a/api/external/maistra/status/status.go +++ b/api/external/maistra/status/status.go @@ -1,3 +1,4 @@ +//nolint package status import ( From 63501461f33b16aaec786daf596137d6fa2523c1 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 12 Dec 2022 11:50:09 -0500 Subject: [PATCH 05/11] Deleted unneeded or dup'ed targets --- Makefile | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/Makefile b/Makefile index 8b63f54f1..46feb91ca 100644 --- a/Makefile +++ b/Makefile @@ -270,20 +270,6 @@ test-env-setup: ## Deploys all services and manifests required by kuadrant to ru $(MAKE) deploy-dependencies $(MAKE) install -.PHONY: local-olm-setup -local-olm-setup: ## Installs OLM and the Kuadrant operator catalog, then installs the operator with its dependencies. - $(MAKE) local-cluster-setup - $(MAKE) docker-build - $(MAKE) install-olm - $(MAKE) bundle - $(MAKE) bundle-build - $(MAKE) catalog-generate - $(MAKE) catalog-custom-build - $(MAKE) kind-load-catalog - $(MAKE) kind-load-image - $(MAKE) kind-load-bundle - $(MAKE) deploy-olm - ##@ Build build: generate fmt vet ## Build manager binary. @@ -391,23 +377,6 @@ bundle-build: ## Build the bundle image. bundle-push: ## Push the bundle image. $(MAKE) docker-push IMG=$(BUNDLE_IMG) -.PHONY: opm -OPM = ./bin/opm -opm: ## Download opm locally if necessary. -ifeq (,$(wildcard $(OPM))) -ifeq (,$(shell which opm 2>/dev/null)) - @{ \ - set -e ;\ - mkdir -p $(dir $(OPM)) ;\ - OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ - curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.26.2/$${OS}-$${ARCH}-opm ;\ - chmod +x $(OPM) ;\ - } -else -OPM = $(shell which opm) -endif -endif - # A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0). # These images MUST exist in a registry and be pull-able. BUNDLE_IMGS ?= $(BUNDLE_IMG),$(LIMITADOR_OPERATOR_BUNDLE_IMG),$(AUTHORINO_OPERATOR_BUNDLE_IMG) From 8b10de556098de256600063158f79274f997432c Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 12 Dec 2022 12:21:04 -0500 Subject: [PATCH 06/11] Get rid of the catalog docker file --- .github/workflows/build-images.yaml | 3 ++- catalog.Dockerfile | 8 -------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 catalog.Dockerfile diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index d4423d0d5..f81d1a57a 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -136,8 +136,9 @@ jobs: image: kuadrant-operator-catalog tags: ${{ env.IMG_TAGS }} platforms: linux/amd64,linux/arm64 + context: ./catalog dockerfiles: | - ./catalog.Dockerfile + ./catalog/kuadrant-operator-catalog.Dockerfile - name: Push Image if: ${{ !env.ACT }} id: push-to-quay diff --git a/catalog.Dockerfile b/catalog.Dockerfile deleted file mode 100644 index d3b5970b7..000000000 --- a/catalog.Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM quay.io/operator-framework/upstream-opm-builder -LABEL operators.operatorframework.io.index.database.v1=/database/index.db -ADD database/index.db /database/index.db -RUN mkdir /registry && chmod 775 /registry -EXPOSE 50051 -WORKDIR /registry -ENTRYPOINT ["/bin/opm"] -CMD ["registry", "serve", "--database", "/database/index.db"] From e4dd7ecff0b644026635a2754fb927ea525601ca Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 12 Dec 2022 13:00:29 -0500 Subject: [PATCH 07/11] Delete catalog targets --- Makefile | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/Makefile b/Makefile index 46feb91ca..6b7b32511 100644 --- a/Makefile +++ b/Makefile @@ -394,27 +394,6 @@ ifeq ($(shell uname -sm),Darwin arm64) PLATFORM_PARAM = --platform=linux/arm64 endif -# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'. -# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see: -# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator -.PHONY: catalog-build -catalog-build: opm ## Build a catalog image. - $(OPM) index add --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) - -.PHONY: catalog-custom-build -catalog-custom-build: ## Build the bundle image. - docker build $(PLATFORM_PARAM) -f catalog.Dockerfile -t $(CATALOG_IMG) . - - -.PHONY: catalog-generate -catalog-generate: opm ## Generate a catalog/index Dockerfile. - $(OPM) index add --generate --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) - -# Push the catalog image. -.PHONY: catalog-push -catalog-push: ## Push a catalog image. - $(MAKE) docker-push IMG=$(CATALOG_IMG) - ##@ Code Style GOLANGCI-LINT = $(PROJECT_PATH)/bin/golangci-lint From 718376ad433a850452dfa11e6f658e4ae070b28a Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 12 Dec 2022 13:02:54 -0500 Subject: [PATCH 08/11] Fix target in catalog actions --- .github/workflows/build-images.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index f81d1a57a..ecb8ca9de 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -117,12 +117,12 @@ jobs: id: add-latest-tag run: | echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV - - name: Run make catalog-generate + - name: Run make catalog if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }} - run: make catalog-generate REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.ref_name }} - - name: Run make catalog-generate (main) + run: make catalog REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.ref_name }} + - name: Run make catalog (main) if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} - run: make catalog-generate REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=latest VERSION=0.0.0 + run: make catalog REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=latest VERSION=0.0.0 - name: Git diff run: git diff - name: Install qemu dependency From da5511da3d5dceb94b7b9b936e3ac0250f80298f Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 12 Dec 2022 16:58:33 -0500 Subject: [PATCH 09/11] Partially addressing PR comments --- Makefile | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Makefile b/Makefile index 6b7b32511..3b934f505 100644 --- a/Makefile +++ b/Makefile @@ -377,23 +377,6 @@ bundle-build: ## Build the bundle image. bundle-push: ## Push the bundle image. $(MAKE) docker-push IMG=$(BUNDLE_IMG) -# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0). -# These images MUST exist in a registry and be pull-able. -BUNDLE_IMGS ?= $(BUNDLE_IMG),$(LIMITADOR_OPERATOR_BUNDLE_IMG),$(AUTHORINO_OPERATOR_BUNDLE_IMG) - -# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0). -CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:$(IMAGE_TAG) - -# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image. -ifneq ($(origin CATALOG_BASE_IMG), undefined) -FROM_INDEX_OPT := --from-index $(CATALOG_BASE_IMG) -endif - -PLATFORM_PARAM = -ifeq ($(shell uname -sm),Darwin arm64) - PLATFORM_PARAM = --platform=linux/arm64 -endif - ##@ Code Style GOLANGCI-LINT = $(PROJECT_PATH)/bin/golangci-lint From 66caa5c9c002fa1d74254f5b92ca35859db4e4a4 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Tue, 13 Dec 2022 15:16:42 +0100 Subject: [PATCH 10/11] [gh] Removing conditional building catalog and bundle from workflow * Removing diff task too --- .github/workflows/build-images.yaml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index ecb8ca9de..cf98e6cec 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -67,13 +67,7 @@ jobs: run: | echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV - name: Run make bundle - if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }} run: make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.ref_name }} - - name: Run make bundle (main) - if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} - run: make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=latest VERSION=0.0.0 - - name: Git diff - run: git diff - name: Install qemu dependency run: | sudo apt-get update @@ -117,14 +111,8 @@ jobs: id: add-latest-tag run: | echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV - - name: Run make catalog - if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }} - run: make catalog REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.ref_name }} - - name: Run make catalog (main) - if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} - run: make catalog REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=latest VERSION=0.0.0 - - name: Git diff - run: git diff + - name: Generate Catalog Content + run: make catalog - name: Install qemu dependency run: | sudo apt-get update From 7d1a92f52a0f122e281d2add09129d309bea52ac Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Tue, 13 Dec 2022 15:17:50 +0100 Subject: [PATCH 11/11] [makefile] Removing unused target * The catalog pod has its image policy set to ALWAYS --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index 3b934f505..fc4c9b0cb 100644 --- a/Makefile +++ b/Makefile @@ -286,9 +286,6 @@ docker-build: ## Build docker image with the manager. docker-push: ## Push docker image with the manager. docker push $(IMG) -kind-load-catalog: ## Load catalog image to local cluster - $(KIND) load docker-image $(CATALOG_IMG) --name $(KIND_CLUSTER_NAME) - kind-load-image: ## Load image to local cluster $(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME)