-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
datadog: | ||
apiKey: "00000000000000000000000000000000" | ||
appKey: "0000000000000000000000000000000000000000" | ||
agents: | ||
enabled: true | ||
networkPolicy: | ||
create: true | ||
clusterAgent: | ||
enabled: true | ||
metricsProvider: | ||
enabled: true | ||
networkPolicy: | ||
create: true | ||
clusterChecksRunner: | ||
enabled: true | ||
networkPolicy: | ||
create: true |
43 changes: 43 additions & 0 deletions
43
charts/datadog/templates/agent-clusterchecks-network-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{- if $.Values.clusterChecksRunner.networkPolicy.create -}} | ||
apiVersion: "networking.k8s.io/v1" | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ template "datadog.fullname" . }}-clusterchecks | ||
labels: | ||
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
app.kubernetes.io/name: "{{ template "datadog.fullname" . }}" | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
app: {{ template "datadog.fullname" . }}-clusterchecks | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
egress: | ||
- # Egress to | ||
# * Datadog intake | ||
# * Kube API server | ||
ports: | ||
- port: 443 | ||
{{- if .Values.clusterAgent.enabled }} | ||
- # Egress to cluster agent | ||
ports: | ||
- port: 5005 | ||
to: | ||
- podSelector: | ||
matchLabels: | ||
app: {{ template "datadog.fullname" . }}-cluster-agent | ||
{{- end }} | ||
# The cluster check runners are susceptible to connect to any service | ||
# that would be annotated with auto-discovery annotations. | ||
# | ||
# When a user wants to add a check on one of its service, he needs to | ||
# * annotate its service | ||
# * add an ingress policy from the CLC on its own pod | ||
# In order to not ask end-users to inject NetworkPolicy on the agent in | ||
# the agent namespace, the agent must be allowed to probe any service. | ||
- {} # Egress to anything for service checks | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{{- if $.Values.agents.networkPolicy.create -}} | ||
apiVersion: "networking.k8s.io/v1" | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ template "datadog.fullname" . }} | ||
labels: | ||
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
app.kubernetes.io/name: "{{ template "datadog.fullname" . }}" | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
app: {{ template "datadog.fullname" . }} | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
egress: | ||
- # Egress to | ||
# * Datadog intake | ||
# * Kube API server | ||
ports: | ||
- port: 443 | ||
# The agents are susceptible to connect to any pod | ||
# that would be annotated with auto-discovery annotations. | ||
# | ||
# When a user wants to add a check on one of its pod, he needs to | ||
# * annotate its pod | ||
# * add an ingress policy from the agent on its own pod | ||
# In order to not ask end-users to inject NetworkPolicy on the agent in | ||
# the agent namespace, the agent must be allowed to probe any pod. | ||
- {} # Egress to anything for checks | ||
{{- end }} |
40 changes: 40 additions & 0 deletions
40
charts/datadog/templates/cluster-agent-network-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{- if $.Values.clusterAgent.networkPolicy.create -}} | ||
apiVersion: "networking.k8s.io/v1" | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ template "datadog.fullname" . }}-cluster-agent | ||
labels: | ||
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
app.kubernetes.io/name: "{{ template "datadog.fullname" . }}" | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
app: {{ template "datadog.fullname" . }}-cluster-agent | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
ingress: | ||
{{- if $.Values.clusterChecksRunner.enabled }} | ||
- # Ingress from cluster checks runner | ||
ports: | ||
- port: 5005 | ||
from: | ||
- podSelector: | ||
matchLabels: | ||
app: {{ template "datadog.fullname" . }}-clusterchecks | ||
{{- end }} | ||
{{- if .Values.clusterAgent.metricsProvider.enabled }} | ||
- # Ingress from API server for external metrics | ||
ports: | ||
- port: {{ template "clusterAgent.metricsProvider.port" . }} | ||
{{- end }} | ||
egress: | ||
- # Egress to | ||
# * Datadog intake | ||
# * Kube API server | ||
ports: | ||
- port: 443 | ||
{{- end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters