Skip to content

Commit 00a4ec0

Browse files
authored
Initial development (#1)
1 parent 129b203 commit 00a4ec0

File tree

18 files changed

+804
-2
lines changed

18 files changed

+804
-2
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Code Owners
2+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
4+
* @osinfra-sa

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Dependabot
2+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: github-actions
7+
8+
# NOTE: The "/" here is for checking for workflow files in .github/workflows
9+
10+
directory: /
11+
schedule:
12+
interval: daily
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Add To GitHub Projects
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
pull_request:
8+
types:
9+
- opened
10+
11+
permissions:
12+
issues: write
13+
14+
jobs:
15+
add-to-osinfra-project:
16+
name: Open Source Infrastructure (as Code)
17+
uses: osinfra-io/github-misc-called-workflows/.github/workflows/add-to-project.yml@v0.1.5
18+
with:
19+
project_id: 1
20+
secrets:
21+
add_to_project_pat: ${{ secrets.ADD_TO_PROJECT_PAT }}

.github/workflows/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Dependabot Approve and Merge
2+
3+
on: pull_request_target
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
dependabot:
10+
name: Dependabot
11+
uses: osinfra-io/github-misc-called-workflows/.github/workflows/dependabot.yml@v0.1.5
12+
secrets:
13+
pr_approve_and_merge_pat: ${{ secrets.PR_APPROVE_AND_MERGE_PAT }}

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Terraform Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types:
7+
- opened
8+
- synchronize
9+
paths-ignore:
10+
- "**.md"
11+
12+
permissions:
13+
id-token: write
14+
15+
jobs:
16+
tests:
17+
name: Tests
18+
uses: osinfra-io/github-terraform-gcp-called-workflows/.github/workflows/test.yml@v0.2.5
19+
if: github.actor != 'dependabot[bot]'
20+
with:
21+
service_account: plt-lz-testing-github@ptl-lz-terraform-tf91-sb.iam.gserviceaccount.com
22+
terraform_version: ${{ vars.TERRAFORM_VERSION }}
23+
workload_identity_provider: projects/746490462722/locations/global/workloadIdentityPools/github-actions/providers/github-actions-oidc

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: check-symlinks
1212

1313
- repo: https://github.com/antonbabenko/pre-commit-terraform
14-
rev: v1.92.0
14+
rev: v1.92.1
1515
hooks:
1616
- id: terraform_fmt
1717

@@ -29,7 +29,7 @@ repos:
2929
- id: terraform_docs
3030

3131
- repo: https://github.com/bridgecrewio/checkov.git
32-
rev: 3.2.186
32+
rev: 3.2.219
3333
hooks:
3434
- id: checkov
3535
verbose: true

.terraform-docs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Terraform Docs
2+
# https://github.com/terraform-docs/terraform-docs
3+
4+
settings:
5+
indent: 3

README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# <img align="left" width="45" height="45" src="https://github.com/user-attachments/assets/ce1fe535-f4f3-451f-bbd9-45fde04c000c"> Kubernetes - Datadog Operator Terraform Module
2+
3+
**[GitHub Actions](https://github.com/osinfra-io/terraform-kubernetes-datadog-operator/actions):**
4+
5+
[![Terraform Tests](https://github.com/osinfra-io/terraform-kubernetes-datadog-operator/actions/workflows/test.yml/badge.svg)](https://github.com/osinfra-io/terraform-kubernetes-datadog-operator/actions/workflows/test.yml) [![Dependabot](https://github.com/osinfra-io/terraform-kubernetes-datadog-operator/actions/workflows/dependabot.yml/badge.svg)](https://github.com/osinfra-io/terraform-kubernetes-datadog-operator/actions/workflows/dependabot.yml)
6+
7+
**[Infracost](https://www.infracost.io):**
8+
9+
[![infracost](https://img.shields.io/endpoint?url=https://dashboard.api.infracost.io/shields/json/cbeecfe3-576f-4553-984c-e451a575ee47/repos/925e2406-d209-4aca-847d-21257bc478a5/branch/72fc4157-6bf8-46c0-9d51-593f3cd5bdef)](https://dashboard.infracost.io/org/osinfra-io/repos/925e2406-d209-4aca-847d-21257bc478a5?tab=settings)
10+
11+
💵 Monthly estimates based on Infracost baseline costs.
12+
13+
## Repository Description
14+
15+
Terraform **example** module for the Datadog Kubernetes Operator.
16+
17+
> [!NOTE]
18+
> We do not recommend consuming this module like you might a [public module](https://registry.terraform.io/browse/modules). It is a baseline, something you can fork, potentially maintain, and modify to fit your organization's needs. Using public modules vs. writing your own has various [drivers and trade-offs](https://docs.osinfra.io/fundamentals/architecture-decision-records/adr-0003) that your organization should evaluate.
19+
20+
## 🔩 Usage
21+
22+
> [!TIP]
23+
> You can check the [tests/fixtures](tests/fixtures) directory for example configurations. These fixtures set up the system for testing by providing all the necessary initial code, thus creating good examples on which to base your configurations.
24+
25+
## <img align="left" width="35" height="35" src="https://github.com/osinfra-io/github-organization-management/assets/1610100/39d6ae3b-ccc2-42db-92f1-276a5bc54e65"> Development
26+
27+
Our focus is on the core fundamental practice of platform engineering, Infrastructure as Code.
28+
29+
>Open Source Infrastructure (as Code) is a development model for infrastructure that focuses on open collaboration and applying relative lessons learned from software development practices that organizations can use internally at scale. - [Open Source Infrastructure (as Code)](https://www.osinfra.io)
30+
31+
To avoid slowing down stream-aligned teams, we want to open up the possibility for contributions. The Open Source Infrastructure (as Code) model allows team members external to the platform team to contribute with only a slight increase in cognitive load. This section is for developers who want to contribute to this repository, describing the tools used, the skills, and the knowledge required, along with Terraform documentation.
32+
33+
See the documentation for setting up a local development environment [here](https://docs.osinfra.io/fundamentals/development-setup).
34+
35+
### 🛠️ Tools
36+
37+
- [checkov](https://github.com/bridgecrewio/checkov)
38+
- [helm](https://github.com/helm/helm)
39+
- [infracost](https://github.com/infracost/infracost)
40+
- [pre-commit](https://github.com/pre-commit/pre-commit)
41+
- [pre-commit-terraform](https://github.com/antonbabenko/pre-commit-terraform)
42+
- [terraform-docs](https://github.com/terraform-docs/terraform-docs)
43+
44+
### 📋 Skills and Knowledge
45+
46+
Links to documentation and other resources required to develop and iterate in this repository successfully.
47+
48+
- [datadog-operator](https://docs.datadoghq.com/containers/datadog_operator)
49+
50+
### 🔍 Tests
51+
52+
You'll need to be a member of the [platform-contributors](https://groups.google.com/a/osinfra.io/g/platform-contributors) Google Group to run the tests. This group manages access to Testing/Sandbox folder in the resource hierarchy. You can request access to this group by opening an issue [here](https://github.com/osinfra-io/google-cloud-hierarchy/issues/new?assignees=&labels=enhancement&projects=&template=add-update-identity-group.yml&title=Add+or+update+identity+group).
53+
54+
```none
55+
terraform init
56+
```
57+
58+
```none
59+
terraform test
60+
```
61+
62+
## 📓 Terraform Documentation
63+
64+
> A child module automatically inherits default (un-aliased) provider configurations from its parent. The provider versions below are informational only and do **not** need to align with the provider configurations from its parent.
65+
66+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
67+
### Requirements
68+
69+
No requirements.
70+
71+
### Providers
72+
73+
No providers.
74+
75+
### Modules
76+
77+
No modules.
78+
79+
### Resources
80+
81+
No resources.
82+
83+
### Inputs
84+
85+
No inputs.
86+
87+
### Outputs
88+
89+
No outputs.
90+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
91+
92+
## 📓 Terraform Regional Documentation
93+
94+
- [regional](regional/README.md)
95+
- [regional/manifests](regional/manifests/README.md)

empty.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This is currently required so we can initialize Terraform and run tests.
2+
# https://github.com/hashicorp/terraform/issues/35040

regional/main.tf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Helm Release
2+
# https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release
3+
4+
resource "helm_release" "datadog_operator" {
5+
chart = "datadog-operator"
6+
name = "datadog-operator"
7+
namespace = kubernetes_namespace_v1.datadog.metadata[0].name
8+
repository = "https://helm.datadoghq.com"
9+
10+
set {
11+
name = "datadogMonitor.enabled"
12+
value = true
13+
}
14+
15+
set {
16+
name = "watchNamespaces"
17+
value = join(",", var.watch_namespaces)
18+
}
19+
20+
set_sensitive {
21+
name = "apiKey"
22+
value = var.datadog_api_key
23+
}
24+
25+
set_sensitive {
26+
name = "appKey"
27+
value = var.datadog_app_key
28+
}
29+
30+
timeout = 900
31+
version = "1.8.6"
32+
}
33+
34+
# Kubernetes Namespace Resource
35+
# https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace_v1
36+
37+
resource "kubernetes_namespace_v1" "datadog" {
38+
metadata {
39+
name = "datadog"
40+
}
41+
}

0 commit comments

Comments
 (0)