vmware-tanzu/cluster-api-provider-bringyourownhost

Server reject event warning while bootstraping workload cluster

shivi28 opened this issue · 1 comments

What steps did you take and what happened:

When we run byohostagent in the docker/VM. Then it throws bellow warning while bootstraping k8s node.

Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"host0.171544ba06b05a46", GenerateName:"", Namespace:"default", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), DeletionTimestamp:, DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"ByoHost", Namespace:"default", Name:"host0", UID:"f0e16506-f110-4035-bcb7-42e251a1dea1", APIVersion:"infrastructure.cluster.x-k8s.io/v1beta1", ResourceVersion:"1503", FieldPath:""}, Reason:"BootstrapK8sNodeSucceeded", Message:"k8s Node Bootstraped", Source:v1.EventSource{Component:"hostagent-controller", Host:""}, FirstTimestamp:time.Date(2022, time.September, 16, 6, 53, 23, 150092870, time.Local), LastTimestamp:time.Date(2022, time.September, 16, 6, 53, 23, 150092870, time.Local), Count:1, Type:"Normal", EventTime:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'events is forbidden: User "byoh:host:host0" cannot create resource "events" in API group "" in the namespace "default"' (will not retry!)

This happened because event resources don't have CURD permission on "" apigroup.

What did you expect to happen:
K8s node should be bootstrapped successfully without throwing any warning.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-bringyourownhost version:
  • Kubernetes version: (use kubectl version --short):
  • OS (e.g. from /etc/os-release):

/assign @shivi28