-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Helm RBAC Best Practices #14152
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
Merged
Merged
Helm RBAC Best Practices #14152
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
91c7ee3
Use rbac.create Helm best practice
jaydesl 08a72db
Enable serviceAccount creation per component
jaydesl 4dd5a18
Add conditional to webserver SA creation
jaydesl af5ad7f
Use ServiceAccount name if given
jaydesl 2eb4e3d
Add RBAC unit tests
jaydesl 5501b40
rebase with master
DerekHeldtWerle 1bbb62e
Adds service accounts to every deployable service, uid for pgbouncer/…
DerekHeldtWerle 60c8edc
Revamps the way service accounts are generated, fixes all test issues…
DerekHeldtWerle 40c707a
fixes service account templating for pod cleanup/launcher rolebindings
DerekHeldtWerle 11ad521
remove airflow.name from template, add fullnameOverride and nameOverr…
DerekHeldtWerle b72a75d
fix formatting for failing tests, add nameOverride and fullnameOverri…
DerekHeldtWerle 1c1a811
conditionally create worker service account using same checks as the …
DerekHeldtWerle 8006251
remove serviceAccountAnnotations in favor of <service>.serviceaccount…
DerekHeldtWerle 52a3769
adds cleanup sa annotations, missing job annotations from values.yaml…
DerekHeldtWerle 6a4d59e
Update chart/values.schema.json
DerekHeldtWerle 7e8d02d
Update chart/values.yaml
DerekHeldtWerle c1f1ad1
Adds test for service account annotations
DerekHeldtWerle 627aee1
split jobs into createUserJob and migrateDatabaseJob, address other P…
DerekHeldtWerle d717574
update docs to include createUserJob and migrateDatabaseJob
DerekHeldtWerle 521c93c
rebase with master and fix tests
DerekHeldtWerle 9460b8b
remove unused jobs.serviceAccountName from helpers.yaml
DerekHeldtWerle 3a9a580
change name of CLEANUP_DEPLOYMENT_KIND_NAME_TUPLES to DEPLOYMENT_NO_R…
DerekHeldtWerle 659be35
fix static checks
DerekHeldtWerle 0beaee4
fix path to newly added test
DerekHeldtWerle 3c04f88
Apply suggestions from code review
kaxil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,38 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| ###################################### | ||
| ## Airflow Flower ServiceAccount | ||
| ###################################### | ||
| {{- if and (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) .Values.flower.serviceAccount.create }} | ||
| kind: ServiceAccount | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: {{ include "flower.serviceAccountName" . }} | ||
| labels: | ||
| tier: airflow | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- with .Values.labels }} | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.flower.serviceAccount.annotations }} | ||
| annotations: | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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,38 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| ########################################### | ||
| ## Airflow Create User Job ServiceAccount | ||
| ########################################### | ||
| {{- if and .Values.createUserJob.serviceAccount.create .Values.webserver.defaultUser.enabled }} | ||
| kind: ServiceAccount | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: {{ include "createUserJob.serviceAccountName" . }} | ||
| labels: | ||
| tier: airflow | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- with .Values.labels }} | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.createUserJob.serviceAccount.annotations }} | ||
| annotations: | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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
38 changes: 38 additions & 0 deletions
38
chart/templates/jobs/migrate-database-job-serviceaccount.yaml
This file contains hidden or 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,38 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| ############################################# | ||
| ## Airflow Migrate Database Job ServiceAccount | ||
| ############################################## | ||
| {{- if .Values.migrateDatabaseJob.serviceAccount.create }} | ||
| kind: ServiceAccount | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: {{ include "migrateDatabaseJob.serviceAccountName" . }} | ||
| labels: | ||
| tier: airflow | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- with .Values.labels }} | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.migrateDatabaseJob.serviceAccount.annotations }} | ||
| annotations: | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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 hidden or 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 hidden or 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,38 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| ###################################### | ||
| ## Airflow Pgbouncer ServiceAccount | ||
| ###################################### | ||
| {{- if and .Values.pgbouncer.serviceAccount.create .Values.pgbouncer.enabled }} | ||
| kind: ServiceAccount | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: {{ include "pgbouncer.serviceAccountName" . }} | ||
| labels: | ||
| tier: airflow | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- with .Values.labels }} | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.pgbouncer.serviceAccount.annotations }} | ||
| annotations: | ||
| {{ toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.