feature: support liveness pobe path
This commit is contained in:
parent
db693aab26
commit
e147b8d3c8
1
main.go
1
main.go
@ -18,6 +18,7 @@ func main() {
|
|||||||
{
|
{
|
||||||
Image: "nginx",
|
Image: "nginx",
|
||||||
Path: "/api",
|
Path: "/api",
|
||||||
|
Health: "/",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Env: map[string]string{
|
Env: map[string]string{
|
||||||
|
@ -20,8 +20,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ImagesConfiguration struct {
|
type ImagesConfiguration struct {
|
||||||
Image string
|
Image string
|
||||||
Path string
|
Path string
|
||||||
|
Health string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
@ -88,6 +89,9 @@ func NewApplication(ctx *pulumi.Context, publicConfiguration *Configuration) (*A
|
|||||||
if publicImageConfiguration.Path == "" {
|
if publicImageConfiguration.Path == "" {
|
||||||
localImagesConfiguration.Path = "/"
|
localImagesConfiguration.Path = "/"
|
||||||
}
|
}
|
||||||
|
if publicImageConfiguration.Health == "" {
|
||||||
|
localImagesConfiguration.Health = "/"
|
||||||
|
}
|
||||||
if slices.Contains(preventDuplicatePath, localImagesConfiguration.Path) {
|
if slices.Contains(preventDuplicatePath, localImagesConfiguration.Path) {
|
||||||
return nil, errors.New("duplicate path in ingress configuration")
|
return nil, errors.New("duplicate path in ingress configuration")
|
||||||
}
|
}
|
||||||
@ -416,6 +420,12 @@ func createDeployment(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Env: env,
|
Env: env,
|
||||||
|
LivenessProbe: &corev1.ProbeArgs{
|
||||||
|
HttpGet: &corev1.HTTPGetActionArgs{
|
||||||
|
Path: pulumi.String(configuration.ImageReference.Health),
|
||||||
|
Port: pulumi.Int(80),
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user