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

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

Open
@arthurzenika

Description

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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