jedcunningham commented on code in PR #49923:
URL: https://github.com/apache/airflow/pull/49923#discussion_r2098989353


##########
chart/templates/_helpers.yaml:
##########
@@ -98,6 +98,13 @@ If release name contains chart name it will be used as a 
full name.
         name: {{ template "webserver_secret_key_secret" . }}
         key: webserver-secret-key
   {{- end }}
+  {{- if .Values.enableBuiltInSecretEnvVars.AIRFLOW__API_AUTH__JWT_SECRET }}
+  - name: AIRFLOW__API_AUTH__JWT_SECRET

Review Comment:
   We only need to add this for Airflow 3 deployments. But, we have a bit of 
challenge in that, with the preinstall hook approach, the secret may not exist 
during upgrades...



##########
chart/templates/_helpers.yaml:
##########
@@ -98,6 +98,13 @@ If release name contains chart name it will be used as a 
full name.
         name: {{ template "webserver_secret_key_secret" . }}
         key: webserver-secret-key
   {{- end }}
+  {{- if .Values.enableBuiltInSecretEnvVars.AIRFLOW__API_AUTH__JWT_SECRET }}
+  - name: AIRFLOW__API_AUTH__JWT_SECRET

Review Comment:
   The `lookup` function also isn't a great answer here either... hmm, tricky.



##########
chart/templates/secrets/jwt-secret.yaml:
##########
@@ -0,0 +1,41 @@
+{{/*
+ 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 JWT Secret
+############################################
+{{- if not .Values.jwtSecretName }}
+{{ $generated_secret_key := (randAlphaNum 32 | b64enc) }}
+apiVersion: v1
+kind: Secret
+metadata:
+  name: {{ include "airflow.fullname" . }}-jwt-secret
+  labels:
+    tier: airflow
+    component: api-server
+    release: {{ .Release.Name }}
+    chart: {{ .Chart.Name }}
+    heritage: {{ .Release.Service }}
+    {{- with .Values.labels }}
+      {{- toYaml . | nindent 4 }}
+    {{- end }}
+type: Opaque
+data:
+  jwt-secret: {{ (default $generated_secret_key .Values.jwtSecret) | b64enc | 
quote }}

Review Comment:
   Won't this get changed during the next upgrade? We don't want that. [The 
fernet key is a preinstall hook for that 
reason](https://github.com/apache/airflow/blob/3a9858e7360129808274de1b8419f7abb7b6b9cb/chart/templates/secrets/fernetkey-secret.yaml#L38).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to