Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

kubeaudit autofix add targetPort: 0 on a Service object #555

@arthurzenika

Description

@arthurzenika
ISSUE TYPE
  • Bug Report
  • Feature Idea
  • Question (not sure it's a bug so far)

BUG REPORT

SUMMARY

For a kind: Service kubeaudit autofix add a targetPort: 0 which I don't understand, and I can't find any documentation on why this is a recommended change.

--- a/tomcat-service.yaml
+++ b/tomcat-service.yaml
@@ -8,7 +8,10 @@ spec:
   ports:
     - name: http
       port: 8080
+      targetPort: 0
     - name: jmx
       port: 1089
+      targetPort: 0
   selector:
     name: tomcat
ENVIRONMENT
  • Kubeaudit version: 0.22.0
  • Kubeaudit install method: Binary
STEPS TO REPRODUCE

launch kubeaudit autofix on

---
apiVersion: v1
kind: Service
metadata:
  name: tomcat
spec:
  ports:
    - name: http
      port: 8080
    - name: jmx
      port: 1089
  selector:
    name: tomcat
EXPECTED RESULTS

If there is a valid reason for this, maybe a comment could be added to the yaml ? Or some documentation in the kubeaudit project ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions