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

[otel-integration] fix support for openshift #320

Merged
merged 1 commit into from
Oct 31, 2023
Merged
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
3 changes: 3 additions & 0 deletions otel-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## OpenTelemtry-Integration

### v0.0.29 / 2023-10-31
* Fix support for openshift

### v0.0.28 / 2023-10-30
* [CHORE] Update Collector to 0.87.0 (v0.75.0)

Expand Down
2 changes: 1 addition & 1 deletion otel-integration/k8s-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: otel-integration
description: OpenTelemetry Integration
version: 0.0.27
version: 0.0.29
povilasv marked this conversation as resolved.
Show resolved Hide resolved
keywords:
- OpenTelemetry Collector
- OpenTelemetry Agent
Expand Down
15 changes: 15 additions & 0 deletions otel-integration/k8s-helm/templates/agent-cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if eq ((.Values.distribution)) "openshift" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:openshift:scc:{{ index .Values "opentelemetry-agent" "fullnameOverride" }}
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- {{ index .Values "opentelemetry-agent" "fullnameOverride" }}
resources:
- securitycontextconstraints
verbs:
- use
{{- end }}
14 changes: 14 additions & 0 deletions otel-integration/k8s-helm/templates/agent-crb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if eq ((.Values.distribution)) "openshift" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: system:openshift:scc:{{ index .Values "opentelemetry-agent" "fullnameOverride" }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:openshift:scc:{{ index .Values "opentelemetry-agent" "fullnameOverride" }}
subjects:
- kind: ServiceAccount
name: {{ index .Values "opentelemetry-agent" "fullnameOverride" }}
namespace: {{ .Release.Namespace }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:openshift:scc:{{.Values.global.fullnameOverride }}
name: system:openshift:scc:{{ index .Values "kube-state-metrics" "fullnameOverride" }}
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- {{.Values.global.fullnameOverride }}
- nonroot-v2
resources:
- securitycontextconstraints
verbs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: system:openshift:scc:{{.Values.global.fullnameOverride }}
name: system:openshift:scc:{{ index .Values "kube-state-metrics" "fullnameOverride" }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:openshift:scc:{{.Values.global.fullnameOverride }}
name: system:openshift:scc:{{ index .Values "kube-state-metrics" "fullnameOverride" }}
subjects:
- kind: ServiceAccount
name: {{.Values.global.fullnameOverride }}
name: {{ index .Values "kube-state-metrics" "fullnameOverride" }}
namespace: {{ .Release.Namespace }}
{{- end }}
10 changes: 5 additions & 5 deletions otel-integration/k8s-helm/templates/scc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ requiredDropCapabilities:
kind: SecurityContextConstraints
apiVersion: security.openshift.io/v1
metadata:
name: {{.Values.global.fullnameOverride }}
name: {{ index .Values "opentelemetry-agent" "fullnameOverride" }}
labels:
app: {{ template "opentelemetry-agent.name" . }}
chart: {{ template "opentelemetry-agent.chart" . }}
app: {{ template "opentelemetry-collector.name" . }}
chart: {{ template "opentelemetry-collector.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
users:
- system:serviceaccount:{{ .Release.Namespace }}:{{.Values.global.fullnameOverride }}
- system:serviceaccount:{{ .Release.Namespace }}:{{ index .Values "opentelemetry-agent" "fullnameOverride" }}
{{- $config := include "opentelemetry-coralogix.defaultSecurityContextConstraints" . | fromYaml }}
{{ .Values.securityContextConstraintsOverwrite | mustMergeOverwrite $config | toYaml }}
{{ index .Values "opentelemetry-agent" "securityContextConstraintsOverwrite" | mustMergeOverwrite $config | toYaml }}
{{- end }}
1 change: 1 addition & 0 deletions otel-integration/k8s-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ opentelemetry-agent-windows:
enabled: false

kube-state-metrics:
fullnameOverride: coralogix-opentelemetry-kube-state-metrics
prometheusScrape: false
collectors:
- pods
Expand Down
Loading