Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit 5df269c

Browse files
committed
Add API Markers
1 parent 4146f4b commit 5df269c

File tree

3 files changed

+295
-0
lines changed

3 files changed

+295
-0
lines changed

Diff for: api/v1alpha1/nginxingresscontroller_types.go

+31
Original file line numberDiff line numberDiff line change
@@ -21,127 +21,157 @@ import (
2121
)
2222

2323
// NginxIngressControllerSpec defines the desired state of NginxIngressController
24+
// +operator-sdk:gen-csv:customresourcedefinitions.resources=`Deployment,v1,"nginx-ingress-operator"`
2425
type NginxIngressControllerSpec struct {
2526
// The type of the Ingress Controller installation - deployment or daemonset.
2627
// +kubebuilder:validation:Enum=deployment;daemonset
28+
// +operator-sdk:csv:customresourcedefinitions:type=spec
2729
Type string `json:"type"`
2830
// Deploys the Ingress Controller for NGINX Plus. The default is false meaning the Ingress Controller will be deployed for NGINX OSS.
2931
// +kubebuilder:validation:Optional
32+
// +operator-sdk:csv:customresourcedefinitions:type=spec
3033
NginxPlus bool `json:"nginxPlus"`
3134
// The image of the Ingress Controller.
35+
// +operator-sdk:csv:customresourcedefinitions:type=spec
3236
Image Image `json:"image"`
3337
// The number of replicas of the Ingress Controller pod. The default is 1. Only applies if the type is set to deployment.
3438
// +kubebuilder:validation:Optional
3539
// +nullable
40+
// +operator-sdk:csv:customresourcedefinitions:type=spec
3641
Replicas *int32 `json:"replicas"`
3742
// The TLS Secret for TLS termination of the default server. The format is namespace/name.
3843
// The secret must be of the type kubernetes.io/tls.
3944
// If not specified, the operator will generate and deploy a TLS Secret with a self-signed certificate and key.
4045
// +kubebuilder:validation:Optional
46+
// +operator-sdk:csv:customresourcedefinitions:type=spec
4147
DefaultSecret string `json:"defaultSecret"`
4248
// The type of the Service for the Ingress Controller. Valid Service types are: NodePort and LoadBalancer.
4349
// +kubebuilder:validation:Enum=NodePort;LoadBalancer
50+
// +operator-sdk:csv:customresourcedefinitions:type=spec
4451
ServiceType string `json:"serviceType"`
4552
// Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). Default is true.
4653
// +kubebuilder:validation:Optional
4754
// +nullable
55+
// +operator-sdk:csv:customresourcedefinitions:type=spec
4856
EnableCRDs *bool `json:"enableCRDs"`
4957
// Enable custom NGINX configuration snippets in VirtualServer, VirtualServerRoute and TransportServer resources.
5058
// Requires enableCRDs set to true.
5159
// +kubebuilder:validation:Optional
60+
// +operator-sdk:csv:customresourcedefinitions:type=spec
5261
EnableSnippets bool `json:"enableSnippets"`
5362
// Enables preview policies.
5463
// Requires enableCRDs set to true.
5564
// +kubebuilder:validation:Optional
65+
// +operator-sdk:csv:customresourcedefinitions:type=spec
5666
EnablePreviewPolicies bool `json:"enablePreviewPolicies"`
5767
// A class of the Ingress controller. The Ingress controller only processes Ingress resources that belong to its
5868
// class (in other words, have the annotation “kubernetes.io/ingress.class”).
5969
// Additionally, the Ingress controller processes Ingress resources that do not have that annotation,
6070
// which can be disabled by setting UseIngressClassOnly to true. Default is `nginx`.
6171
// +kubebuilder:validation:Optional
72+
// +operator-sdk:csv:customresourcedefinitions:type=spec
6273
IngressClass string `json:"ingressClass"`
6374
// The service of the Ingress controller.
6475
// +kubebuilder:validation:Optional
6576
// +nullable
77+
// +operator-sdk:csv:customresourcedefinitions:type=spec
6678
Service *Service `json:"service"`
6779
// Ignore Ingress resources without the “kubernetes.io/ingress.class” annotation.
6880
// +kubebuilder:validation:Optional
81+
// +operator-sdk:csv:customresourcedefinitions:type=spec
6982
UseIngressClassOnly bool `json:"useIngressClassOnly"`
7083
// Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces.
7184
// +kubebuilder:validation:Optional
85+
// +operator-sdk:csv:customresourcedefinitions:type=spec
7286
WatchNamespace string `json:"watchNamespace"`
7387
// Adds a new location to the default server. The location responds with the 200 status code for any request.
7488
// Useful for external health-checking of the Ingress controller.
7589
// +kubebuilder:validation:Optional
7690
// +nullable
91+
// +operator-sdk:csv:customresourcedefinitions:type=spec
7792
HealthStatus *HealthStatus `json:"healthStatus,omitempty"`
7893
// Enable debugging for NGINX. Uses the nginx-debug binary. Requires ‘error-log-level: debug’ in the ConfigMapData.
7994
// +kubebuilder:validation:Optional
95+
// +operator-sdk:csv:customresourcedefinitions:type=spec
8096
NginxDebug bool `json:"nginxDebug"`
8197
// Log level for V logs.
8298
// Format is 0 - 3
8399
// +kubebuilder:validation:Optional
84100
// +kubebuilder:validation:Minimum=0
85101
// +kubebuilder:validation:Maximum=3
102+
// +operator-sdk:csv:customresourcedefinitions:type=spec
86103
LogLevel uint8 `json:"logLevel"`
87104
// NGINX stub_status, or the NGINX Plus API.
88105
// +kubebuilder:validation:Optional
89106
// +nullable
107+
// +operator-sdk:csv:customresourcedefinitions:type=spec
90108
NginxStatus *NginxStatus `json:"nginxStatus,omitempty"`
91109
// Update the address field in the status of Ingresses resources.
92110
// +kubebuilder:validation:Optional
93111
// +nullable
112+
// +operator-sdk:csv:customresourcedefinitions:type=spec
94113
ReportIngressStatus *ReportIngressStatus `json:"reportIngressStatus,omitempty"`
95114
// Enables Leader election to avoid multiple replicas of the controller reporting the status of Ingress resources
96115
// – only one replica will report status.
97116
// Default is true.
98117
// +kubebuilder:validation:Optional
99118
// +nullable
119+
// +operator-sdk:csv:customresourcedefinitions:type=spec
100120
EnableLeaderElection *bool `json:"enableLeaderElection"`
101121
// 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.
102122
// The secret must be of the type kubernetes.io/tls.
103123
// If the argument is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection.
104124
// 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.
105125
// Format is namespace/name.
106126
// +kubebuilder:validation:Optional
127+
// +operator-sdk:csv:customresourcedefinitions:type=spec
107128
WildcardTLS string `json:"wildcardTLS"`
108129
// NGINX or NGINX Plus metrics in the Prometheus format.
109130
// +kubebuilder:validation:Optional
110131
// +nullable
132+
// +operator-sdk:csv:customresourcedefinitions:type=spec
111133
Prometheus *Prometheus `json:"prometheus,omitempty"`
112134
// 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.
113135
// **Note** The metric for the upstream isn't available until traffic is sent to the upstream.
114136
// +kubebuilder:validation:Optional
115137
// +nullable
138+
// +operator-sdk:csv:customresourcedefinitions:type=spec
116139
EnableLatencyMetrics bool `json:"enableLatencyMetrics"`
117140
// Initial values of the Ingress Controller ConfigMap.
118141
// Check https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/configmap-resource/ for
119142
// more information about possible values.
120143
// +kubebuilder:validation:Optional
121144
// +nullable
145+
// +operator-sdk:csv:customresourcedefinitions:type=spec
122146
ConfigMapData map[string]string `json:"configMapData,omitempty"`
123147
// The GlobalConfiguration resource for global configuration of the Ingress Controller.
124148
// Format is namespace/name.
125149
// Requires enableCRDs set to true.
126150
// +kubebuilder:validation:Optional
151+
// +operator-sdk:csv:customresourcedefinitions:type=spec
127152
GlobalConfiguration string `json:"globalConfiguration"`
128153
// Enable TLS Passthrough on port 443.
129154
// Requires enableCRDs set to true.
130155
// +kubebuilder:validation:Optional
156+
// +operator-sdk:csv:customresourcedefinitions:type=spec
131157
EnableTLSPassthrough bool `json:"enableTLSPassthrough"`
132158
// App Protect support configuration.
133159
// Requires enableCRDs set to true.
134160
// +kubebuilder:validation:Optional
135161
// +nullable
162+
// +operator-sdk:csv:customresourcedefinitions:type=spec
136163
AppProtect *AppProtect `json:"appProtect"`
137164
// Timeout in milliseconds which the Ingress Controller will wait for a successful NGINX reload after a change or at the initial start.
138165
// +kubebuilder:validation:Optional
166+
// +operator-sdk:csv:customresourcedefinitions:type=spec
139167
NginxReloadTimeout int `json:"nginxReloadTimeout"`
140168
}
141169

