-
Notifications
You must be signed in to change notification settings - Fork 34
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 a cleanup loop for failed vm using configmap #59
Changes from all commits
bed89b1
d1048ba
719dc55
6f2a41c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,6 +172,7 @@ spec: | |
containers: | ||
- args: | ||
- --v=production | ||
- --wait-time=600 | ||
command: | ||
- /manager | ||
env: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,6 +172,7 @@ spec: | |
containers: | ||
- args: | ||
- --v=debug | ||
- --wait-time=10 | ||
command: | ||
- /manager | ||
env: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ spec: | |
name: manager | ||
args: | ||
- "--v=debug" | ||
- "--wait-time=10" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
source hack/common.sh | ||
KUBECONFIG=${MACPOOL_DIR}/cluster/$MACPOOL_PROVIDER/.kubeconfig go test -v -race ./tests/... | ||
KUBECONFIG=${MACPOOL_DIR}/cluster/$MACPOOL_PROVIDER/.kubeconfig go test -timeout 20m -v -race ./tests/... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package names | ||
|
||
const MANAGER_NAMESPACE = "kubemacpool-system" | ||
|
||
const MANAGER_DEPLOYMENT = "kubemacpool-mac-controller-manager" | ||
|
||
const WEBHOOK_SERVICE = "kubemacpool-service" | ||
|
||
const MUTATE_WEBHOOK = "kubemacpool-webhook" | ||
|
||
const MUTATE_WEBHOOK_CONFIG = "kubemacpool" | ||
|
||
const LEADER_LABEL = "kubemacpool-leader" | ||
|
||
const ADMISSION_IGNORE_LABEL = "kubemacpool/ignoreAdmission" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ const ( | |
RuntimeObjectFinalizerName = "k8s.v1.cni.cncf.io/kubeMacPool" | ||
networksAnnotation = "k8s.v1.cni.cncf.io/networks" | ||
networksStatusAnnotation = "k8s.v1.cni.cncf.io/networks-status" | ||
vmWaitConfigMapName = "kubemacpool-vm-configmap" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this CM good for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This CM saved the allocated mac addresses in waiting state. We need to use it in case of a race condition that our manager go down and It have that types of allocations so the new leader can continue from the same state. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds dangerous synchronisation-wise, but that's not different from the rest of kubemacpool... :D |
||
) | ||
|
||
var log = logf.Log.WithName("PoolManager") | ||
|
@@ -54,7 +55,7 @@ const ( | |
AllocationStatusWaitingForPod AllocationStatus = "WaitingForPod" | ||
) | ||
|
||
func NewPoolManager(kubeClient kubernetes.Interface, rangeStart, rangeEnd net.HardwareAddr, kubevirtExist bool) (*PoolManager, error) { | ||
func NewPoolManager(kubeClient kubernetes.Interface, rangeStart, rangeEnd net.HardwareAddr, kubevirtExist bool, waitTime int) (*PoolManager, error) { | ||
err := checkRange(rangeStart, rangeEnd) | ||
if err != nil { | ||
return nil, err | ||
|
@@ -86,6 +87,8 @@ func NewPoolManager(kubeClient kubernetes.Interface, rangeStart, rangeEnd net.Ha | |
return nil, err | ||
} | ||
|
||
go poolManger.vmWaitingCleanupLook(waitTime) | ||
|
||
return poolManger, nil | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you introduce this change in a different commit please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done