Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podAnnotations don't use quotes, triggering error #6315

Closed
ams0 opened this issue Oct 11, 2020 · 0 comments · Fixed by #6316
Closed

podAnnotations don't use quotes, triggering error #6315

ams0 opened this issue Oct 11, 2020 · 0 comments · Fixed by #6316
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@ams0
Copy link

ams0 commented Oct 11, 2020

NGINX Ingress controller version: v0.40.2

Kubernetes version (use kubectl version): 1.19.0

Environment: AKS

  • Cloud provider or hardware configuration: AKS
  • OS (e.g. from /etc/os-release): Ubuntu 18.04
  • Kernel (e.g. uname -a):
  • Install tools: Helm
  • Others:

What happened:

I want to set podAnnotations to read exactly:

      annotations:
        prometheus.io/path: /metrics
        prometheus.io/port: "10254"
        prometheus.io/scheme: http
        prometheus.io/scrape: "true"

at the command line I use:

--set controller.podAnnotations."prometheus\.io/scrape"=true \
--set controller.podAnnotations."prometheus\.io/port"="10254" \
--set controller.podAnnotations."prometheus\.io/path"="/metrics" \
--set controller.podAnnotations."prometheus\.io/scheme"="http" \

The port numeral is created without quotes, thus triggering kubernetes/kubernetes#82296:

Error: failed to create resource: Deployment in version "v1" cannot be handled as a Deployment: v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.ObjectMeta: v1.ObjectMeta.Annotations: ReadString: expects " or n, but found t, error found in #10 byte of ...|/scrape":true},"labe|..., bigger context ...|heus.io/port":"\"10254\"","prometheus.io/scrape":true},"labels":{"app.kubernetes.io/component":"cont|...

What you expected to happen:

Numerals are created with quotes around them.

How to reproduce it:

Deploy ingress-nginx with this command:

helm upgrade --install --create-namespace \
-n ingress \
--set controller.metrics.enabled=true \
--set controller.metrics.service.type=LoadBalancer \
--set defaultBackend.enabled=true \
--set controller.podAnnotations."prometheus\.io/scrape"=true \
--set controller.podAnnotations."prometheus\.io/port"="10254" \
--set controller.podAnnotations."prometheus\.io/path"="/metrics" \
--set controller.podAnnotations."prometheus\.io/scheme"="http" \
ingress ingress-nginx/ingress-nginx

Anything else we need to know:

I'm submitting a PR to fix the problem.

/kind bug

@ams0 ams0 added the kind/bug Categorizes issue or PR as related to a bug. label Oct 11, 2020
k8s-ci-robot added a commit that referenced this issue Oct 12, 2020
Numerals in podAnnotations in quotes #6315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant