---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.2
  name: nginxingresscontrollers.approuting.kubernetes.azure.com
spec:
  group: approuting.kubernetes.azure.com
  names:
    kind: NginxIngressController
    listKind: NginxIngressControllerList
    plural: nginxingresscontrollers
    shortNames:
    - nic
    singular: nginxingresscontroller
  scope: Cluster
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.ingressClassName
      name: IngressClass
      type: string
    - jsonPath: .spec.controllerNamePrefix
      name: ControllerNamePrefix
      type: string
    - jsonPath: .status.conditions[?(@.type=="Available")].status
      name: Available
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: NginxIngressController is the Schema for the nginxingresscontrollers
          API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            default:
              controllerNamePrefix: nginx
              ingressClassName: nginx.approuting.kubernetes.azure.com
            description: NginxIngressControllerSpec defines the desired state of NginxIngressController
            properties:
              controllerNamePrefix:
                default: nginx
                description: ControllerNamePrefix is the name to use for the managed
                  NGINX Ingress Controller resources.
                maxLength: 60
                minLength: 1
                pattern: ^[a-z0-9][-a-z0-9]*[a-z0-9]$
                type: string
                x-kubernetes-validations:
                - message: Value is immutable
                  rule: self == oldSelf
              customHTTPErrors:
                description: CustomHTTPErrors defines the error codes that the NginxIngressController
                  should send to its default-backend in case of error.
                items:
                  format: int32
                  type: integer
                type: array
              defaultBackendService:
                description: |-
                  DefaultBackendService defines the service that the NginxIngressController should default to when given HTTP traffic with not matching known server names.
                  The controller directs traffic to the first port of the service.
                properties:
                  name:
                    maxLength: 253
                    minLength: 1
                    pattern: ^[a-z0-9][-a-z0-9\.]*[a-z0-9]$
                    type: string
                  namespace:
                    maxLength: 253
                    minLength: 1
                    pattern: ^[a-z0-9][-a-z0-9\.]*[a-z0-9]$
                    type: string
                required:
                - name
                - namespace
                type: object
              defaultSSLCertificate:
                description: |-
                  DefaultSSLCertificate defines whether the NginxIngressController should use a certain SSL certificate by default.
                  If this field is omitted, no default certificate will be used.
                maxProperties: 2
                properties:
                  forceSSLRedirect:
                    default: false
                    description: ForceSSLRedirect is a flag that sets the global value
                      of redirects to HTTPS if there is a defined DefaultSSLCertificate
                    type: boolean
                  keyVaultURI:
                    description: Secret in the form of a Key Vault URI
                    type: string
                  secret:
                    description: Secret is a struct that holds the name and namespace
                      fields used for the default ssl secret
                    properties:
                      name:
                        maxLength: 253
                        minLength: 1
                        pattern: ^[a-z0-9][-a-z0-9\.]*[a-z0-9]$
                        type: string
                      namespace:
                        maxLength: 253
                        minLength: 1
                        pattern: ^[a-z0-9][-a-z0-9\.]*[a-z0-9]$
                        type: string
                    required:
                    - name
                    - namespace
                    type: object
                type: object
                x-kubernetes-validations:
                - rule: (isURL(self.keyVaultURI) || !has(self.keyVaultURI))
                - rule: ((self.forceSSLRedirect == true) && (has(self.secret) || has(self.keyVaultURI))
                    || (self.forceSSLRedirect == false))
              httpDisabled:
                description: HTTPDisabled is a flag that disables HTTP traffic to
                  the NginxIngressController
                type: boolean
              ingressClassName:
                default: nginx.approuting.kubernetes.azure.com
                description: |-
                  IngressClassName is the name of the IngressClass that will be used for the NGINX Ingress Controller. Defaults to metadata.name if
                  not specified.
                maxLength: 253
                minLength: 1
                pattern: ^[a-z0-9][-a-z0-9\.]*[a-z0-9]$
                type: string
                x-kubernetes-validations:
                - message: Value is immutable
                  rule: self == oldSelf
              loadBalancerAnnotations:
                additionalProperties:
                  type: string
                description: |-
                  LoadBalancerAnnotations is a map of annotations to apply to the NGINX Ingress Controller's Service. Common annotations
                  will be from the Azure LoadBalancer annotations here https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#loadbalancer-annotations
                type: object
              scaling:
                description: Scaling defines configuration options for how the Ingress
                  Controller scales
                properties:
                  maxReplicas:
                    description: MaxReplicas is the upper limit for the number of
                      Ingress Controller replicas. It defaults to 100 pods.
                    format: int32
                    minimum: 1
                    type: integer
                  minReplicas:
                    description: MinReplicas is the lower limit for the number of
                      Ingress Controller replicas. It defaults to 2 pods.
                    format: int32
                    minimum: 1
                    type: integer
                  threshold:
                    description: |-
                      Threshold defines how quickly the Ingress Controller pods should scale based on workload. Rapid means the Ingress Controller
                      will scale quickly and aggressively, which is the best choice for handling sudden and significant traffic spikes. Steady
                      is the opposite, prioritizing cost-effectiveness. Steady is the best choice when fewer replicas handling more work is desired or when
                      traffic isn't expected to fluctuate. Balanced is a good mix between the two that works for most use-cases. If unspecified, this field
                      defaults to balanced.
                    enum:
                    - rapid
                    - balanced
                    - steady
                    type: string
                type: object
                x-kubernetes-validations:
                - rule: (!has(self.minReplicas)) || (!has(self.maxReplicas)) || (self.minReplicas
                    <= self.maxReplicas)
            required:
            - controllerNamePrefix
            - ingressClassName
            type: object
          status:
            description: NginxIngressControllerStatus defines the observed state of
              NginxIngressController
            properties:
              collisionCount:
                description: |-
                  Count of hash collisions for the managed resources. The App Routing Operator uses this field
                  as a collision avoidance mechanism when it needs to create the name for the managed resources.
                format: int32
                maximum: 5
                type: integer
              conditions:
                description: Conditions is an array of current observed conditions
                  for the NGINX Ingress Controller
                items:
                  description: Condition contains details for one aspect of the current
                    state of this API Resource.
                  properties:
                    lastTransitionTime:
                      description: |-
                        lastTransitionTime is the last time the condition transitioned from one status to another.
                        This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.
                      format: date-time
                      type: string
                    message:
                      description: |-
                        message is a human readable message indicating details about the transition.
                        This may be an empty string.
                      maxLength: 32768
                      type: string
                    observedGeneration:
                      description: |-
                        observedGeneration represents the .metadata.generation that the condition was set based upon.
                        For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
                        with respect to the current state of the instance.
                      format: int64
                      minimum: 0
                      type: integer
                    reason:
                      description: |-
                        reason contains a programmatic identifier indicating the reason for the condition's last transition.
                        Producers of specific condition types may define expected values and meanings for this field,
                        and whether the values are considered a guaranteed API.
                        The value should be a CamelCase string.
                        This field may not be empty.
                      maxLength: 1024
                      minLength: 1
                      pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
                      type: string
                    status:
                      description: status of the condition, one of True, False, Unknown.
                      enum:
                      - "True"
                      - "False"
                      - Unknown
                      type: string
                    type:
                      description: type of condition in CamelCase or in foo.example.com/CamelCase.
                      maxLength: 316
                      pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
                      type: string
                  required:
                  - lastTransitionTime
                  - message
                  - reason
                  - status
                  - type
                  type: object
                type: array
                x-kubernetes-list-map-keys:
                - type
                x-kubernetes-list-type: map
              controllerAvailableReplicas:
                description: ControllerAvailableReplicas is the number of available
                  replicas of the NGINX Ingress Controller deployment
                format: int32
                type: integer
              controllerReadyReplicas:
                description: ControllerReadyReplicas is the number of ready replicas
                  of the NGINX Ingress Controller deployment
                format: int32
                type: integer
              controllerReplicas:
                description: ControllerReplicas is the desired number of replicas
                  of the NGINX Ingress Controller
                format: int32
                type: integer
              controllerUnavailableReplicas:
                description: ControllerUnavailableReplicas is the number of unavailable
                  replicas of the NGINX Ingress Controller deployment
                format: int32
                type: integer
              managedResourceRefs:
                description: ManagedResourceRefs is a list of references to the managed
                  resources
                items:
                  description: ManagedObjectReference is a reference to an object
                  properties:
                    apiGroup:
                      description: APIGroup is the API group of the managed object.
                        If not specified, the resource is in the core API group
                      type: string
                    kind:
                      description: Kind is the kind of the managed object
                      type: string
                    name:
                      description: Name is the name of the managed object
                      type: string
                    namespace:
                      description: Namespace is the namespace of the managed object.
                        If not specified, the resource is cluster-scoped
                      type: string
                  required:
                  - kind
                  - name
                  type: object
                type: array
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
    subresources:
      status: {}
