Azure / Azure/aks-app-routing-operator

strict decoding error: unknown field "spec.defaultSSLCertificate.forceSSLRedirect"

Open
#361 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
40
Forks
31
PR merge metrics
No merged PRs in 30d

Description

According to the [docs ](https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#configuration-of-the-nginx-ingress-controller)I should be able to set the defaultSSLCertificate.forceSSLRedirect settings, but I am prompted with an error:

Error from server `strict decoding error: unknown field "spec.defaultSSLCertificate.forceSSLRedirect"`

The documentation in GitHub already exists the property forceSSLRedirect: https://github.com/Azure/aks-app-routing-operator/blob/main/config/crd/bases/approuting.kubernetes.azure.com_nginxingresscontrollers.yaml#L101

```
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
```
However, when I run the following command it is not showing the property `forceSSLRedirect` :

`kubectl get crd nginxingresscontrollers.approuting.kubernetes.azure.com -o yaml`

**Output:**

```
 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: 1
properties:
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
```

and here is my `NginxIngressController`

```
apiVersion: approuting.kubernetes.azure.com/v1alpha1
kind: NginxIngressController
metadata:
name: nginx-internal-grpc-subnet
spec:
ingressClassName: nginx-internal-grpc-subnet
controllerNamePrefix: nginx-internal-grpc-subnet
loadBalancerAnnotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
service.beta.kubernetes.io/azure-load-balancer-internal-subnet: "subnet-10"
defaultSSLCertificate:
forceSSLRedirect: true
keyVaultURI: "https://lab1-appdep-kv.vault.azure.net/certificates/lab1-app/"
# secret:
# name: "lab1"
# namespace: "app-routing-system"
```

Then, how to fix the CRD in my AKS Cluster?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare config/crd/bases/approuting.kubernetes.azure.com_nginxingresscontrollers.yaml with the CRD returned by kubectl get crd nginxingresscontrollers.approuting.kubernetes.azure.com -o yaml. Trace why the deployed CRD omits defaultSSLCertificate.forceSSLRedirect, then document the supported way to bring the AKS cluster’s CRD in line with the documented schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, go, kubernetes
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.