(auto-) certificates and the pitfalls of .this#
nplus will automatically generate certificates for your ingress. It either uses an issuer like cert-manager or generates a self-signed-certificate.
In your production environment though, you might want to take more control over the certificate generation process and don’t leave it to nplus to automatically take care of it. In that case, you want to switch the automation off.
To do so, you need to understand what is happening internally:
- if
.this.ingress.issueris set, the chart requests this issuer to generate a tls secret with the name.this.ingress.secret
by creating a certificate resource with the name of the domain.this.ingress.domain - else, so no issuer is set, the chart checks wether the flag
.this.ingress.createSelfSignedCertificateis set totrueand generates a tls secret with the name.this.ingress.secret - else, so neither issuer nor createSelfSignedCertificate are set, the charts will not generate anything
The way how .this works is, that it gathers the keys from the component (.Values), the instance (.Values.global) and
the environment (.Values.global.environment) and merges them into .this, so that you can set your values on different levels.
The first level that sets a key wins.
However, the merge only fills in what is still empty: an empty or null value on one level does not cancel a value
from another level, it just lets the next level speak. If your environment sets an issuer, global.ingress.issuer: ""
in your instance values changes nothing, the issuer of the environment is used. To cancel a value, there is a last merge
that forcefully overwrites existing keys: override. It can be set on environment, global or on the component level.
So the correct way to cancel the generation process is to override the issuer with an empty string (which cancels the
cert-manager generation) and also force createSelfSignedCertificate to false (which cancels the self-signed-certificate
generation):
global:
override:
ingress:
enabled: true
secret: myCertificate
issuer: ""
createSelfSignedCertificate: falseThis makes sure, you will get an ingress, that uses the tls certificate in the secret myCertificate for encryption and does
not generate anything. Set it under global.override, so it applies to the instance and to every component: components such as
the nplus Remote Management Server or the nscale AI chat render a certificate of their own. An override at the top level
of the instance values only applies to the instance chart itself.
You find these values in values.yaml of this sample.
Files#
Download all files of this sample
values.yaml#
global:
override:
ingress:
enabled: true
secret: mySecret
issuer: ""
createSelfSignedCertificate: false