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

Commit 542e296

Browse files
authored
Make spec.Prometheus.secret field optional (#133)
- Make the spec.Prometheus.secret optional so that Prometheus endpoint can be enabled without specifying a Secret. - Extend the doc for the field.
1 parent fba21a8 commit 542e296

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

api/v1alpha1/nginxingresscontroller_types.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ type Prometheus struct {
263263
// +kubebuilder:validation:Optional
264264
// +nullable
265265
Port *uint16 `json:"port"`
266-
// Specifies an TLS Secret in the format namespace/name to use to secure the Prometheus endpoint.
266+
// A Secret with a TLS certificate and key for TLS termination of the Prometheus endpoint.
267+
// The secret must be of the type kubernetes.io/tls.
268+
// If specified, but the Ingress controller is not able to fetch the Secret from Kubernetes API,
269+
// the Ingress Controller will fail to start.
270+
// Format is namespace/name.
271+
// +kubebuilder:validation:Optional
267272
Secret string `json:"secret"`
268273
}
269274

config/crd/bases/k8s.nginx.org_nginxingresscontrollers.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,14 @@ spec:
198198
nullable: true
199199
type: integer
200200
secret:
201-
description: Specifies an TLS Secret in the format namespace/name
202-
to use to secure the Prometheus endpoint.
201+
description: A Secret with a TLS certificate and key for TLS termination
202+
of the Prometheus endpoint. The secret must be of the type kubernetes.io/tls.
203+
If specified, but the Ingress controller is not able to fetch
204+
the Secret from Kubernetes API, the Ingress Controller will
205+
fail to start. Format is namespace/name.
203206
type: string
204207
required:
205208
- enable
206-
- secret
207209
type: object
208210
replicas:
209211
description: The number of replicas of the Ingress Controller pod.

docs/nginx-ingress-controller.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ spec:
148148
| --- | --- | --- | --- |
149149
| `enable` | `boolean` | Enable Prometheus metrics. | Yes |
150150
| `port` | `int` | Sets the port where the Prometheus metrics are exposed. Default is 9113. Format is `1023 - 65535`. | No |
151-
| `secret` | `string` | Sets the namespace/name of a TLS Secret Resource to use to enable TLS for the Prometheus endpoint. | No |
151+
| `secret` | `string` | A Secret with a TLS certificate and key for TLS termination of the Prometheus endpoint. The secret must be of the type kubernetes.io/tls. If specified, but the Ingress controller is not able to fetch the Secret from Kubernetes API, the Ingress Controller will fail to start. Format is namespace/name. | No |
152152
| `enableLatencyMetrics` | `boolean` | 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. **Note** The metric for the upstream isn't available until traffic is sent to the upstream. Requires prometheus set to true | No |
153153

154154
## NginxIngressController.AppProtect

0 commit comments

Comments
 (0)