142170
// NginxIngressControllerStatus defines the observed state of NginxIngressController
143171
type NginxIngressControllerStatus struct {
144172
// 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
145175
Deployed bool `json:"deployed"`
146176
}
147177

@@ -218,6 +248,7 @@ type ReportIngressStatus struct {
218248
// Note: If serviceType is LoadBalancer or reportIngressStatus.externalService is set, the value of this field
219249
// will be ignored.
220250
// +kubebuilder:validation:Optional
251+
// +operator-sdk:csv:customresourcedefinitions:type=spec
221252
IngressLink string `json:"ingressLink,omitempty"`
222253
}
223254

Diff for: bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml

+132
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,138 @@ spec:
2929
displayName: Nginx Ingress Controller
3030
kind: NginxIngressController
3131
name: nginxingresscontrollers.k8s.nginx.org
32+
specDescriptors:
33+
- description: App Protect support configuration. Requires enableCRDs set to
34+
true.
35+
displayName: App Protect
36+
path: appProtect
37+
- description: Initial values of the Ingress Controller ConfigMap. Check https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/configmap-resource/
38+
for more information about possible values.
39+
displayName: Config Map Data
40+
path: configMapData
41+
- description: The TLS Secret for TLS termination of the default server. The
42+
format is namespace/name. The secret must be of the type kubernetes.io/tls.
43+
If not specified, the operator will generate and deploy a TLS Secret with
44+
a self-signed certificate and key.
45+
displayName: Default Secret
46+
path: defaultSecret
47+
- description: Enables the use of NGINX Ingress Resource Definitions (VirtualServer
48+
and VirtualServerRoute). Default is true.
49+
displayName: Enable CRDs
50+
path: enableCRDs
51+
- description: Bucketed response times from when NGINX establishes a connection
52+
to an upstream server to when the last byte of the response body is received
53+
by NGINX. **Note** The metric for the upstream isn't available until traffic
54+
is sent to the upstream.
55+
displayName: Enable Latency Metrics
56+
path: enableLatencyMetrics
57+
- description: Enables Leader election to avoid multiple replicas of the controller
58+
reporting the status of Ingress resources – only one replica will report
59+
status. Default is true.
60+
displayName: Enable Leader Election
61+
path: enableLeaderElection
62+
- description: Enables preview policies. Requires enableCRDs set to true.
63+
displayName: Enable Preview Policies
64+
path: enablePreviewPolicies
65+
- description: Enable custom NGINX configuration snippets in VirtualServer,
66+
VirtualServerRoute and TransportServer resources. Requires enableCRDs set
67+
to true.
68+
displayName: Enable Snippets
69+
path: enableSnippets
70+
- description: Enable TLS Passthrough on port 443. Requires enableCRDs set to
71+
true.
72+
displayName: Enable TLSPassthrough
73+
path: enableTLSPassthrough
74+
- description: The GlobalConfiguration resource for global configuration of
75+
the Ingress Controller. Format is namespace/name. Requires enableCRDs set
76+
to true.
77+
displayName: Global Configuration
78+
path: globalConfiguration
79+
- description: Adds a new location to the default server. The location responds
80+
with the 200 status code for any request. Useful for external health-checking
81+
of the Ingress controller.
82+
displayName: Health Status
83+
path: healthStatus
84+
- description: The image of the Ingress Controller.
85+
displayName: Image
86+
path: image
87+
- description: A class of the Ingress controller. The Ingress controller only
88+
processes Ingress resources that belong to its class (in other words, have
89+
the annotation “kubernetes.io/ingress.class”). Additionally, the Ingress
90+
controller processes Ingress resources that do not have that annotation,
91+
which can be disabled by setting UseIngressClassOnly to true. Default is
92+
`nginx`.
93+
displayName: Ingress Class
94+
path: ingressClass
95+
- description: Log level for V logs. Format is 0 - 3
96+
displayName: Log Level
97+
path: logLevel
98+
- description: 'Enable debugging for NGINX. Uses the nginx-debug binary. Requires
99+
‘error-log-level: debug’ in the ConfigMapData.'
100+
displayName: Nginx Debug
101+
path: nginxDebug
102+
- description: Deploys the Ingress Controller for NGINX Plus. The default is
103+
false meaning the Ingress Controller will be deployed for NGINX OSS.
104+
displayName: Nginx Plus
105+
path: nginxPlus
106+
- description: Timeout in milliseconds which the Ingress Controller will wait
107+
for a successful NGINX reload after a change or at the initial start.
108+
displayName: Nginx Reload Timeout
109+
path: nginxReloadTimeout
110+
- description: NGINX stub_status, or the NGINX Plus API.
111+
displayName: Nginx Status
112+
path: nginxStatus
113+
- description: NGINX or NGINX Plus metrics in the Prometheus format.
114+
displayName: Prometheus
115+
path: prometheus
116+
- description: The number of replicas of the Ingress Controller pod. The default
117+
is 1. Only applies if the type is set to deployment.
118+
displayName: Replicas
119+
path: replicas
120+
- description: Update the address field in the status of Ingresses resources.
121+
displayName: Report Ingress Status
122+
path: reportIngressStatus
123+
- description: 'Specifies the name of the IngressLink resource, which exposes
124+
the Ingress Controller pods via a BIG-IP system. The IP of the BIG-IP system
125+
is used when reporting the status of Ingress, VirtualServer and VirtualServerRoute
126+
resources. Requires reportIngressStatus.enable set to true. Note: If serviceType
127+
is LoadBalancer or reportIngressStatus.externalService is set, the value
128+
of this field will be ignored.'
129+
displayName: Ingress Link
130+
path: reportIngressStatus.ingressLink
131+
- description: The service of the Ingress controller.
132+
displayName: Service
133+
path: service
134+
- description: 'The type of the Service for the Ingress Controller. Valid Service
135+
types are: NodePort and LoadBalancer.'
136+
displayName: Service Type
137+
path: serviceType
138+
- description: The type of the Ingress Controller installation - deployment
139+
or daemonset.
140+
displayName: Type
141+
path: type
142+
- description: Ignore Ingress resources without the “kubernetes.io/ingress.class”
143+
annotation.
144+
displayName: Use Ingress Class Only
145+
path: useIngressClassOnly
146+
- description: Namespace to watch for Ingress resources. By default the Ingress
147+
controller watches all namespaces.
148+
displayName: Watch Namespace
149+
path: watchNamespace
150+
- description: A Secret with a TLS certificate and key for TLS termination of
151+
every Ingress host for which TLS termination is enabled but the Secret is
152+
not specified. The secret must be of the type kubernetes.io/tls. If the
153+
argument is not set, for such Ingress hosts NGINX will break any attempt
154+
to establish a TLS connection. If the argument is set, but the Ingress controller
155+
is not able to fetch the Secret from Kubernetes API, the Ingress Controller
156+
will fail to start. Format is namespace/name.
157+
displayName: Wildcard TLS
158+
path: wildcardTLS
159+
statusDescriptors:
160+
- description: Deployed is true if the Operator has finished the deployment
161+
of the NginxIngressController.
162+
displayName: Deployed
163+
path: deployed
32164
version: v1alpha1
33165
description: The NGINX Ingress Operator is a Kubernetes/OpenShift component which
34166
deploys and manages one or more NGINX/NGINX Plus Ingress Controllers

0 commit comments

Comments
 (0)