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

Commit 6a83855

Browse files
authored
Fix enableCRDs to be optional
* Remove enableCRDs from min examples * Document default value
1 parent 13a282e commit 6a83855

File tree

5 files changed

+4
-6
lines changed

5 files changed

+4
-6
lines changed

deploy/crds/k8s.nginx.org_nginxingresscontrollers_crd.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
type: string
6060
enableCRDs:
6161
description: Enables the use of NGINX Ingress Resource Definitions (VirtualServer
62-
and VirtualServerRoute).
62+
and VirtualServerRoute). Default is true.
6363
type: boolean
6464
enableLatencyMetrics:
6565
description: Bucketed response times from when NGINX establishes a connection
@@ -261,7 +261,6 @@ spec:
261261
API, the Ingress Controller will fail to start. Format is namespace/name.
262262
type: string
263263
required:
264-
- enableCRDs
265264
- image
266265
- serviceType
267266
- type

docs/nginx-ingress-controller.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ spec:
8383
| `replicas` | `int` | The number of replicas of the Ingress Controller pod. The default is 1. Only applies if the `type` is set to deployment. | No |
8484
| `defaultSecret` | `string` | The TLS Secret for TLS termination of the default server. The format is namespace/name. The secret must be of the type kubernetes.io/tls. If not specified, the operator will generate and deploy a TLS Secret with a self-signed certificate and key. | No |
8585
| `serviceType` | `string` | The type of the Service for the Ingress Controller. Valid Service types are `NodePort` or `LoadBalancer`. | Yes |
86-
| `enableCRDs` | `boolean` | Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). | No |
86+
| `enableCRDs` | `boolean` | Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). Default is `true`. | No |
8787
| `enableSnippets` | `boolean` | Enable custom NGINX configuration snippets in VirtualServer and VirtualServerRoute resources. Requires `enableCRDs` set to `true`. | No |
8888
| `enablePreviewPolicies` | `boolean` | Enables preview policies. Requires `enableCRDs` set to `true`. | No |
8989
| `ingressClass` | `string` | A class of the Ingress controller. For Kubernetes >= 1.18, the Ingress controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. Additionally the Ingress Controller processes all the VirtualServer/VirtualServerRoute resources that do not have the "ingressClassName" field. For Kubernetes < 1.18, the Ingress Controller only processes resources that belong to its class - i.e have the annotation "kubernetes.io/ingress.class" (for Ingress resources) or field "ingressClassName" (for VirtualServer/VirtualServerRoute resources) equal to the class. Additionally, the Ingress Controller processes resources that do not have the class set, which can be disabled by setting `useIngressClassOnly` to `true`. Default is `nginx`. | No |

examples/deployment-oss-min/nginx-ingress-controller.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ spec:
1212
pullPolicy: Always
1313
replicas: 1
1414
serviceType: NodePort
15-
enableCRDs: true

examples/deployment-plus-min/nginx-ingress-controller.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ spec:
1212
pullPolicy: IfNotPresent
1313
replicas: 1
1414
serviceType: NodePort
15-
enableCRDs: true
1615
ingressClass: nginx

pkg/apis/k8s/v1alpha1/nginxingresscontroller_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ type NginxIngressControllerSpec struct {
3232
// +kubebuilder:validation:Enum=NodePort;LoadBalancer
3333
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
3434
ServiceType string `json:"serviceType"`
35-
// Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute).
35+
// Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). Default is true.
36+
// +kubebuilder:validation:Optional
3637
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
3738
EnableCRDs bool `json:"enableCRDs"`
3839
// Enable custom NGINX configuration snippets in VirtualServer and VirtualServerRoute resources.

0 commit comments

Comments
 (0)