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

Add HA Support for the Starboard Operator #452

Merged
merged 5 commits into from
Mar 25, 2021
Merged

Conversation

xyoxo
Copy link
Contributor

@xyoxo xyoxo commented Mar 23, 2021

Resolves #219

@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #452 (dc4d102) into main (89e3ba8) will decrease coverage by 0.07%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #452      +/-   ##
==========================================
- Coverage   69.24%   69.17%   -0.08%     
==========================================
  Files          57       57              
  Lines        3473     3478       +5     
==========================================
+ Hits         2405     2406       +1     
- Misses        788      790       +2     
- Partials      280      282       +2     
Impacted Files Coverage Δ
pkg/operator/etc/config.go 72.72% <ø> (ø)
pkg/operator/operator.go 56.19% <0.00%> (-2.23%) ⬇️
pkg/starboard/config.go 69.91% <0.00%> (-0.58%) ⬇️
pkg/operator/controller/ciskubebenchreport.go 64.13% <0.00%> (-1.64%) ⬇️
pkg/operator/controller/configauditreport.go 64.28% <0.00%> (-1.43%) ⬇️
pkg/operator/controller/vulnerabilityreport.go 63.08% <0.00%> (+3.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89e3ba8...dc4d102. Read the comment docs.

Copy link
Contributor

@danielpacak danielpacak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @xyoxo Good job. I tested it on my end and it seems to work as expected. I left a few questions though before we merge this PR.

I also noticed that controller-runtime is trying to create K8s events, but starboard-operator service account does not have such permission, i.e. I see the following errors in the log:

E0324 16:05:31.811972 1 event.go:264] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"starboard-operator.166f52e450b2f92f", GenerateName:"", Namespace:"starboard-operator", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"ConfigMap", Namespace:"starboard-operator", Name:"starboard-operator", UID:"04b1b499-fca9-4bad-a905-c6ff6066a802", APIVersion:"v1", ResourceVersion:"1913", FieldPath:""}, Reason:"LeaderElection", Message:"starboard-operator-b7cffd786-7slnw_843590a9-06bb-4aad-b58f-ca6c85a05b7d became leader", Source:v1.EventSource{Component:"starboard-operator-b7cffd786-7slnw_843590a9-06bb-4aad-b58f-ca6c85a05b7d", Host:""}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc00ef6b2f03bcb2f, ext:531398242, loc:(*time.Location)(0x2336e20)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc00ef6b2f03bcb2f, ext:531398242, loc:(*time.Location)(0x2336e20)}}, Count:1, Type:"Normal", EventTime:v1.MicroTime{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'events is forbidden: User "system:serviceaccount:starboard-operator:starboard-operator" cannot create resource "events" in API group "" in the namespace "starboard-operator"' (will not retry!)

deploy/helm/templates/rbac.yaml Show resolved Hide resolved
pkg/operator/etc/config.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[operator] Implement and enable leader election
2 participants