Skip to content

Commit 8d6ce42

Browse files
Merge pull request #393 from umago/probe-intervals
Tune and enhance neutron-operator probes
2 parents 115b95d + 63de46c commit 8d6ce42

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
@@ -863,7 +863,6 @@ var _ = Describe("NeutronAPI controller", func() {
863863

864864
nSvcContainer := deployment.Spec.Template.Spec.Containers[0]
865865
Expect(nSvcContainer.LivenessProbe.HTTPGet.Port.IntVal).To(Equal(int32(9696)))
866-
Expect(nSvcContainer.ReadinessProbe.HTTPGet.Port.IntVal).To(Equal(int32(9696)))
867866
Expect(nSvcContainer.VolumeMounts).To(HaveLen(2))
868867
Expect(nSvcContainer.Image).To(Equal(util.GetEnvVar("RELATED_IMAGE_NEUTRON_API_IMAGE_URL_DEFAULT", neutronv1.NeutronAPIContainerImage)))
869868

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)