Skip to content

Commit

Permalink
update ipam startup probe and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zolug committed Aug 9, 2024
1 parent 1e2111c commit f192489
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cmd/ipam/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ func main() {

// create and start health server
ctx = health.CreateChecker(ctx)
if err := health.RegisterStartupSubservices(ctx); err != nil {
logger.Error(err, "RegisterStartupSubservices")
}
if err := health.RegisterReadinessSubservices(ctx, health.IPAMReadinessServices...); err != nil {
logger.Error(err, "RegisterReadinessSubservices")
}
Expand Down
2 changes: 1 addition & 1 deletion config/templates/charts/meridio/deployment/ipam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
command:
- /bin/grpc_health_probe
- -addr=unix:///tmp/health.sock
- -service=
- -service=Startup
- -connect-timeout=400ms
- -rpc-timeout=400ms
initialDelaySeconds: 0
Expand Down
2 changes: 2 additions & 0 deletions deployments/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ ipam:
service: "Readiness"
liveness:
service: "Liveness"
startup:
service: "Startup"

nsp:
image: nsp
Expand Down
1 change: 1 addition & 0 deletions docs/components/ipam.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Service | Description
--- | ---
Liveness | A unique service to be used by liveness probe to return status, can aggregate other lesser services
Readiness | A unique service to be used by readiness probe to return status, can aggregate other lesser services
Startup | A unique service to be used by startup probe to return status, can aggregate other lesser services

Service | Probe | Description
--- | --- | ---
Expand Down
7 changes: 4 additions & 3 deletions pkg/controllers/trench/ipam.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright (c) 2021-2022 Nordix Foundation
Copyright (c) 2024 OpenInfra Foundation Europe
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -106,15 +107,15 @@ func (i *IpamStatefulSet) insertParameters(dep *appsv1.StatefulSet) *appsv1.Stat
}
if container.StartupProbe == nil {
container.StartupProbe = common.GetProbe(common.StartUpTimer,
common.GetProbeCommand(false, "unix:///tmp/health.sock", ""))
common.GetProbeCommand(false, "unix:///tmp/health.sock", "Startup"))
}
if container.ReadinessProbe == nil {
container.ReadinessProbe = common.GetProbe(common.ReadinessTimer,
common.GetProbeCommand(true, fmt.Sprintf(":%d", common.IpamPort), ""))
common.GetProbeCommand(false, "unix:///tmp/health.sock", "Readiness"))
}
if container.LivenessProbe == nil {
container.LivenessProbe = common.GetProbe(common.LivenessTimer,
common.GetProbeCommand(false, "unix:///tmp/health.sock", ""))
common.GetProbeCommand(false, "unix:///tmp/health.sock", "Liveness"))
}
container.Env = i.getEnvVars(ret.Spec.Template.Spec.Containers[0].Env)
// set resource requirements for container (if not found, then values from model
Expand Down

0 comments on commit f192489

Please sign in to comment.