Skip to content

Commit

Permalink
Update datadog-operator to 1.0.2 and agent to v2alpha1 (#982)
Browse files Browse the repository at this point in the history
* Setup datadog with flux

* use empty string in list

* remove default value since value cant be empty

* fix validation, docs and changelog

* Switch to use 2 kustomizations and dependsOn for CRD installs

* Add CSI and config

* More config for CSI to work

* Add datadog UAI config

* adjust tenant id

* Remove vars and use new CSI secret

* Add dummypod for secret mounting, fix kv variable, and some general improvements

* fix closing bracket

* remove unused variable

* fix vars name

* Fix vars

* Fix namespace name for datadogagent

* Add namespace to dummy secret-mount deployment

* add label for aadpodidentity

* Add label to pod template

* Fix so agent work

* Switch name of secret

* Fix agent config

* Try to make it work in AWS

* Add more config

* Revert "Add more config"

This reverts commit 8a27f73.

* Revert "Try to make it work in AWS"

This reverts commit b6f5770.

* Revert "Revert "Try to make it work in AWS""

This reverts commit ecd65fb.

* Revert "Revert "Revert "Try to make it work in AWS"""

This reverts commit 8a71212.

* Fix for EKS

* refactor to use if cloud_provider

* Update IAM for datadog

* Update IAM for datadog

* fix output

* Try again without IAM/IRSA config

* Revert "Try again without IAM/IRSA config"

This reverts commit e8fa1c4.

* more fixes

* Fix SA name

* Fix SA role_arn

* Remove array from secretprovider in AWS

* make docs and remove unused vars

* Upgrade datadog and prepp for k8s 1.25

* Update to use other agent file

* Bump dd-operator to 0.9.2

* Bump git-provider to 0.0.2

* fix namespace_inlude list

* fix namespace_inlude list

* Fix v2alpha1 and create file for each case

* Remove excess files and add apm config

* Change paths and content

* Changelog and docs

* docs

* Update flux crd

* Rename datadog-agent file

* fix namespace_include

* Fix changelog
  • Loading branch information
CalleB3 authored Jun 12, 2023
1 parent 859642c commit f43fdd4
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 63 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## Added

- [#991](https://github.com/XenitAB/terraform-modules/pull/991) Add vnet role assignment.

## Changed

- [#988](https://github.com/XenitAB/terraform-modules/pull/988) Update Azurerm provider version and enable AKS workload identities.
- [#982](https://github.com/XenitAB/terraform-modules/pull/972) Update datadog-operator to 1.0.2 and agent to v2alpha1.

## 2023.06.1

Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes/datadog/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ resource "git_repository_file" "datadog_operator" {
content = templatefile("${path.module}/templates/datadog-operator.yaml", {
})
}

resource "git_repository_file" "datadog" {
path = "platform/${var.cluster_id}/datadog/datadog-agent.yaml"
content = templatefile("${path.module}/templates/datadog-agent.yaml.tpl", {
Expand Down
74 changes: 74 additions & 0 deletions modules/kubernetes/datadog/templates/datadog-agent-old.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#Currently not used, keeping in case of rollback.
apiVersion: datadoghq.com/v1alpha1
kind: DatadogAgent
metadata:
name: datadog
namespace: datadog
spec:
clusterName: ${location}-${environment}
site: ${datadog_site}
credentials:
apiSecret:
secretName: datadog-operator-apikey
keyName: api-key
appSecret:
secretName: datadog-operator-appkey
keyName: app-key
agent:
priorityClassName: platform-high
image:
name: "gcr.io/datadoghq/agent:latest"
log:
enabled: true
logsConfigContainerCollectAll: true
apm:
enabled: true
hostPort: 8126
env:
- name: DD_CONTAINER_EXCLUDE_LOGS
value: "name:datadog-agent"
- name: DD_CONTAINER_INCLUDE
value: "kube_namespace: ${namespace_include}"
- name: DD_CONTAINER_EXCLUDE
value: "kube_namespace:.*"
- name: DD_APM_IGNORE_RESOURCES
value: ${apm_ignore_resources}
config:
tolerations:
- operator: Exists
tags:
- "env: ${environment}"
kubelet:
tlsVerify: false
criSocket:
criSocketPath: /var/run/containerd/containerd.sock
volumeMounts:
- name: containerdsocket
mountPath: /var/run/containerd/containerd.sock
volumes:
- hostPath:
path: /var/run/containerd/containerd.sock
name: containerdsocket
- hostPath:
path: /var/run
name: var-run
resources:
requests:
cpu: 60m
memory: 200Mi
clusterAgent:
replicas: 2
priorityClassName: platform-low
config:
resources:
requests:
cpu: 60m
memory: 200Mi
image:
name: "gcr.io/datadoghq/cluster-agent:latest"
features:
kubeStateMetricsCore:
enabled: true
logCollection:
enabled: true
logsConfigContainerCollectAll: true
110 changes: 48 additions & 62 deletions modules/kubernetes/datadog/templates/datadog-agent.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,73 +1,59 @@
apiVersion: datadoghq.com/v1alpha1

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
name: datadog-v2
namespace: datadog
spec:
clusterName: ${location}-${environment}
site: ${datadog_site}
credentials:
apiSecret:
secretName: datadog-operator-apikey
keyName: api-key
appSecret:
secretName: datadog-operator-appkey
keyName: app-key
agent:
priorityClassName: platform-high
image:
name: "gcr.io/datadoghq/agent:latest"
log:
enabled: true
logsConfigContainerCollectAll: true
apm:
enabled: true
hostPort: 8126
env:
- name: DD_CONTAINER_EXCLUDE_LOGS
value: "name:datadog-agent"
- name: DD_CONTAINER_INCLUDE
value: "kube_namespace: ${namespace_include}"
- name: DD_CONTAINER_EXCLUDE
value: "kube_namespace:.*"
- name: DD_APM_IGNORE_RESOURCES
value: ${apm_ignore_resources}
config:
global:
clusterName: ${location}-${environment}
site: ${datadog_site}
criSocketPath: /var/run/containerd/containerd.sock
kubelet:
tlsVerify: false
credentials:
apiSecret:
secretName: datadog-operator-apikey
keyName: api-key
appSecret:
secretName: datadog-operator-appkey
keyName: app-key
override:
nodeAgent:
priorityClassName: platform-high
tolerations:
- operator: Exists
tags:
- "env: ${environment}"
kubelet:
tlsVerify: false
criSocket:
criSocketPath: /var/run/containerd/containerd.sock
volumeMounts:
- name: containerdsocket
mountPath: /var/run/containerd/containerd.sock
volumes:
- hostPath:
path: /var/run/containerd/containerd.sock
name: containerdsocket
- hostPath:
path: /var/run
name: var-run
resources:
requests:
cpu: 60m
memory: 200Mi
clusterAgent:
replicas: 2
priorityClassName: platform-low
config:
resources:
requests:
cpu: 60m
memory: 200Mi
image:
name: "gcr.io/datadoghq/cluster-agent:latest"
image:
name: "gcr.io/datadoghq/agent:latest"
env:
- name: DD_CONTAINER_EXCLUDE_LOGS
value: "name:datadog-agent"
- name: DD_CONTAINER_INCLUDE
value: "kube_namespace:${namespace_include}"
- name: DD_CONTAINER_EXCLUDE
value: "kube_namespace:.*"
- name: DD_APM_IGNORE_RESOURCES
value: ${apm_ignore_resources}
clusterAgent:
replicas: 2
priorityClassName: platform-low
image:
name: "gcr.io/datadoghq/cluster-agent:latest"
tolerations:
- operator: Exists
containers:
config:
resources:
requests:
cpu: 60m
memory: 200Mi
features:
kubeStateMetricsCore:
enabled: true
logCollection:
containerCollectAll: true
apm:
enabled: true
logsConfigContainerCollectAll: true
hostPortConfig:
enabled: true
hostPort: 8126
42 changes: 42 additions & 0 deletions modules/kubernetes/datadog/templates/datadog-operator-old.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#Currently not used, keeping in case of rollback.
apiVersion: v1
kind: Namespace
metadata:
name: datadog
labels:
name = "datadog"
xkf.xenit.io/kind = "platform"
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: datadog
namespace: datadog
spec:
interval: 1m0s
url: "https://helm.datadoghq.com"
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: datadog-operator
namespace: datadog
spec:
chart:
spec:
chart: datadog-operator
sourceRef:
kind: HelmRepository
name: datadog
version: 0.9.2
values:
apiKeyExistingSecret: datadog-operator-apikey
appKeyExistingSecret: datadog-operator-appkey
installCRDs: true
datadogMonitor:
enabled: true
resources:
requests:
cpu: 15m
memory: 50Mi
interval: 1m0s
4 changes: 3 additions & 1 deletion modules/kubernetes/datadog/templates/datadog-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ spec:
sourceRef:
kind: HelmRepository
name: datadog
version: 0.9.2
version: 1.0.2
values:
apiKeyExistingSecret: datadog-operator-apikey
appKeyExistingSecret: datadog-operator-appkey
installCRDs: true
image:
tag: 1.0.2
datadogMonitor:
enabled: true
resources:
Expand Down

0 comments on commit f43fdd4

Please sign in to comment.