Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v8] Backport: "helm: Fix indenting on database autodiscovery" #10623

Merged
merged 4 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/chart/teleport-kube-agent/aws-and-manual-db.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
authToken: auth-token
proxyAddr: proxy.example.com:3080
roles: db
awsDatabases:
- types: ["rds"]
regions: ["us-east-1"]
tags:
"*": "*"
- types: ["rds"]
regions: ["us-west-2"]
tags:
"env": "development"
databases:
- name: aurora
uri: "postgres-aurora-instance-1.xxx.us-east-1.rds.amazonaws.com:5432"
protocol: "postgres"
labels:
database: staging
annotations:
serviceAccount:
eks.amazonaws.com/role-arn: arn:aws:iam::1234567890:role/my-rds-autodiscovery-role
13 changes: 5 additions & 8 deletions examples/chart/teleport-kube-agent/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ data:
{{- if not (or (.Values.awsDatabases) (.Values.databases)) }}
{{- fail "'awsDatabases' and/or 'databases' is required in chart values when db role is enabled, see README" }}
{{- end }}
databases:
{{- if .Values.awsDatabases }}
aws:
aws:
{{- range $awsDb := .Values.awsDatabases }}
{{- if not (hasKey $awsDb "types") }}
{{- fail "'types' is required for all 'awsDatabases' in chart values when key is set and db role is enabled, see README" }}
Expand All @@ -70,13 +69,11 @@ data:
{{- fail "'tags' is required for all 'awsDatabases' in chart values when key is set and db role is enabled, see README" }}
{{- end }}
{{- end }}
{{- toYaml .Values.awsDatabases | nindent 8 }}
{{- toYaml .Values.awsDatabases | nindent 6 }}
{{- end }}
{{- if .Values.databases }}
databases:
{{- range $db := .Values.databases }}
{{- if (and ($.Values.awsDatabases) (hasKey $db "aws")) }}
{{- fail "The 'aws' key cannot be used under 'databases' when 'awsDatabases' is also set - use autodiscovery for AWS databases, or run a separate agent without awsDatabases" }}
{{- end }}
{{- if not (hasKey $db "name") }}
{{- fail "'name' is required for all 'databases' in chart values when db role is enabled, see README" }}
{{- end }}
Expand All @@ -88,9 +85,9 @@ data:
{{- end }}
{{- end }}
{{- toYaml .Values.databases | nindent 6 }}
{{- else }}
enabled: false
{{- end }}
{{- else }}
enabled: false
{{- end }}
{{- end }}

Expand Down