@@ -21,127 +21,157 @@ import (
21
21
)
22
22
23
23
// NginxIngressControllerSpec defines the desired state of NginxIngressController
24
+ // +operator-sdk:gen-csv:customresourcedefinitions.resources=`Deployment,v1,"nginx-ingress-operator"`
24
25
type NginxIngressControllerSpec struct {
25
26
// The type of the Ingress Controller installation - deployment or daemonset.
26
27
// +kubebuilder:validation:Enum=deployment;daemonset
28
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
27
29
Type string `json:"type"`
28
30
// Deploys the Ingress Controller for NGINX Plus. The default is false meaning the Ingress Controller will be deployed for NGINX OSS.
29
31
// +kubebuilder:validation:Optional
32
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
30
33
NginxPlus bool `json:"nginxPlus"`
31
34
// The image of the Ingress Controller.
35
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
32
36
Image Image `json:"image"`
33
37
// The number of replicas of the Ingress Controller pod. The default is 1. Only applies if the type is set to deployment.
34
38
// +kubebuilder:validation:Optional
35
39
// +nullable
40
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
36
41
Replicas * int32 `json:"replicas"`
37
42
// The TLS Secret for TLS termination of the default server. The format is namespace/name.
38
43
// The secret must be of the type kubernetes.io/tls.
39
44
// If not specified, the operator will generate and deploy a TLS Secret with a self-signed certificate and key.
40
45
// +kubebuilder:validation:Optional
46
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
41
47
DefaultSecret string `json:"defaultSecret"`
42
48
// The type of the Service for the Ingress Controller. Valid Service types are: NodePort and LoadBalancer.
43
49
// +kubebuilder:validation:Enum=NodePort;LoadBalancer
50
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
44
51
ServiceType string `json:"serviceType"`
45
52
// Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). Default is true.
46
53
// +kubebuilder:validation:Optional
47
54
// +nullable
55
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
48
56
EnableCRDs * bool `json:"enableCRDs"`
49
57
// Enable custom NGINX configuration snippets in VirtualServer, VirtualServerRoute and TransportServer resources.
50
58
// Requires enableCRDs set to true.
51
59
// +kubebuilder:validation:Optional
60
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
52
61
EnableSnippets bool `json:"enableSnippets"`
53
62
// Enables preview policies.
54
63
// Requires enableCRDs set to true.
55
64
// +kubebuilder:validation:Optional
65
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
56
66
EnablePreviewPolicies bool `json:"enablePreviewPolicies"`
57
67
// A class of the Ingress controller. The Ingress controller only processes Ingress resources that belong to its
58
68
// class (in other words, have the annotation “kubernetes.io/ingress.class”).
59
69
// Additionally, the Ingress controller processes Ingress resources that do not have that annotation,
60
70
// which can be disabled by setting UseIngressClassOnly to true. Default is `nginx`.
61
71
// +kubebuilder:validation:Optional
72
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
62
73
IngressClass string `json:"ingressClass"`
63
74
// The service of the Ingress controller.
64
75
// +kubebuilder:validation:Optional
65
76
// +nullable
77
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
66
78
Service * Service `json:"service"`
67
79
// Ignore Ingress resources without the “kubernetes.io/ingress.class” annotation.
68
80
// +kubebuilder:validation:Optional
81
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
69
82
UseIngressClassOnly bool `json:"useIngressClassOnly"`
70
83
// Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces.
71
84
// +kubebuilder:validation:Optional
85
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
72
86
WatchNamespace string `json:"watchNamespace"`
73
87
// Adds a new location to the default server. The location responds with the 200 status code for any request.
74
88
// Useful for external health-checking of the Ingress controller.
75
89
// +kubebuilder:validation:Optional
76
90
// +nullable
91
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
77
92
HealthStatus * HealthStatus `json:"healthStatus,omitempty"`
78
93
// Enable debugging for NGINX. Uses the nginx-debug binary. Requires ‘error-log-level: debug’ in the ConfigMapData.
79
94
// +kubebuilder:validation:Optional
95
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
80
96
NginxDebug bool `json:"nginxDebug"`
81
97
// Log level for V logs.
82
98
// Format is 0 - 3
83
99
// +kubebuilder:validation:Optional
84
100
// +kubebuilder:validation:Minimum=0
85
101
// +kubebuilder:validation:Maximum=3
102
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
86
103
LogLevel uint8 `json:"logLevel"`
87
104
// NGINX stub_status, or the NGINX Plus API.
88
105
// +kubebuilder:validation:Optional
89
106
// +nullable
107
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
90
108
NginxStatus * NginxStatus `json:"nginxStatus,omitempty"`
91
109
// Update the address field in the status of Ingresses resources.
92
110
// +kubebuilder:validation:Optional
93
111
// +nullable
112
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
94
113
ReportIngressStatus * ReportIngressStatus `json:"reportIngressStatus,omitempty"`
95
114
// Enables Leader election to avoid multiple replicas of the controller reporting the status of Ingress resources
96
115
// – only one replica will report status.
97
116
// Default is true.
98
117
// +kubebuilder:validation:Optional
99
118
// +nullable
119
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
100
120
EnableLeaderElection * bool `json:"enableLeaderElection"`
101
121
// A Secret with a TLS certificate and key for TLS termination of every Ingress host for which TLS termination is enabled but the Secret is not specified.
102
122
// The secret must be of the type kubernetes.io/tls.
103
123
// If the argument is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection.
104
124
// If the argument is set, but the Ingress controller is not able to fetch the Secret from Kubernetes API, the Ingress Controller will fail to start.
105
125
// Format is namespace/name.
106
126
// +kubebuilder:validation:Optional
127
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
107
128
WildcardTLS string `json:"wildcardTLS"`
108
129
// NGINX or NGINX Plus metrics in the Prometheus format.
109
130
// +kubebuilder:validation:Optional
110
131
// +nullable
132
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
111
133
Prometheus * Prometheus `json:"prometheus,omitempty"`
112
134
// Bucketed response times from when NGINX establishes a connection to an upstream server to when the last byte of the response body is received by NGINX.
113
135
// **Note** The metric for the upstream isn't available until traffic is sent to the upstream.
114
136
// +kubebuilder:validation:Optional
115
137
// +nullable
138
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
116
139
EnableLatencyMetrics bool `json:"enableLatencyMetrics"`
117
140
// Initial values of the Ingress Controller ConfigMap.
118
141
// Check https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/configmap-resource/ for
119
142
// more information about possible values.
120
143
// +kubebuilder:validation:Optional
121
144
// +nullable
145
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
122
146
ConfigMapData map [string ]string `json:"configMapData,omitempty"`
123
147
// The GlobalConfiguration resource for global configuration of the Ingress Controller.
124
148
// Format is namespace/name.
125
149
// Requires enableCRDs set to true.
126
150
// +kubebuilder:validation:Optional
151
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
127
152
GlobalConfiguration string `json:"globalConfiguration"`
128
153
// Enable TLS Passthrough on port 443.
129
154
// Requires enableCRDs set to true.
130
155
// +kubebuilder:validation:Optional
156
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
131
157
EnableTLSPassthrough bool `json:"enableTLSPassthrough"`
132
158
// App Protect support configuration.
133
159
// Requires enableCRDs set to true.
134
160
// +kubebuilder:validation:Optional
135
161
// +nullable
162
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
136
163
AppProtect * AppProtect `json:"appProtect"`
137
164
// Timeout in milliseconds which the Ingress Controller will wait for a successful NGINX reload after a change or at the initial start.
138
165
// +kubebuilder:validation:Optional
166
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
139
167
NginxReloadTimeout int `json:"nginxReloadTimeout"`
140
168
}
141
169
142
170
// NginxIngressControllerStatus defines the observed state of NginxIngressController
143
171
type NginxIngressControllerStatus struct {
144
172
// Deployed is true if the Operator has finished the deployment of the NginxIngressController.
173
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
174
+ // +operator-sdk:csv:customresourcedefinitions:type=status
145
175
Deployed bool `json:"deployed"`
146
176
}
147
177
@@ -218,6 +248,7 @@ type ReportIngressStatus struct {
218
248
// Note: If serviceType is LoadBalancer or reportIngressStatus.externalService is set, the value of this field
219
249
// will be ignored.
220
250
// +kubebuilder:validation:Optional
251
+ // +operator-sdk:csv:customresourcedefinitions:type=spec
221
252
IngressLink string `json:"ingressLink,omitempty"`
222
253
}
223
254
0 commit comments