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

Secrets used by Ingress not detected as in use #118

Open
lee-harmonic opened this issue Feb 26, 2021 · 0 comments
Open

Secrets used by Ingress not detected as in use #118

lee-harmonic opened this issue Feb 26, 2021 · 0 comments

Comments

@lee-harmonic
Copy link

Ingress resources can use secrets to store TLS certificates, such as those managed by Cert Manager. Kubectl-reap currently detects these secrets are not in use and suggests removing them.

Eg

$ kubectl get secret
NAME                              TYPE                                  DATA   AGE
default-token-ggbbh               kubernetes.io/service-account-token   3      521d
review-41-enquiry-4r57wt-secret   Opaque                                3      10d
review-41-enquiry-4r57wt-tls      kubernetes.io/tls                     3      10d

#The review-41-enquiry-4r57wt-secret is used by a pod

$ kubectl reap secret --dry-run=client
secret/review-41-enquiry-4r57wt-tls deleted (dry run)

$ kubectl get ingress review-41-enquiry-4r57wt -o yaml 
#partly redacted
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: "true"
spec:
  rules:
  - host: 41-enquiry.example.com
    http:
      paths:
      - backend:
          service:
            name: review-41-enquiry-4r57wt
            port:
              number: 8000
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - 41-enquiry.example.com
    secretName: review-41-enquiry-4r57wt-tls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant