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

Commit

Permalink
Fix enableCRDs to be optional
Browse files Browse the repository at this point in the history
* Remove enableCRDs from min examples
* Document default value
  • Loading branch information
Dean-Coakley authored Mar 3, 2021
1 parent 13a282e commit 6a83855
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions deploy/crds/k8s.nginx.org_nginxingresscontrollers_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
type: string
enableCRDs:
description: Enables the use of NGINX Ingress Resource Definitions (VirtualServer
and VirtualServerRoute).
and VirtualServerRoute). Default is true.
type: boolean
enableLatencyMetrics:
description: Bucketed response times from when NGINX establishes a connection
Expand Down Expand Up @@ -261,7 +261,6 @@ spec:
API, the Ingress Controller will fail to start. Format is namespace/name.
type: string
required:
- enableCRDs
- image
- serviceType
- type
Expand Down
2 changes: 1 addition & 1 deletion docs/nginx-ingress-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
| `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 |
| `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 |
| `serviceType` | `string` | The type of the Service for the Ingress Controller. Valid Service types are `NodePort` or `LoadBalancer`. | Yes |
| `enableCRDs` | `boolean` | Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). | No |
| `enableCRDs` | `boolean` | Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). Default is `true`. | No |
| `enableSnippets` | `boolean` | Enable custom NGINX configuration snippets in VirtualServer and VirtualServerRoute resources. Requires `enableCRDs` set to `true`. | No |
| `enablePreviewPolicies` | `boolean` | Enables preview policies. Requires `enableCRDs` set to `true`. | No |
| `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 |
Expand Down
1 change: 0 additions & 1 deletion examples/deployment-oss-min/nginx-ingress-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ spec:
pullPolicy: Always
replicas: 1
serviceType: NodePort
enableCRDs: true
1 change: 0 additions & 1 deletion examples/deployment-plus-min/nginx-ingress-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ spec:
pullPolicy: IfNotPresent
replicas: 1
serviceType: NodePort
enableCRDs: true
ingressClass: nginx
3 changes: 2 additions & 1 deletion pkg/apis/k8s/v1alpha1/nginxingresscontroller_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ type NginxIngressControllerSpec struct {
// +kubebuilder:validation:Enum=NodePort;LoadBalancer
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
ServiceType string `json:"serviceType"`
// Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute).
// Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). Default is true.
// +kubebuilder:validation:Optional
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
EnableCRDs bool `json:"enableCRDs"`
// Enable custom NGINX configuration snippets in VirtualServer and VirtualServerRoute resources.
Expand Down

0 comments on commit 6a83855

Please sign in to comment.