Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
p-se committed Feb 20, 2025
1 parent a10901c commit 40e1d92
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions internal/cmd/controller/agentmanagement/agent/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ var (
)

const (
DefaultName = "fleet-agent"
DefaultName = "fleet-agent"
electionLeaseDuration = "30s"
electionRetryPeriod = "10s"
electionRenewDeadline = "25s"
)

type ManifestOptions struct {
Expand Down Expand Up @@ -153,7 +156,6 @@ func agentApp(namespace string, agentScope string, opts ManifestOptions) *appsv1
"app": name,
},
},
// ServiceName: name,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand All @@ -176,10 +178,9 @@ func agentApp(namespace string, agentScope string, opts ManifestOptions) *appsv1
},
},
},
// TODO get configuration from config map
{Name: "CATTLE_ELECTION_LEASE_DURATION", Value: "30s"},
{Name: "CATTLE_ELECTION_RETRY_PERIOD", Value: "10s"},
{Name: "CATTLE_ELECTION_RENEW_DEADLINE", Value: "25s"},
{Name: "CATTLE_ELECTION_LEASE_DURATION", Value: electionLeaseDuration},
{Name: "CATTLE_ELECTION_RETRY_PERIOD", Value: electionRetryPeriod},
{Name: "CATTLE_ELECTION_RENEW_DEADLINE", Value: electionRenewDeadline},
},
Command: []string{
"fleetagent",
Expand Down Expand Up @@ -210,10 +211,9 @@ func agentApp(namespace string, agentScope string, opts ManifestOptions) *appsv1
},
},
{Name: "AGENT_SCOPE", Value: agentScope},
// TODO get configuration from config map
{Name: "CATTLE_ELECTION_LEASE_DURATION", Value: "30s"},
{Name: "CATTLE_ELECTION_RETRY_PERIOD", Value: "10s"},
{Name: "CATTLE_ELECTION_RENEW_DEADLINE", Value: "25s"},
{Name: "CATTLE_ELECTION_LEASE_DURATION", Value: electionLeaseDuration},
{Name: "CATTLE_ELECTION_RETRY_PERIOD", Value: electionRetryPeriod},
{Name: "CATTLE_ELECTION_RENEW_DEADLINE", Value: electionRenewDeadline},
},
Command: []string{
"fleetagent",
Expand Down Expand Up @@ -243,10 +243,9 @@ func agentApp(namespace string, agentScope string, opts ManifestOptions) *appsv1
},
},
{Name: "CHECKIN_INTERVAL", Value: opts.CheckinInterval},
// TODO get configuration from config map
{Name: "CATTLE_ELECTION_LEASE_DURATION", Value: "30s"},
{Name: "CATTLE_ELECTION_RETRY_PERIOD", Value: "10s"},
{Name: "CATTLE_ELECTION_RENEW_DEADLINE", Value: "25s"},
{Name: "CATTLE_ELECTION_LEASE_DURATION", Value: electionLeaseDuration},
{Name: "CATTLE_ELECTION_RETRY_PERIOD", Value: electionRetryPeriod},
{Name: "CATTLE_ELECTION_RENEW_DEADLINE", Value: electionRenewDeadline},
},
Command: []string{
"fleetagent",
Expand Down

0 comments on commit 40e1d92

Please sign in to comment.