LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
56 stars 6 forks source link

[virtualization][kubernetes_development] Helm set annotations with periods in the key name #577

Open LukeShortCloud opened 2 years ago

LukeShortCloud commented 2 years ago

Quote the string and escape any periods.

Example:

helm template --set "ingress.annotations.cert-manager\.io/cluster-issuer"=self-signed harbor bitnami/harbor

Renders out to be:

kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: self-signed
LukeShortCloud commented 2 years ago

When using a wrong format, this is a common error (error from helm install --set "ingress.annotations.cert-manager.io/cluster-issuer"=self-signed harbor bitnami/harbor):

Error: YAML parse error on harbor/templates/ingress/ingress.yaml: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into Go struct field .metadata.annotations of type string