Skip to content

Commit

Permalink
[otel-integration] fix support for openshift (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv authored and nicolastakashi committed Oct 31, 2023
1 parent 0d7dba2 commit 330647a
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 13 deletions.
3 changes: 3 additions & 0 deletions logs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

## Fluent-Bit

### v2.1.4 / 2023-06-21
[CHANGE] Fixing SUB_SYSTEM_SYSTEMD value.

### v2.1.3 / 2023-06-21

* [UPGRADE] Upgrade Fluent-bit version to 2.1.3
Expand Down
2 changes: 1 addition & 1 deletion logs/fluent-bit/k8s-helm/http/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: fluent-bit-http
description: Fluent-Bit Chart with HTTP output plugin
version: 2.1.3
version: 2.1.4
appVersion: 2.1.3
keywords:
- Fluent-Bit
Expand Down
2 changes: 1 addition & 1 deletion logs/fluent-bit/k8s-helm/http/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fluent-bit:
- name: APP_NAME_SYSTEMD
value: systemd
- name: SUB_SYSTEM_SYSTEMD
value: SYSLOG_IDENTIFIER
value: kubelet
- name: HOSTNAME
valueFrom:
fieldRef:
Expand Down
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
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

0 comments on commit 330647a

Please sign in to comment.