Skip to content
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
1 of 3 tasks
arthurzenika opened this issue May 12, 2023 · 1 comment
Open
1 of 3 tasks

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

arthurzenika opened this issue May 12, 2023 · 1 comment

Comments

@arthurzenika
Copy link

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 ?

@arthurzenika
Copy link
Author

Following a discussion with a colleague that knows a bit more about Kubernetes than me, I think this is a bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant