Skip to content

Commit e38610b

Browse files
committed
update schema structure based on reviews
1 parent 1b718a5 commit e38610b

File tree

21 files changed

+869
-465
lines changed

21 files changed

+869
-465
lines changed

apis/v1alpha2/nginxproxy_types.go

Lines changed: 21 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -386,80 +386,19 @@ type KubernetesSpec struct {
386386
//
387387
// +optional
388388
Service *ServiceSpec `json:"service,omitempty"`
389-
390-
// ReadinessProbe is the configuration for the NGINX Readiness probe.
391-
//
392-
// +optional
393-
ReadinessProbe *ReadinessProbeSpec `json:"readinessProbe,omitempty"`
394-
}
395-
396-
// ReadinessProbeSpec defines the configuration for the NGINX readiness probe.
397-
type ReadinessProbeSpec struct {
398-
// Port is the port on which the readiness endpoint is exposed.
399-
// If not specified, the default port is 8081.
400-
//
401-
// +optional
402-
// +kubebuilder:default:=8081
403-
// +kubebuilder:validation:Minimum=1
404-
// +kubebuilder:validation:Maximum=65535
405-
Port *int32 `json:"port,omitempty"`
406-
407-
// InitialDelaySeconds is the number of seconds after the container has
408-
// started before the readiness probe is initiated.
409-
// If not specified, the default is 3 seconds.
410-
// +optional
411-
// +kubebuilder:default:=3
412-
// +kubebuilder:validation:Minimum=0
413-
// +kubebuilder:validation:Maximum=3600
414-
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
415-
416-
// PeriodSeconds is the number of seconds between consecutive readiness probes.
417-
// If not specified, the default is 10 seconds.
418-
// +optional
419-
// +kubebuilder:default:=10
420-
// +kubebuilder:validation:Minimum=1
421-
// +kubebuilder:validation:Maximum=3600
422-
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
423-
424-
// TimeoutSeconds is the number of seconds after which the readiness probe times out.
425-
// If not specified, the default is 1 second.
426-
//
427-
// +optional
428-
// +kubebuilder:default:=1
429-
// +kubebuilder:validation:Minimum=1
430-
// +kubebuilder:validation:Maximum=3600
431-
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
432389
}
433390

434391
// Deployment is the configuration for the NGINX Deployment.
435392
type DeploymentSpec struct {
436-
// Number of desired Pods.
437-
//
438-
// +optional
439-
Replicas *int32 `json:"replicas,omitempty"`
440-
441-
// Pod defines Pod-specific fields.
442-
//
443-
// +optional
444-
Pod PodSpec `json:"pod"`
445-
446-
// Container defines container fields for the NGINX container.
447-
//
448-
// +optional
449393
Container ContainerSpec `json:"container"`
394+
Replicas *int32 `json:"replicas,omitempty"`
395+
Pod PodSpec `json:"pod"`
450396
}
451397

452398
// DaemonSet is the configuration for the NGINX DaemonSet.
453399
type DaemonSetSpec struct {
454-
// Pod defines Pod-specific fields.
455-
//
456-
// +optional
457-
Pod PodSpec `json:"pod"`
458-
459-
// Container defines container fields for the NGINX container.
460-
//
461-
// +optional
462400
Container ContainerSpec `json:"container"`
401+
Pod PodSpec `json:"pod"`
463402
}
464403

465404
// PodSpec defines Pod-specific fields.
@@ -507,37 +446,30 @@ type PodSpec struct {
507446

508447
// ContainerSpec defines container fields for the NGINX container.
509448
type ContainerSpec struct {
510-
// Debug enables debugging for NGINX by using the nginx-debug binary.
511-
//
512-
// +optional
513-
Debug *bool `json:"debug,omitempty"`
514-
515-
// Image is the NGINX image to use.
516-
//
517-
// +optional
518-
Image *Image `json:"image,omitempty"`
519-
520-
// Resources describes the compute resource requirements.
521-
//
522-
// +optional
523-
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
524-
525-
// Lifecycle describes actions that the management system should take in response to container lifecycle
526-
// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks
527-
// until the action is complete, unless the container process fails, in which case the handler is aborted.
528-
//
529-
// +optional
530-
Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"`
449+
Debug *bool `json:"debug,omitempty"`
450+
Image *Image `json:"image,omitempty"`
451+
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
452+
Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"`
453+
ReadinessProbe *ReadinessProbeSpec `json:"readinessProbe,omitempty"`
454+
HostPorts []HostPort `json:"hostPorts,omitempty"`
455+
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
456+
}
531457

532-
// HostPorts are the list of ports to expose on the host.
458+
// ReadinessProbeSpec defines the configuration for the NGINX readiness probe.
459+
type ReadinessProbeSpec struct {
460+
// Port is the port on which the readiness endpoint is exposed.
461+
// If not specified, the default port is 8081.
533462
//
534463
// +optional
535-
HostPorts []HostPort `json:"hostPorts,omitempty"`
464+
// +kubebuilder:default:=8081
465+
// +kubebuilder:validation:Minimum=1
466+
// +kubebuilder:validation:Maximum=65535
467+
Port *int32 `json:"port,omitempty"`
536468

537-
// VolumeMounts describe the mounting of Volumes within a container.
469+
// Probe describes the Kubernetes Probe configuration.
538470
//
539471
// +optional
540-
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
472+
*corev1.Probe `json:",inline"`
541473
}
542474

543475
// Image is the NGINX image to use.

apis/v1alpha2/zz_generated.deepcopy.go

Lines changed: 11 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/nginx-gateway-fabric/templates/nginxproxy.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ spec:
4848
{{- if .Values.nginx.debug }}
4949
debug: {{ .Values.nginx.debug }}
5050
{{- end }}
51+
readinessProbe:
52+
port: {{ .Values.nginx.readinessProbe.port | default 8081 }}
5153
{{- end }}
5254
{{- if .Values.nginx.service }}
5355
service:
@@ -58,8 +60,3 @@ spec:
5860
{{- end }}
5961
{{- end }}
6062
{{- end }}
61-
readinessProbe:
62-
port: {{ .Values.nginx.readinessProbe.port | default 8081 }}
63-
initialDelaySeconds: {{ .Values.nginx.readinessProbe.initialDelaySeconds | default 3 }}
64-
periodSeconds: {{ .Values.nginx.readinessProbe.periodSeconds | default 10 }}
65-
timeoutSeconds: {{ .Values.nginx.readinessProbe.timeoutSeconds | default 1 }}

charts/nginx-gateway-fabric/values.yaml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -503,29 +503,7 @@ nginx:
503503
# -- Port in which the readiness endpoint is exposed.
504504
# port: 8081
505505

506-
# @schema
507-
# type: integer
508-
# minimum: 0
509-
# maximum: 3600
510-
# @schema
511-
# -- The number of seconds after the Pod has started before the readiness probes are initiated.
512-
# initialDelaySeconds: 3
513-
514-
# @schema
515-
# type: integer
516-
# minimum: 1
517-
# maximum: 3600
518-
# @schema
519-
# -- The number of seconds between consecutive readiness probes.
520-
# periodSeconds: 10
521-
522-
# @schema
523-
# type: integer
524-
# minimum: 1
525-
# maximum: 3600
526-
# @schema
527-
# -- The number of seconds after which the readiness probe times out.
528-
# timeoutSeconds: 1
506+
# The Kubernetes probe can also be configured by modifying the NginxProxy resource.
529507

530508
# -- Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource.
531509
debug: false

0 commit comments

Comments
 (0)