OTEL Collector Installaction
Environment
- Kubernetes
- Require:
1.24+
- Actual:
1.18.3
- Require:
- Opentelemetry Collector Chart:
0.109.0
- Opentelemetry Collector Contrib:
0.113.0
Internal Traffic Policy
bash
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Service.spec): unknown field "internalTrafficPolicy" in io.k8s.api.core.v1.ServiceSpec
bash
grep internalTrafficPolicy templates/*
bash
templates/_helpers.tpl: {{- print (.Values.service.internalTrafficPolicy | default "Local") -}}
templates/_helpers.tpl: {{- print (.Values.service.internalTrafficPolicy | default "Cluster") -}}
templates/NOTES.txt:{{- if and (eq .Values.mode "daemonset") (eq .Values.service.internalTrafficPolicy "Cluster") }}
templates/NOTES.txt:[WARNING] Setting internalTrafficPolicy to 'Cluster' on Daemonset is not recommended. Consider using 'Local' instead.
templates/service.yaml: internalTrafficPolicy: {{ include "opentelemetry-collector.serviceInternalTrafficPolicy" . }}
Modify templates/service.yaml
,Delete following rows。
bash
internalTrafficPolicy: {{ include "opentelemetry-collector.serviceInternalTrafficPolicy" . }}
{{- if and (eq .Values.service.type "LoadBalancer") (.Values.service.externalTrafficPolicy) }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
Service Invalid
bash
Error: INSTALLATION FAILED: 1 error occurred:
* Service "otelcol-opentelemetry-collector" is invalid: spec.ports[3].appProtocol: Forbidden: This field can be enabled with the ServiceAppProtocol feature gate
Modify values.yaml
,Comment out appProtocol
。
yaml
ports:
otlp:
enabled: true
containerPort: 4317
servicePort: 4317
hostPort: 4317
protocol: TCP
# nodePort: 30317
# appProtocol: grpc