From f620125222e475a8cfd4713bcfc87f971e5c73a4 Mon Sep 17 00:00:00 2001 From: Z4ck404 Date: Tue, 20 Aug 2024 12:13:55 +0200 Subject: [PATCH 1/3] [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..75df362 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.sparkAppFailedExecutorLimit }} + - 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..2e3bc2d 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" + sparkAppFailedExecutorLimit: '200' + sparkAppTerminatedCriticalSidecarGracePeriod: 3m + + nodeSelector: {} tolerations: From 122d5b290759a4b76f5ba8474b4f4759c6d4be72 Mon Sep 17 00:00:00 2001 From: HafdisE Date: Mon, 16 Sep 2024 15:25:56 +0000 Subject: [PATCH 2/3] flatten, fix typos, etc. --- charts/bigdata-spark-watcher/Chart.yaml | 2 +- .../templates/deployment.yaml | 18 ++++++++-------- charts/bigdata-spark-watcher/values.yaml | 21 +++++++++---------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/charts/bigdata-spark-watcher/Chart.yaml b/charts/bigdata-spark-watcher/Chart.yaml index 43bcbc2..144929e 100644 --- a/charts/bigdata-spark-watcher/Chart.yaml +++ b/charts/bigdata-spark-watcher/Chart.yaml @@ -3,7 +3,7 @@ name: bigdata-spark-watcher description: A Helm chart for the Spot Big Data Spark Watcher type: application version: 0.5.22 -appVersion: 0.5.3 +appVersion: 0.5.4 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 75df362..eb6c060 100644 --- a/charts/bigdata-spark-watcher/templates/deployment.yaml +++ b/charts/bigdata-spark-watcher/templates/deployment.yaml @@ -63,17 +63,18 @@ spec: env: - name: SPOTINST_BASE_URL value: {{ .Values.spotBaseUrl }} - {{- if .Values.k8sEventLogCollectorEnabled }} - name: APP_SYNC_PERIOD - value: {{ .Values.k8SEventLogCollection.appSyncPeriod }} + value: {{ .Values.appSyncPeriod }} - name: APP_SYNC_KILL_GRACE_PERIOD - value: {{ .Values.k8SEventLogCollection.appSyncKillGracePeriod }} + value: {{ .Values.appSyncKillGracePeriod }} - name: APP_SYNC_GHOST_GRACE_PERIOD - value: {{ .Values.k8SEventLogCollection.appSyncKillGhostGracePeriod }} + value: {{ .Values.appSyncKillGhostGracePeriod }} - name: APP_SYNC_REVERSE_GHOST_GRACE_PERIOD - value: {{ .Values.k8SEventLogCollection.appSyncReverseGhostGracePeriod }} + value: {{ .Values.appSyncReverseGhostGracePeriod }} - name: KUBE_EVENT_LOG_COLLECTION_BUCKET_PREFIX - value: {{ .Values.k8SEventLogCollection.bucketPrefix }} + value: {{ .Values.k8sEventLogCollectorBucketPrefix }} + - name: KUBE_EVENT_LOG_COLLECTION_ENVIRONMENT + value: {{ .Values.k8sEventLogCollectorEnvironment }} - name: AWS_CREDENTIALS_FILE value: /creds/aws - name: GCP_CREDENTIALS_FILE @@ -83,10 +84,9 @@ spec: - name: CREDS_REFRESH_INTERVAL value: 2m - name: SPARK_APP_FAILED_EXECUTOR_LIMIT - value: {{ .Values.k8SEventLogCollection.sparkAppFailedExecutorLimit }} + value: {{ .Values.sparkAppFailedExecutorLimit | quote }} - name: SPARK_APP_TERMINATED_CRITICAL_SIDECAR_GRACE_PERIOD - value: {{ .Values.k8SEventLogCollection.sparkAppTerminatedCriticalSidecarGracePeriod }} - {{- end }} + value: {{ .Values.sparkAppTerminatedCriticalSidecarGracePeriod }} - name: HTTP_PROXY valueFrom: configMapKeyRef: diff --git a/charts/bigdata-spark-watcher/values.yaml b/charts/bigdata-spark-watcher/values.yaml index 2e3bc2d..3e2df10 100644 --- a/charts/bigdata-spark-watcher/values.yaml +++ b/charts/bigdata-spark-watcher/values.yaml @@ -29,7 +29,17 @@ logLevel: debug killSyncerEnabled: true ghostSyncerEnabled: true + +appSyncKillGracePeriod: 5m +appSyncKillGhostGracePeriod: 5m +appSyncReverseGhostGracePeriod: 30s +appSyncPeriod: 5m +sparkAppFailedExecutorLimit: 200 +sparkAppTerminatedCriticalSidecarGracePeriod: 3m + k8sEventLogCollectorEnabled: true +k8sEventLogCollectorBucketPrefix: "spot-bigdata-logcollector" +k8sEventLogCollectorEnvironment: "" serviceAccount: create: true @@ -68,17 +78,6 @@ 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" - sparkAppFailedExecutorLimit: '200' - sparkAppTerminatedCriticalSidecarGracePeriod: 3m - - nodeSelector: {} tolerations: From 3f86d40f7b17759ac4270514f75daa86ed6497cf Mon Sep 17 00:00:00 2001 From: HafdisE Date: Tue, 17 Sep 2024 15:22:09 +0000 Subject: [PATCH 3/3] unflatten and naming --- charts/bigdata-spark-watcher/templates/deployment.yaml | 4 ++-- charts/bigdata-spark-watcher/values.yaml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/bigdata-spark-watcher/templates/deployment.yaml b/charts/bigdata-spark-watcher/templates/deployment.yaml index eb6c060..288f813 100644 --- a/charts/bigdata-spark-watcher/templates/deployment.yaml +++ b/charts/bigdata-spark-watcher/templates/deployment.yaml @@ -72,9 +72,9 @@ spec: - name: APP_SYNC_REVERSE_GHOST_GRACE_PERIOD value: {{ .Values.appSyncReverseGhostGracePeriod }} - name: KUBE_EVENT_LOG_COLLECTION_BUCKET_PREFIX - value: {{ .Values.k8sEventLogCollectorBucketPrefix }} + value: {{ .Values.k8sEventLogCollector.bucketPrefix }} - name: KUBE_EVENT_LOG_COLLECTION_ENVIRONMENT - value: {{ .Values.k8sEventLogCollectorEnvironment }} + value: {{ .Values.k8sEventLogCollector.environment }} - name: AWS_CREDENTIALS_FILE value: /creds/aws - name: GCP_CREDENTIALS_FILE diff --git a/charts/bigdata-spark-watcher/values.yaml b/charts/bigdata-spark-watcher/values.yaml index 3e2df10..b57d346 100644 --- a/charts/bigdata-spark-watcher/values.yaml +++ b/charts/bigdata-spark-watcher/values.yaml @@ -38,8 +38,9 @@ sparkAppFailedExecutorLimit: 200 sparkAppTerminatedCriticalSidecarGracePeriod: 3m k8sEventLogCollectorEnabled: true -k8sEventLogCollectorBucketPrefix: "spot-bigdata-logcollector" -k8sEventLogCollectorEnvironment: "" +k8sEventLogCollector: + bucketPrefix: "spot-bigdata-logcollector" + environment: "" serviceAccount: create: true