diff --git a/marketplaces/charts/operator-eks-addon/README.md b/marketplaces/charts/operator-eks-addon/README.md index 3ca882a2e5..da8cdc056c 100644 --- a/marketplaces/charts/operator-eks-addon/README.md +++ b/marketplaces/charts/operator-eks-addon/README.md @@ -1,6 +1,27 @@ # Operator EKS Add-on -This is a wrapper chart for installing EKS add-on. Charts required for the add-on are added as a dependency to this chart. Chart itself doesn't contain any templates or configurable properties. +This is a wrapper chart for installing the EKS add-on. The Datadog Operator chart is included as a dependency, and the wrapper renders the managed Agent installation bridge resources when managed Agent installation values are present. + +## Instrumenter managed Agent installation bridge + +The optional `managedAgentInstallation` value renders the add-on-owned command ConfigMap consumed by an Operator started with `DD_EKS_MANAGED_AGENT_INSTALLATION_ENABLED=true`. The caller must send the complete value on every EKS add-on update and reuse the operation ID for retries of the same transition. + +Managed Agent installation configuration does not change the wrapper's defaults. The instrumenter's complete add-on configuration also enables the DatadogAgentProfile CRD/controller, Remote Configuration, Remote Updates, controller revisions, and `DD_CREATE_STRATEGY_ENABLED` for this installation. + +```yaml +managedAgentInstallation: + version: v1 + installationID: 123e4567-e89b-42d3-a456-426614174000 + eksARNSHA256: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef + operationID: 123e4567-e89b-42d3-a456-426614174010 + desiredState: installed + acknowledgedOperationID: "" + bootstrap: + clusterName: example-cluster + site: datadoghq.com +``` + +The managed Agent installation specification does not accept credentials or cluster topology. Credential material is supplied separately through `datadog/datadog-secret[api-key]`. Retries reuse the complete request and operation ID; acknowledgement is the only permitted change to an install request. ## Version Mapping | `operator-addon-chart` | `datadog-operator` | `datadog-crds` | Operator | Agent | Cluster Agent | diff --git a/marketplaces/charts/operator-eks-addon/aws_mp_configuration_schema.json b/marketplaces/charts/operator-eks-addon/aws_mp_configuration_schema.json index 880afe4e2c..70c069b8f4 100644 --- a/marketplaces/charts/operator-eks-addon/aws_mp_configuration_schema.json +++ b/marketplaces/charts/operator-eks-addon/aws_mp_configuration_schema.json @@ -110,14 +110,144 @@ "collectOperatorMetrics": { "type": "boolean" }, + "apiKeyExistingSecret": { + "type": "string" + }, + "datadogCRDs": { + "type": "object", + "properties": { + "crds": { + "type": "object", + "properties": { + "datadogAgentProfiles": { + "type": "boolean" + } + } + } + } + }, + "datadogAgentProfile": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "remoteConfiguration": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, "watchNamespaces": { "type": "array", "items": {} }, "containerSecurityContext": { "type": "object" + }, + "volumes": { + "type": "array", + "items": {} + }, + "volumeMounts": { + "type": "array", + "items": {} } } + }, + "managedAgentInstallation": { + "type": [ + "object", + "null" + ], + "properties": { + "version": { + "type": "string", + "enum": [ + "v1" + ] + }, + "installationID": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "eksARNSHA256": { + "type": "string", + "pattern": "^[0-9a-f]{64}$" + }, + "operationID": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "desiredState": { + "type": "string", + "enum": [ + "installed", + "absent" + ] + }, + "acknowledgedOperationID": { + "type": "string", + "pattern": "^$|^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "bootstrap": { + "type": "object", + "properties": { + "clusterName": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "site": { + "type": "string", + "enum": [ + "datadoghq.com", + "datadoghq.eu", + "us3.datadoghq.com", + "us5.datadoghq.com", + "ddog-gov.com", + "ap1.datadoghq.com", + "ap2.datadoghq.com" + ] + } + }, + "required": [ + "clusterName", + "site" + ], + "additionalProperties": false + } + }, + "required": [ + "version", + "installationID", + "eksARNSHA256", + "operationID", + "desiredState", + "bootstrap" + ], + "additionalProperties": false + }, + "managedAgentInstallationCredentials": { + "type": [ + "object", + "null" + ], + "properties": { + "secretsManagerSecretID": { + "type": "string", + "minLength": 1, + "maxLength": 2048 + } + }, + "required": [ + "secretsManagerSecretID" + ], + "additionalProperties": false } } -} \ No newline at end of file +} diff --git a/marketplaces/charts/operator-eks-addon/templates/managed_agent_installation.yaml b/marketplaces/charts/operator-eks-addon/templates/managed_agent_installation.yaml new file mode 100644 index 0000000000..63911619b1 --- /dev/null +++ b/marketplaces/charts/operator-eks-addon/templates/managed_agent_installation.yaml @@ -0,0 +1,23 @@ +{{- with .Values.managedAgentInstallation }} +{{- $intent := dict + "version" .version + "installationID" .installationID + "eksARNSHA256" .eksARNSHA256 + "operationID" .operationID + "desiredState" .desiredState + "bootstrap" .bootstrap +-}} +{{- with .acknowledgedOperationID }} +{{- $_ := set $intent "acknowledgedOperationID" . -}} +{{- end }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: datadog-agent-managed-installation-intent + namespace: {{ $.Release.Namespace }} + labels: + app.kubernetes.io/managed-by: eks-addon +data: + intent.json: |- + {{ $intent | toJson }} +{{- end }} diff --git a/marketplaces/charts/operator-eks-addon/templates/managed_agent_installation_credentials.yaml b/marketplaces/charts/operator-eks-addon/templates/managed_agent_installation_credentials.yaml new file mode 100644 index 0000000000..6e2f9db948 --- /dev/null +++ b/marketplaces/charts/operator-eks-addon/templates/managed_agent_installation_credentials.yaml @@ -0,0 +1,24 @@ +{{- with .Values.managedAgentInstallationCredentials }} +apiVersion: secrets-store.csi.x-k8s.io/v1 +kind: SecretProviderClass +metadata: + name: datadog-api-key + namespace: {{ $.Release.Namespace }} + labels: + app.kubernetes.io/managed-by: eks-addon +spec: + provider: aws + secretObjects: + - secretName: datadog-secret + type: Opaque + data: + - objectName: api-key + key: api-key + parameters: + usePodIdentity: "true" + objects: | + - objectName: {{ .secretsManagerSecretID | quote }} + objectType: secretsmanager + objectAlias: api-key + filePermission: "0400" +{{- end }} diff --git a/marketplaces/charts/operator-eks-addon/values.yaml b/marketplaces/charts/operator-eks-addon/values.yaml index 2ff26d5f4f..1d93de25a2 100644 --- a/marketplaces/charts/operator-eks-addon/values.yaml +++ b/marketplaces/charts/operator-eks-addon/values.yaml @@ -7,3 +7,6 @@ datadog-operator: repository: 709825985650.dkr.ecr.us-east-1.amazonaws.com/datadog/operator tag: 1.28.0 operatorMetricsEnabled: false + +managedAgentInstallation: null +managedAgentInstallationCredentials: null