aiven/aiven-operator

Can't create Datadog integration for existing PostgreSQL service

Closed this issue · 8 comments

I'm not able to create datadog integration for existing PostgreSQL service. In the kubernetes logs i see message that preconditions are not met
INFO controllers.ServiceIntegration preconditions are not met, requeue {"kind": "serviceintegration", "name": "aiven-operator/datadog-kotest", "annotations": {}}.

Using the Aiven API, the same integration is created without any problems

Hi @AgasiAm

  1. Does your service exist and running?
  2. What version of the operator do you use?
  3. Could you please provide some logs and yamls I can take a look at?

Hi @byashimov
Thank you for quick response

  1. Yes, service exist and running
  2. Version 0.9.0
  3. I tried using different configurations for datadog service integration and finally come up with this one
apiVersion: aiven.io/v1alpha1
kind: ServiceIntegration
metadata:
  name: service1-prd-kotest
spec:
  authSecretRef:
    name: aiven-token
    key: token

  project: aghasioptest

  integrationType: datadog
  sourceServiceName: service1-prd
  destinationServiceName: 'Null'
  sourceEndpointID: 'Null'
  destinationEndpointId: <datadog integration endpoint UUID for project which I query by Aiven API>
  datadog:
    datadog_dbm_enabled: True
    datadog_tags:
      - tag: env
        comment: stg

Also want to mention that when creating integration using API, only source_project, source_service and dest_endpoint_id is required, however operator is forcing to add destinationServiceName and sourceEndpointID to config

Yeah. I see the problem now. 'Null' is not really a null, it is a string (?). So I assume it cannot wait a 'Null' service being running. I'll come back with a fix soon. Thanks for the reporting.

@AgasiAm just checked out CRD. Only project and integration_type are required.
Could you please remove those fields and try again. Or what exactly error does say?

destinationServiceName and sourceEndpointID becoming required when sourceServiceName and destinationEndpointId is set. Here is a error example
Error from server (destinationServiceName cannot be empty when sourceServiceName is set): error when creating "services/service1/datadog.yaml": admission webhook "vserviceintegration.kb.io" denied the request: destinationServiceName cannot be empty when sourceServiceName is set

Same for EndpointIDs

Also one other question regarding to integration
To find destinationEndpointID i need to query all available integrations for the services by using API endpoint /v1/project/{project}/service/{service_name}/integration then filter results by integration_type=datadog and dest_endpoint=<integration name>
Can the integration be extended so that there is no need for an API? For example, use the endpoint name in yaml, which will be converted to endpoint id behind the scenes by the operator