Skip to content

Commit 63de46c

Browse files
committed
Tune and enhance neutron-operator probes
This patch tunes the liveness and readiness probes to match other operators [0][1][2][3]. We noticed that at times neutron tests would fail with 5XX errors, indicating that the service was not avaiable during the execution of the test, after investigation it was reported that neutron containers were restarted due to probe failures. Prior to this patch, neutron had the liveness and readiness probes set to 5s where the majority of other operators had it set to something as high as 30s (see links below). This patch also removes the readiness probe from the neutron-api container as it's redundant since it checks for readiness of the httpd container (which is already checked by the httpd container readiness probe itself). Resolves: https://issues.redhat.com/browse/OSPRH-9305 [0] https://github.com/openstack-k8s-operators/nova-operator/blob/27895863ccb7a5ef552e3d924d778fc7f664d056/pkg/novaapi/deployment.go#L49 [1] https://github.com/openstack-k8s-operators/keystone-operator/blob/1c577c9ef57612991d4139ab232eca61f0f43e83/pkg/keystone/deployment.go#L46 [2] https://github.com/openstack-k8s-operators/placement-operator/blob/d3a775bb32a963806949acd6556bd43ad901864d/pkg/placement/deployment.go#L41 [3] https://github.com/openstack-k8s-operators/glance-operator/blob/aa9b49b5810f76b4d06061191c5cb297eaa18ba8/pkg/glanceapi/statefulset.go#L62 Signed-off-by: Lucas Alvares Gomes <[email protected]>
1 parent 4f9bd63 commit 63de46c

File tree

3 files changed

+21
-29
lines changed

3 files changed

+21
-29
lines changed

pkg/neutronapi/deployment.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,21 @@ func Deployment(
4141
labels map[string]string,
4242
annotations map[string]string,
4343
) (*appsv1.Deployment, error) {
44+
// TODO(lucasagomes): Look into how to implement separated probes
45+
// for the httpd and neutron-api containers. Right now the code uses
46+
// the same liveness and readiness probes for both containers which
47+
// only checks the port 9696 (NeutronPublicPort) which is the port
48+
// that httpd is listening to. Ideally, we should also include a
49+
// probe on port 9697 which is the port that neutron-api binds to
4450
livenessProbe := &corev1.Probe{
45-
// TODO might need tuning
46-
TimeoutSeconds: 5,
47-
PeriodSeconds: 5,
48-
InitialDelaySeconds: 20,
51+
TimeoutSeconds: 30,
52+
PeriodSeconds: 30,
53+
InitialDelaySeconds: 5,
4954
}
5055
readinessProbe := &corev1.Probe{
51-
// TODO might need tuning
52-
TimeoutSeconds: 5,
53-
PeriodSeconds: 5,
54-
InitialDelaySeconds: 20,
56+
TimeoutSeconds: 30,
57+
PeriodSeconds: 30,
58+
InitialDelaySeconds: 5,
5559
}
5660
args := []string{"-c", ServiceCommand}
5761
httpdArgs := []string{"-DFOREGROUND"}
@@ -148,7 +152,6 @@ func Deployment(
148152
Env: env.MergeEnvs([]corev1.EnvVar{}, envVars),
149153
VolumeMounts: apiVolumeMounts,
150154
Resources: instance.Spec.Resources,
151-
ReadinessProbe: readinessProbe,
152155
LivenessProbe: livenessProbe,
153156
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
154157
},

test/functional/neutronapi_controller_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,6 @@ var _ = Describe("NeutronAPI controller", func() {
861861

862862
nSvcContainer := deployment.Spec.Template.Spec.Containers[0]
863863
Expect(nSvcContainer.LivenessProbe.HTTPGet.Port.IntVal).To(Equal(int32(9696)))
864-
Expect(nSvcContainer.ReadinessProbe.HTTPGet.Port.IntVal).To(Equal(int32(9696)))
865864
Expect(nSvcContainer.VolumeMounts).To(HaveLen(2))
866865
Expect(nSvcContainer.Image).To(Equal(util.GetEnvVar("RELATED_IMAGE_NEUTRON_API_IMAGE_URL_DEFAULT", neutronv1.NeutronAPIContainerImage)))
867866

test/kuttl/common/assert_sample_deployment.yaml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,11 @@ spec:
7676
path: /
7777
port: 9696
7878
scheme: HTTP
79-
initialDelaySeconds: 20
80-
periodSeconds: 5
79+
initialDelaySeconds: 5
80+
periodSeconds: 30
8181
successThreshold: 1
82-
timeoutSeconds: 5
82+
timeoutSeconds: 30
8383
name: neutron-api
84-
readinessProbe:
85-
failureThreshold: 3
86-
httpGet:
87-
path: /
88-
port: 9696
89-
scheme: HTTP
90-
initialDelaySeconds: 20
91-
periodSeconds: 5
92-
successThreshold: 1
93-
timeoutSeconds: 5
9484
resources: {}
9585
securityContext:
9686
runAsUser: 42435
@@ -105,21 +95,21 @@ spec:
10595
path: /
10696
port: 9696
10797
scheme: HTTP
108-
initialDelaySeconds: 20
109-
periodSeconds: 5
98+
initialDelaySeconds: 5
99+
periodSeconds: 30
110100
successThreshold: 1
111-
timeoutSeconds: 5
101+
timeoutSeconds: 30
112102
name: neutron-httpd
113103
readinessProbe:
114104
failureThreshold: 3
115105
httpGet:
116106
path: /
117107
port: 9696
118108
scheme: HTTP
119-
initialDelaySeconds: 20
120-
periodSeconds: 5
109+
initialDelaySeconds: 5
110+
periodSeconds: 30
121111
successThreshold: 1
122-
timeoutSeconds: 5
112+
timeoutSeconds: 30
123113
resources: {}
124114
securityContext:
125115
runAsUser: 0

0 commit comments

Comments
 (0)