Skip to content

Commit

Permalink
fix(schema-migrator): update async helm hook and remove unnecessary r…
Browse files Browse the repository at this point in the history
…esources (#544)

### Summary

- remove unnecessary files related to `schema-migrator-sync` role and
service account
- update `schema-migrator-async` job helm hook to `post-upgrade`
- set argocd equivalent of helm hooks using template
- set progressDeadlineSeconds to 600s for `otel-collector` and
`otel-collector-metrics`
- bump up signoz chart to 0.55.1

---------

Signed-off-by: Prashant Shahi <[email protected]>
  • Loading branch information
prashant-shahi authored Nov 1, 2024
1 parent 9949216 commit 0a250ce
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 58 deletions.
2 changes: 1 addition & 1 deletion charts/signoz/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: signoz
version: 0.55.0
version: 0.55.1
appVersion: "0.57.0"
description: SigNoz Observability Platform Helm Chart
type: application
Expand Down
12 changes: 0 additions & 12 deletions charts/signoz/templates/schema-migrator-async/role.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions charts/signoz/templates/schema-migrator-async/rolebinding.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions charts/signoz/templates/schema-migrator-async/serviceaccount.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.schemaMigrator.upgradeHelmHooks }}
argocd.argoproj.io/sync-wave: "1"
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
{{- if .Release.IsUpgrade }}
helm.sh/hook: pre-upgrade
helm.sh/hook: post-upgrade
helm.sh/hook-delete-policy: before-hook-creation
helm.sh/hook-weight: "1"
{{- end }}
{{- end }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ metadata:
{{- with .Values.schemaMigrator.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and .Release.IsUpgrade .Values.schemaMigrator.upgradeHelmHooks }}
{{- if .Values.schemaMigrator.upgradeHelmHooks }}
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
{{- if .Release.IsUpgrade }}
helm.sh/hook: pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation
{{- end }}
{{- end }}
spec:
template:
metadata:
labels:
{{- include "schemaMigrator.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "schemaMigrator.serviceAccountName" . }}-sync
initContainers:
{{- if .Values.schemaMigrator.initContainers.init.enabled }}
- name: schema-migrator-sync-init
Expand Down
4 changes: 2 additions & 2 deletions charts/signoz/templates/schema-migrator/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "schemaMigrator.roleName" . }}-sync
name: {{ include "schemaMigrator.roleName" . }}-async
namespace: {{ include "signoz.namespace" . }}
{{- with .Values.schemaMigrator.role.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
rules: {{ toYaml .Values.schemaMigrator.role.rules | nindent 2 -}}
{{- end }}
{{- end }}
10 changes: 7 additions & 3 deletions charts/signoz/templates/schema-migrator/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "schemaMigrator.roleBindingName" . }}-sync
name: {{ include "schemaMigrator.roleBindingName" . }}-async
namespace: {{ include "signoz.namespace" . }}
{{- with .Values.schemaMigrator.role.roleBinding.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "schemaMigrator.roleName" . }}-sync
name: {{ include "schemaMigrator.roleName" . }}-async
subjects:
- name: {{ include "schemaMigrator.serviceAccountName" . }}-sync
- name: {{ include "schemaMigrator.serviceAccountName" . }}-async
kind: ServiceAccount
namespace: {{ include "signoz.namespace" . }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "schemaMigrator.serviceAccountName" . }}-sync
name: {{ include "schemaMigrator.serviceAccountName" . }}-async
labels:
{{- include "schemaMigrator.labels" . | nindent 4 }}
{{- with .Values.schemaMigrator.serviceAccount.annotations }}
Expand Down
10 changes: 4 additions & 6 deletions charts/signoz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,8 @@ schemaMigrator:
- "--up="
# For usual Helm installs, we don't need any additional annotations.
# As well as for Helm upgrade (with upgradeHelmHooks to true), we automatically include the required pre-upgrade helm hooks.
# For ArgoCD, since every upgrade is an install, we need to explicitly specify the ArgoCD equivalent of the helm hooks.
annotations:
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
# For ArgoCD, since every upgrade is an install, we need to automatically include the relevant ArgoCD hooks using upgradeHelmHooks.
annotations: {}
# In Helm, this is needed to apply helm hooks for pre-upgrade, delete policy and hook weight.
# For ArgoCD, this is needed to apply the sync wave - ArgoCD equivalent of hook weight.
upgradeHelmHooks: true
Expand Down Expand Up @@ -1503,7 +1501,7 @@ otelCollector:
lowCardinalityExceptionGrouping: false

minReadySeconds: 5
progressDeadlineSeconds: 120
progressDeadlineSeconds: 600
replicaCount: 1

# OtelCollector RBAC config
Expand Down Expand Up @@ -2113,7 +2111,7 @@ otelCollectorMetrics:
# runAsUser: 1000

minReadySeconds: 5
progressDeadlineSeconds: 120
progressDeadlineSeconds: 600
replicaCount: 1

initContainers:
Expand Down

0 comments on commit 0a250ce

Please sign in to comment.