Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Changes needed to upgrade the otel operator to 0.76.0 #3877

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/3877.changed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: Changes needed to upgrade the otel operator to 0.76.0
2 changes: 1 addition & 1 deletion deploy/helm/sumologic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies:
repository: https://sumologic.github.io/tailing-sidecar
condition: tailing-sidecar-operator.enabled
- name: opentelemetry-operator
version: 0.56.1
version: 0.76.0
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
condition: opentelemetry-operator.enabled,sumologic.metrics.collector.otelcol.enabled
- name: prometheus-windows-exporter
Expand Down
1,764 changes: 1,764 additions & 0 deletions deploy/helm/sumologic/crds/crd-opentelemetry.io_opampbridges.yaml

Large diffs are not rendered by default.

9,282 changes: 9,282 additions & 0 deletions deploy/helm/sumologic/crds/crd-opentelemetrycollector.yaml

Large diffs are not rendered by default.

1,892 changes: 1,892 additions & 0 deletions deploy/helm/sumologic/crds/crd-opentelemetryinstrumentation.yaml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions deploy/helm/sumologic/templates/_helpers/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ sumologic.com/app: setup
{{- template "sumologic.labels.app.setup" . }}
{{- end -}}

{{- define "sumologic.labels.app.setup.configmap.crds" -}}
{{- template "sumologic.labels.app.setup" . }}-crds
{{- end -}}

{{- define "sumologic.labels.app.setup.roles.role" -}}
{{- template "sumologic.labels.app.setup" . }}
{{- end -}}
Expand Down Expand Up @@ -211,6 +215,10 @@ helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
{{ template "sumologic.metadata.name.setup" . }}
{{- end -}}

{{- define "sumologic.metadata.name.setup.job-crd" -}}
{{ template "sumologic.metadata.name.setup.job" . }}-crd
{{- end -}}

{{- define "sumologic.metadata.name.setup.configmap-custom" -}}
{{ template "sumologic.metadata.name.setup" . }}-custom
{{- end -}}
Expand All @@ -219,6 +227,10 @@ helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
{{ template "sumologic.metadata.name.setup" . }}
{{- end -}}

{{- define "sumologic.metadata.name.setup.configmap-crds" -}}
{{ template "sumologic.metadata.name.setup" . }}-crds
{{- end -}}

{{- define "sumologic.metadata.name.setup.roles.role" -}}
{{ template "sumologic.metadata.name.setup" . }}
{{- end -}}
Expand Down
8 changes: 8 additions & 0 deletions deploy/helm/sumologic/templates/_helpers/_metrics.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ Return the otelcol metrics collector image
{{- end -}}
{{- end -}}

{{- define "sumologic.metrics.collector.otelcol.managementState" -}}
{{printf "managed"}}
{{- end -}}

{{- define "sumologic.metrics.collector.otelcol.upgradeStrategy" -}}
{{printf "automatic"}}
{{- end -}}

