You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "mikaeld (via GitHub)" <gi...@apache.org> on 2023/07/20 15:26:30 UTC
[GitHub] [airflow] mikaeld opened a new pull request, #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
mikaeld opened a new pull request, #32724:
URL: https://github.com/apache/airflow/pull/32724
This PR adds existing secret support for PGBouncer's metrics exporter sidecar container. While PGBouncer's container supports existing secrets for its configuration through `configSecretName`, the metrics exporter sidecar lacked this feature which prevented users from effectively configuring the PGBouncer deployment with existing secrets.
This PR also adds the possibility to define a custom secrets key in the existing stats secret. This allows users to use an existing secret without risking conflicts from the generic key `connection` if used in other deployments. If left undefined, the secrets key will default to `connection` as expected.
<!--
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.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mikaeld commented on a diff in pull request #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
Posted by "mikaeld (via GitHub)" <gi...@apache.org>.
mikaeld commented on code in PR #32724:
URL: https://github.com/apache/airflow/pull/32724#discussion_r1298570195
##########
chart/templates/secrets/pgbouncer-stats-secret.yaml:
##########
Review Comment:
I just realized my code did not reflect my original intent and you are right that things 💣
I've update the template and added a unit test. If secret key is defined but secret name is undefined, it will use the chart-included secret. If secret key is undefined but secret name is defined, it will use the external secret name with the `connection` key.
##########
chart/templates/secrets/pgbouncer-stats-secret.yaml:
##########
Review Comment:
I just realized my code did not reflect my original intent and you are right that things 💣
I've update the template and added a unit test. If secret key is defined but secret name is undefined, it will use the chart-included secret. If secret key is undefined but secret name is defined, it will use the external secret name with the `connection` key.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham merged pull request #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham merged PR #32724:
URL: https://github.com/apache/airflow/pull/32724
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mikaeld commented on a diff in pull request #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
Posted by "mikaeld (via GitHub)" <gi...@apache.org>.
mikaeld commented on code in PR #32724:
URL: https://github.com/apache/airflow/pull/32724#discussion_r1272402622
##########
chart/values.schema.json:
##########
@@ -5341,6 +5341,22 @@
],
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
+ "statsSecretName": {
+ "description": "The PgBouncer Metrics Secret name.",
Review Comment:
Done! LMK if that's alright!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on code in PR #32724:
URL: https://github.com/apache/airflow/pull/32724#discussion_r1271251280
##########
chart/templates/secrets/pgbouncer-stats-secret.yaml:
##########
Review Comment:
I feel like the key here should use `statsSecretKey` as well, in the off chance someone configures that but not `statsSecretName`.
##########
chart/values.schema.json:
##########
@@ -5341,6 +5341,22 @@
],
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
+ "statsSecretName": {
+ "description": "The PgBouncer Metrics Secret name.",
Review Comment:
Can you flesh out these new descriptions a little more? Just a bit, but rehashing the key doesn't really help all that much.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mikaeld commented on a diff in pull request #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
Posted by "mikaeld (via GitHub)" <gi...@apache.org>.
mikaeld commented on code in PR #32724:
URL: https://github.com/apache/airflow/pull/32724#discussion_r1272402622
##########
chart/values.schema.json:
##########
@@ -5341,6 +5341,22 @@
],
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
+ "statsSecretName": {
+ "description": "The PgBouncer Metrics Secret name.",
Review Comment:
Done for both key and name! LMK if that's alright!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on code in PR #32724:
URL: https://github.com/apache/airflow/pull/32724#discussion_r1295190150
##########
chart/templates/secrets/pgbouncer-stats-secret.yaml:
##########
Review Comment:
I agree there isn't much point, but if the env var uses the config... the secret backing it should as well. As written, if someone just added the secretKey things would 💣
##########
chart/templates/secrets/pgbouncer-stats-secret.yaml:
##########
Review Comment:
I agree there isn't much point, but if the env var uses the config... the secret backing it should as well. As written, if someone just added the secretKey things would 💣
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mikaeld commented on a diff in pull request #32724: feat(chart): Add existing secret support for PGBouncer metrics exporter.
Posted by "mikaeld (via GitHub)" <gi...@apache.org>.
mikaeld commented on code in PR #32724:
URL: https://github.com/apache/airflow/pull/32724#discussion_r1272393274
##########
chart/templates/secrets/pgbouncer-stats-secret.yaml:
##########
Review Comment:
IMO there is no point in having a custom key with the included chart secret. I believe the chart secret should only be created if `statsSecretName` is undefined, regardless of `statsSecretKey`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org