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

Improve keepalived handling during updates #185

Merged
merged 29 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1e4643a
Add revision as annotation to LBM
Jun 13, 2023
83af865
add yawol keepalived file to change prio of keepalived
dergeberl Jun 13, 2023
623f3fa
WIP
Jun 13, 2023
98ebd34
Write LBM ContainsKeepAlivedMaster condition
Jun 13, 2023
263ccc5
Add tests for set contains master condition & refactor
Jun 13, 2023
0ba6983
Remove nopreemt from keepalived to ensure keepalived will swap state …
dergeberl Jun 14, 2023
254034f
Modify scaledown of old loadbalancersets to ensure that in the new se…
dergeberl Jun 14, 2023
3aa993c
remove redundant annotation
dergeberl Jun 14, 2023
ca8f9d4
make linter happy
dergeberl Jun 14, 2023
935cc9c
Rename v1 to metav1
Jun 14, 2023
453674a
Simplify patching `lbs` status
Jun 14, 2023
37051da
Rename `ContainsKeepalivedMaster´ to `HasKeepalivedMaster`
Jun 14, 2023
4d51e84
Do patches instead of updates; Improve tests
Jun 14, 2023
ba4da05
use aferoFs for revisionFile and rename function
dergeberl Jun 14, 2023
d4543ed
add comment to yawolfile in keepalived
dergeberl Jun 14, 2023
bfaac5b
rename yawollet keepalived file and create folder of needed
dergeberl Jun 14, 2023
c895dd1
LBSetContainsKeepalivedMaster is also true if there is no condition a…
dergeberl Jun 14, 2023
5f875e5
Use MatchingLabels instead of ListOptions
Jun 14, 2023
46fc909
Rename isMachineMaster to isMachineKeepalivedMaster
Jun 14, 2023
2a9be25
Rename filesystem variables and members
timebertt Jun 14, 2023
b8a4b0c
Move `/var/yawol` to `/var/lib/yawol`
timebertt Jun 14, 2023
34080fe
Make linter happy
timebertt Jun 14, 2023
3bbeefa
Improve `Should eventually have a master` test
Jun 14, 2023
74ae426
create /var/lib/yawol folder in image
dergeberl Jun 14, 2023
5d32018
add printcolumn for lbs
dergeberl Jun 14, 2023
bc9a2ac
Add missing yawollet permissions for `PATCH events`
timebertt Jun 14, 2023
d4637bb
write on 1 in yawol RevisionFile
dergeberl Jun 14, 2023
6e38e48
rename vrrp_track_file to track_file
dergeberl Jun 14, 2023
a46f4ff
write on 1 in yawol RevisionFile
dergeberl Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions internal/helper/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ const (
OpenstackReconcileTime = 5 * time.Minute
DefaultRequeueTime = 10 * time.Millisecond
RevisionAnnotation = "loadbalancer.yawol.stackit.cloud/revision"
YawolKeepalivedFile = "/tmp/yawolKeepalivedLastSet"
YawolKeepalivedDir = "/var/yawol/"
timebertt marked this conversation as resolved.
Show resolved Hide resolved
YawolKeepalivedFile = YawolKeepalivedDir + "set_is_latest_revision"
HashLabel = "lbm-template-hash"
LoadBalancerKind = "LoadBalancer"
LoadBalancerKind = "LoadBalancer"
VRRPInstanceName = "ENVOY"
HasKeepalivedMaster = "HasKeepalivedMaster"
HasKeepalivedMaster = "HasKeepalivedMaster"
)
3 changes: 3 additions & 0 deletions internal/helper/yawollet.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,9 @@ func EnableAdHocDebugging(
// Otherwise, make sure that the file is deleted.
// Use aferoFs to use it in tests.
func ReconcileLatestRevisionFile(aferoFs afero.Fs, lb *yawolv1beta1.LoadBalancer, lbm *yawolv1beta1.LoadBalancerMachine) error {
if err := aferoFs.MkdirAll(YawolKeepalivedDir, 0755); err != nil {
return err
}
if lbmIsLatestRevision(lb, lbm) {
// file should exist
f, err := aferoFs.Create(YawolKeepalivedFile)
Expand Down