Add readiness and liveness probes to API server (#365)

* Add readiness and liveness probes to API server

* Use `intstr.FromInt(8899)` instead
This commit is contained in:
M. Mert Yıldıran
2021-10-17 11:40:18 +03:00
committed by GitHub
parent 26834a6e04
commit 91196bb306
+21
View File
@@ -193,6 +193,8 @@ func (provider *Provider) CreateMizuApiServerPod(ctx context.Context, opts *ApiS
command = append(command, "--namespace", opts.Namespace)
}
port := intstr.FromInt(8899)
pod := &core.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: opts.PodName,
@@ -232,6 +234,25 @@ func (provider *Provider) CreateMizuApiServerPod(ctx context.Context, opts *ApiS
"memory": memRequests,
},
},
ReadinessProbe: &core.Probe{
Handler: core.Handler{
TCPSocket: &core.TCPSocketAction{
Port: port,
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 10,
},
LivenessProbe: &core.Probe{
Handler: core.Handler{
HTTPGet: &core.HTTPGetAction{
Path: "/echo",
Port: port,
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 10,
},
},
},
Volumes: []core.Volume{