Skip to content

Commit bfe712d

Browse files
committed
hostPort crds
1 parent ab12cf4 commit bfe712d

File tree

3 files changed

+78
-9
lines changed

3 files changed

+78
-9
lines changed

apis/v1alpha2/nginxproxy_types.go

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,33 @@ type KubernetesSpec struct {
383383

384384
// Deployment is the configuration for the NGINX Deployment.
385385
type DeploymentSpec struct {
386+
// Number of desired Pods.
387+
//
388+
// +optional
389+
Replicas *int32 `json:"replicas,omitempty"`
390+
391+
// Pod defines Pod-specific fields.
392+
//
393+
// +optional
394+
Pod PodSpec `json:"pod"`
395+
396+
// Container defines container fields for the NGINX container.
397+
//
398+
// +optional
386399
Container ContainerSpec `json:"container"`
387-
Replicas *int32 `json:"replicas,omitempty"`
388-
Pod PodSpec `json:"pod"`
389400
}
390401

391402
// DaemonSet is the configuration for the NGINX DaemonSet.
392403
type DaemonSetSpec struct {
404+
// Pod defines Pod-specific fields.
405+
//
406+
// +optional
407+
Pod PodSpec `json:"pod"`
408+
409+
// Container defines container fields for the NGINX container.
410+
//
411+
// +optional
393412
Container ContainerSpec `json:"container"`
394-
Pod PodSpec `json:"pod"`
395413
}
396414

397415
// PodSpec defines Pod-specific fields.
@@ -439,12 +457,37 @@ type PodSpec struct {
439457

440458
// ContainerSpec defines container fields for the NGINX container.
441459
type ContainerSpec struct {
442-
Debug *bool `json:"debug,omitempty"`
443-
Image *Image `json:"image,omitempty"`
444-
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
445-
Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"`
446-
HostPort *HostPort `json:"hostPort,omitempty"`
447-
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
460+
// Debug enables debugging for NGINX by using the nginx-debug binary.
461+
//
462+
// +optional
463+
Debug *bool `json:"debug,omitempty"`
464+
465+
// Image is the NGINX image to use.
466+
//
467+
// +optional
468+
Image *Image `json:"image,omitempty"`
469+
470+
// Resources describes the compute resource requirements.
471+
//
472+
// +optional
473+
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
474+
475+
// Lifecycle describes actions that the management system should take in response to container lifecycle
476+
// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks
477+
// until the action is complete, unless the container process fails, in which case the handler is aborted.
478+
//
479+
// +optional
480+
Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"`
481+
482+
// HostPort configuration
483+
//
484+
// +optional
485+
HostPort *HostPort `json:"hostPort,omitempty"`
486+
487+
// VolumeMounts describe the mounting of Volumes within a container.
488+
//
489+
// +optional
490+
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
448491
}
449492

450493
// Image is the NGINX image to use.

config/crd/bases/gateway.nginx.org_nginxproxies.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,19 @@ spec:
337337
StopSignal can only be set for Pods with a non-empty .spec.os.name
338338
type: string
339339
type: object
340+
hostPort:
341+
description: |-
342+
Number of port to expose on the host.
343+
If specified, this must be a valid port number, 0 < x < 65536.
344+
properties:
345+
enable:
346+
description: |-
347+
Whether to enable hostPort
348+
type: boolean
349+
port:
350+
description: |-
351+
Port number
352+
type: integer
340353
resources:
341354
description: Resources describes the compute resource
342355
requirements.

deploy/crds.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,19 @@ spec:
922922
StopSignal can only be set for Pods with a non-empty .spec.os.name
923923
type: string
924924
type: object
925+
hostPort:
926+
description: |-
927+
Number of port to expose on the host.
928+
If specified, this must be a valid port number, 0 < x < 65536.
929+
properties:
930+
enable:
931+
description: |-
932+
Whether to enable hostPort
933+
type: boolean
934+
port:
935+
description: |-
936+
Port number
937+
type: integer
925938
resources:
926939
description: Resources describes the compute resource
927940
requirements.

0 commit comments

Comments
 (0)