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

Make enableCRDs optional #70

Merged
merged 3 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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