From 8447f032f9d8d1631121320613e9780a3e7904ea Mon Sep 17 00:00:00 2001 From: Z4ck404 Date: Tue, 20 Aug 2024 12:13:55 +0200 Subject: [PATCH] [charts/bigdata-spark-watcher] added conditional envVars for k8s events collection --- charts/bigdata-spark-watcher/Chart.yaml | 4 +- .../templates/deployment.yaml | 29 +++++++++++++-- charts/bigdata-spark-watcher/values.yaml | 37 ++++++------------- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/charts/bigdata-spark-watcher/Chart.yaml b/charts/bigdata-spark-watcher/Chart.yaml index 6f28bd8..43bcbc2 100644 --- a/charts/bigdata-spark-watcher/Chart.yaml +++ b/charts/bigdata-spark-watcher/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: bigdata-spark-watcher description: A Helm chart for the Spot Big Data Spark Watcher type: application -version: 0.5.21 -appVersion: 0.5.4 +version: 0.5.22 +appVersion: 0.5.3 home: https://github.com/spotinst/charts icon: https://docs.spot.io/_media/images/spot_mark.png sources: diff --git a/charts/bigdata-spark-watcher/templates/deployment.yaml b/charts/bigdata-spark-watcher/templates/deployment.yaml index 9695a99..1557e28 100644 --- a/charts/bigdata-spark-watcher/templates/deployment.yaml +++ b/charts/bigdata-spark-watcher/templates/deployment.yaml @@ -60,10 +60,33 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.envVars }} env: - {{- toYaml . | nindent 12 }} - {{- end }} + - name: SPOTINST_BASE_URL + value: {{ .Values.spotBaseUrl }} + {{- if .Values.k8sEventLogCollectorEnabled }} + - name: APP_SYNC_PERIOD + value: {{ .Values.k8SEventLogCollection.appSyncPeriod }} + - name: APP_SYNC_KILL_GRACE_PERIOD + value: {{ .Values.k8SEventLogCollection.appSyncKillGracePeriod }} + - name: APP_SYNC_GHOST_GRACE_PERIOD + value: {{ .Values.k8SEventLogCollection.appSyncKillGhostGracePeriod }} + - name: APP_SYNC_REVERSE_GHOST_GRACE_PERIOD + value: {{ .Values.k8SEventLogCollection.appSyncReverseGhostGracePeriod }} + - name: KUBE_EVENT_LOG_COLLECTION_BUCKET_PREFIX + value: {{ .Values.k8SEventLogCollection.bucketPrefix }} + - name: AWS_CREDENTIALS_FILE + value: /creds/aws + - name: GCP_CREDENTIALS_FILE + value: /creds/gcp + - name: AZURE_CREDENTIALS_FILE + value: /creds/azure + - name: CREDS_REFRESH_INTERVAL + value: 2m + - name: SPARK_APP_FAILED_EXECUTOR_LIMIT + value: {{ .Values.k8SEventLogCollection.sparkAppFaildExecutorLimit }} + - name: SPARK_APP_TERMINATED_CRITICAL_SIDECAR_GRACE_PERIOD + value: {{ .Values.k8SEventLogCollection.sparkAppTerminatedCriticalSidecarGracePeriod }} + {{- end }} - name: HTTP_PROXY valueFrom: configMapKeyRef: diff --git a/charts/bigdata-spark-watcher/values.yaml b/charts/bigdata-spark-watcher/values.yaml index 0afbe62..3ecc9a8 100644 --- a/charts/bigdata-spark-watcher/values.yaml +++ b/charts/bigdata-spark-watcher/values.yaml @@ -16,31 +16,7 @@ imagePullSecrets: nameOverride: "" fullnameOverride: "" -envVars: - - name: SPOTINST_BASE_URL - value: https://api.spotinst.io - - name: APP_SYNC_PERIOD - value: 5m - - name: APP_SYNC_KILL_GRACE_PERIOD - value: 5m - - name: APP_SYNC_GHOST_GRACE_PERIOD - value: 6m - - name: APP_SYNC_REVERSE_GHOST_GRACE_PERIOD - value: 30s - - name: KUBE_EVENT_LOG_COLLECTION_BUCKET_PREFIX - value: "spot-bigdata-logcollector" - - name: AWS_CREDENTIALS_FILE - value: /creds/aws - - name: GCP_CREDENTIALS_FILE - value: /creds/gcp - - name: AZURE_CREDENTIALS_FILE - value: /creds/azure - - name: CREDS_REFRESH_INTERVAL - value: 2m - - name: SPARK_APP_FAILED_EXECUTOR_LIMIT - value: "200" - - name: SPARK_APP_TERMINATED_CRITICAL_SIDECAR_GRACE_PERIOD - value: 3m +spotBaseUrl: "https://api.spotinst.io" # Spark Application watch label - used to select sparkApplication custom resources saWatchLabel: "" @@ -92,6 +68,17 @@ telemetry: repository: public.ecr.aws/ocean-spark/fluent-bit tag: 3.0.5 +k8SEventLogCollection: + # enabled: true + appSyncPeriod: 5m + appSyncKillGracePeriod: 5m + appSyncKillGhostGracePeriod: 5m + appSyncReverseGhostGracePeriod: 30s + bucketPrefix: "spot-bigdata-logcollector" + sparkAppFaildExecutorLimit: "200" + sparkAppTerminatedCriticalSidecarGracePeriod: 3m + + nodeSelector: {} tolerations: