Kubernetes -'Rejected' annotations.nginx.org/listen-ports

6/8/2021

I got this error in ingress log

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: {{ .Release.Name }}-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.org/listen-ports: "80,[::]:80"
    nginx.org/client-max-body-size: "50m"
    nginx.org/server-snippets: |
      return 301 https://$host$request_uri;
spec:
  rules:
    - host: "myHost"
      http: 
        paths:
          - backend:
              serviceName: {{ .Release.Name }}-service
              servicePort: 80

Service

apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}-service
spec:
  type: NodePort
  selector:
    app: {{ .Release.Name }}
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 8080
    {{- if .Values.debug }}
    - name: debug
      protocol: TCP
      port: 8787
      targetPort: 8787
    - name: admin
      protocol: TCP
      port: 9990
      targetPort: 9990
    {{- end -}}

the error

'Warning' reason: 'Rejected' annotations.nginx.org/listen-ports: Invalid value: "80,[::]:80": must be a comma-separated list of port numbers

note it was working before I just re-install the release again

any hint what happened?

-- Mina Fawzy
kubernetes
nginx

0 Answers