@@ -41,12 +41,12 @@ 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
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
5050 livenessProbe := & corev1.Probe {
5151 TimeoutSeconds : 30 ,
5252 PeriodSeconds : 30 ,
@@ -56,8 +56,14 @@ func Deployment(
5656 TimeoutSeconds : 30 ,
5757 PeriodSeconds : 30 ,
5858 InitialDelaySeconds : 5 ,
59+ Exec : & corev1.ExecAction {
60+ Command : []string {
61+ "cat" ,
62+ "/etc/pki/tls/certs/internal.crt" ,
63+ },
64+ },
5965 }
60- args := []string {"-c" , ServiceCommand }
66+ args := []string {"-c" , ServiceCommand }
6167 httpdArgs := []string {"-DFOREGROUND" }
6268
6369 //
@@ -71,7 +77,7 @@ func Deployment(
7177 Path : "/" ,
7278 Port : intstr.IntOrString {Type : intstr .Int , IntVal : int32 (NeutronPublicPort )},
7379 }
74-
80+ // Use HTTPS if TLS is enabled
7581 if instance .Spec .TLS .API .Enabled (service .EndpointPublic ) {
7682 livenessProbe .HTTPGet .Scheme = corev1 .URISchemeHTTPS
7783 readinessProbe .HTTPGet .Scheme = corev1 .URISchemeHTTPS
@@ -93,6 +99,7 @@ func Deployment(
9399 httpdVolumeMounts = append (httpdVolumeMounts , instance .Spec .TLS .CreateVolumeMounts (nil )... )
94100 }
95101
102+ // handle TLS certificates for HTTPD
96103 for _ , endpt := range []service.Endpoint {service .EndpointInternal , service .EndpointPublic } {
97104 if instance .Spec .TLS .API .Enabled (endpt ) {
98105 var tlsEndptCfg tls.GenericService
@@ -134,8 +141,7 @@ func Deployment(
134141 Selector : & metav1.LabelSelector {
135142 MatchLabels : labels ,
136143 },
137- PodManagementPolicy : appsv1 .ParallelPodManagement ,
138- Replicas : instance .Spec .Replicas ,
144+ Replicas : instance .Spec .Replicas ,
139145 Template : corev1.PodTemplateSpec {
140146 ObjectMeta : metav1.ObjectMeta {
141147 Annotations : annotations ,
@@ -154,6 +160,7 @@ func Deployment(
154160 VolumeMounts : apiVolumeMounts ,
155161 Resources : instance .Spec .Resources ,
156162 LivenessProbe : livenessProbe ,
163+ ReadinessProbe : readinessProbe ,
157164 TerminationMessagePolicy : corev1 .TerminationMessageFallbackToLogsOnError ,
158165 },
159166 {
@@ -175,14 +182,13 @@ func Deployment(
175182 },
176183 },
177184 }
178-
179- // If possible two pods of the same service should not
180- // run on the same worker node. If this is not possible
181- // the get still created on the same worker node.
185+ // If possible two pods of the same service should not
186+ // run on the same worker node. If this is not possible
187+ // the get still created on the same worker node.
182188 deployment .Spec .Template .Spec .Affinity = affinity .DistributePods (
183189 common .AppSelector ,
184190 []string {
185- ServiceName ,
191+ ServiceName ,
186192 },
187193 corev1 .LabelHostname ,
188194 )
0 commit comments