{{- define "metrics.collector.otelcol.affinity" -}}
{{- if .Values.sumologic.metrics.collector.otelcol.affinity -}}
{{- toYaml .Values.sumologic.metrics.collector.otelcol.affinity -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{ else }}
{{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
{{ end }}
apiVersion: opentelemetry.io/v1alpha1
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: {{ template "sumologic.metadata.name.metrics.collector.opentelemetrycollector" . }}
Expand All @@ -28,6 +28,8 @@ spec:
mode: statefulset
replicas: {{ .Values.sumologic.metrics.collector.otelcol.replicaCount }}
serviceAccount: {{ template "sumologic.metadata.name.metrics.collector.serviceaccount" . }}
managementState: {{ template "sumologic.metrics.collector.otelcol.managementState" . }}
upgradeStrategy: {{ template "sumologic.metrics.collector.otelcol.upgradeStrategy" . }}
targetAllocator:
{{- if .Values.sumologic.metrics.collector.otelcol.allocationStrategy }}
allocationStrategy: {{ .Values.sumologic.metrics.collector.otelcol.allocationStrategy }}
Expand All @@ -41,13 +43,11 @@ spec:
{{- if .Values.sumologic.metrics.collector.otelcol.serviceMonitorSelector }}
{{ .Values.sumologic.metrics.collector.otelcol.serviceMonitorSelector | toYaml | nindent 8 }}
{{- else }}
release: {{ .Release.Name }}
{{- end }}
podMonitorSelector:
{{- if .Values.sumologic.metrics.collector.otelcol.podMonitorSelector }}
{{ .Values.sumologic.metrics.collector.otelcol.podMonitorSelector | toYaml | nindent 8 }}
{{- else }}
release: {{ .Release.Name }}
{{- end }}
serviceAccount: {{ template "sumologic.metadata.name.metrics.targetallocator.serviceaccount" . }}
{{- if not (empty (include "metrics.collector.otelcol.nodeSelector" .)) }}
Expand Down Expand Up @@ -129,6 +129,6 @@ spec:
mountPath: /tmp
- name: file-storage
mountPath: /var/lib/storage/otc
config: |
config:
{{- $finalConfig | toYaml | nindent 4 }}
{{- end }}
17 changes: 17 additions & 0 deletions deploy/helm/sumologic/templates/setup/crds-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.sumologic.installCRDs -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "sumologic.metadata.name.setup.configmap-crds" . }}
namespace: {{ template "sumologic.namespace" . }}
annotations:
{{ include "sumologic.annotations.app.setup.helmsh" "2" | indent 4 }}
labels:
app: {{ template "sumologic.labels.app.setup.configmap.crds" . }}
{{- include "sumologic.labels.common" . | nindent 4 }}
data:
crds-configmaps.yaml: |-
{{ range $path, $bytes := .Files.Glob (printf "crds/*")}}
{{- $.Files.Get $path | nindent 8 }}
{{ end }}
{{- end -}}
8 changes: 7 additions & 1 deletion deploy/helm/sumologic/templates/setup/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,24 @@ spec:
configMap:
name: {{ template "sumologic.metadata.name.setup.configmap-custom" . }}
defaultMode: 0777
- name: manifests
configMap:
name: {{ template "sumologic.metadata.name.setup.configmap-crds" . }}
defaultMode: 0777
containers:
- name: setup
image: {{ .Values.sumologic.setup.job.image.repository }}:{{ .Values.sumologic.setup.job.image.tag }}
imagePullPolicy: {{ .Values.sumologic.setup.job.image.pullPolicy }}
command: ["/etc/terraform/setup.sh"]
command: ["/etc/terraform/setup.sh", "kubectl apply --server-side -f /manifests/crds-configmaps.yaml --force-conflicts"]
resources:
{{- toYaml .Values.sumologic.setup.job.resources | nindent 10 }}
volumeMounts:
- name: setup
mountPath: /etc/terraform
- name: custom
mountPath: /customer-scripts
- name: manifests
mountPath: /manifests
envFrom:
- secretRef:
name: {{ .Values.sumologic.envFromSecret | default (include "sumologic.metadata.name.setup.secret" .)}}
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ sumologic:
## If enabled, a pre-delete hook will destroy Collector in Sumo Logic
cleanupEnabled: false

## Installation of CRDs
installCRDs: true

## If enabled, accessId and accessKey will be sourced from Secret Name given
## Be sure to include at least the following env variables in your secret
## (1) SUMOLOGIC_ACCESSID, (2) SUMOLOGIC_ACCESSKEY
Expand Down Expand Up @@ -2468,6 +2471,10 @@ tailing-sidecar-operator:
opentelemetry-operator:
enabled: true

## CRDs are installed manually, do not create them
crds:
create: false

## Specific for OpenTelemetry Operator chart values
admissionWebhooks:
create: true
Expand Down
Loading