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

Failed to parse ports #3133

Closed
pavolloffay opened this issue Jul 15, 2024 · 3 comments · Fixed by #3135
Closed

Failed to parse ports #3133

pavolloffay opened this issue Jul 15, 2024 · 3 comments · Fixed by #3135
Assignees
Labels
bug Something isn't working

Comments

@pavolloffay
Copy link
Member

Component(s)

collector

What happened?

Description

This is most likely regression after

Steps to Reproduce

apiVersion: v1
kind: Namespace
metadata:
  name: chainsaw-k8seventsreceiver

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: chainsaw-k8seventsreceiver
  namespace: chainsaw-k8seventsreceiver

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: chainsaw-k8seventsreceiver-role
rules:
- apiGroups:
  - ''
  resources:
  - events
  - namespaces
  - namespaces/status
  - nodes
  - nodes/spec
  - pods
  - pods/status
  - replicationcontrollers
  - replicationcontrollers/status
  - resourcequotas
  - services
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - apps
  resources:
  - daemonsets
  - deployments
  - replicasets
  - statefulsets
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - extensions
  resources:
  - daemonsets
  - deployments
  - replicasets
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - batch
  resources:
  - jobs
  - cronjobs
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - autoscaling
  resources:
  - horizontalpodautoscalers
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - quota.openshift.io
  resources:
  - clusterresourcequotas
  verbs:
  - get
  - list
  - watch

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: chainsaw-k8seventsreceiver-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: chainsaw-k8seventsreceiver-role
subjects:
  - kind: ServiceAccount
    name: chainsaw-k8seventsreceiver
    namespace: chainsaw-k8seventsreceiver

---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
  name: chainsaw-k8seventsreceiver
  namespace: chainsaw-k8seventsreceiver
spec:
  mode: deployment
  image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.98.0
  serviceAccount: chainsaw-k8seventsreceiver
  config: |
    receivers:
      otlp:
        protocols:
          http:
      k8s_events:
        namespaces: [chainsaw-k8seventsreceiver]
    exporters:
      debug:
        verbosity: detailed
    service:
      pipelines:
        logs:
          receivers: [k8s_events]
          exporters: [debug]
        traces:
          receivers: [otlp]
          exporters: [debug]

Expected Result

Actual Result

Kubernetes Version

1.30

Operator version

main

Collector version

0.103.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

Log output

{"level":"INFO","timestamp":"2024-07-15T07:18:59.764919673Z","logger":"KubeAPIWarningLogger","message":"Collector config spec.config has null objects: receivers.otlp.protocols.http:. For compatibility with other tooling, such as kustomize and kubectl edit, it is recommended to use empty objects e.g. batch: {}."}
{"level":"ERROR","timestamp":"2024-07-15T07:18:59.765386366Z","logger":"controllers.OpenTelemetryCollector","message":"couldn't parse the endpoint's port and no default port set","receiver":"k8s_events","error":"port should not be empty","stacktrace":"github.com/open-telemetry/opentelemetry-operator/internal/components.(*SingleEndpointParser).Ports\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/components/single_endpoint.go:75\ngithub.com/open-telemetry/opentelemetry-operator/apis/v1beta1.(*Config).getPortsForComponentKinds\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/apis/v1beta1/config.go:163\ngithub.com/open-telemetry/opentelemetry-operator/apis/v1beta1.(*Config).GetAllPorts\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/apis/v1beta1/config.go:187\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.getConfigContainerPorts\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/collector/container.go:209\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Container\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/collector/container.go:53\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Deployment\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/collector/deployment.go:62\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Build.Factory[...].func1\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/builder.go:37\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Build\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/collector/collector.go:72\ngithub.com/open-telemetry/opentelemetry-operator/controllers.BuildCollector\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/controllers/common.go:56\ngithub.com/open-telemetry/opentelemetry-operator/controllers.(*OpenTelemetryCollectorReconciler).Reconcile\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/controllers/opentelemetrycollector_controller.go:276\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222"}
{"level":"ERROR","timestamp":"2024-07-15T07:18:59.765460445Z","logger":"controllers.OpenTelemetryCollector","message":"container ports config","error":"port should not be empty","stacktrace":"github.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Container\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/collector/container.go:55\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Deployment\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/collector/deployment.go:62\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Build.Factory[...].func1\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/builder.go:37\ngithub.com/open-telemetry/opentelemetry-operator/internal/manifests/collector.Build\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/internal/manifests/collector/collector.go:72\ngithub.com/open-telemetry/opentelemetry-operator/controllers.BuildCollector\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/controllers/common.go:56\ngithub.com/open-telemetry/opentelemetry-operator/controllers.(*OpenTelemetryCollectorReconciler).Reconcile\n\t/home/ploffay/projects/open-telemetry/opentelemetry-operator/controllers/opentelemetrycollector_controller.go:276\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/ploffay/projects/golang/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222"}


### Additional context

_No response_
@pavolloffay pavolloffay added bug Something isn't working needs triage labels Jul 15, 2024
@pavolloffay
Copy link
Member Author

cc) @jaronoff97

@frzifus
Copy link
Member

frzifus commented Jul 15, 2024

@jaronoff97
Copy link
Contributor

Argh. I can fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants