Skip to content

Garbage Collection deleting Endpoint resources created by Service resource #415

@sazo

Description

@sazo

Describe the bug

Garbage collection is deleting endpoint resources created by service resources. Reading up on https://fluxcd.io/docs/components/kustomize/kustomization/#garbage-collection maybe there is something about the empty kustomize.toolkit.fluxcd.io/checksum on the endpoint resources but it has kustomize.toolkit.fluxcd.io/name and kustomize.toolkit.fluxcd.io/namespace defined. (Just guessing)

Steps to reproduce

No idea. Sorry

Expected behavior

Not deleting endpoints resources created by services resources

Screenshots and recordings

No response

OS / Distro

CentOS 7

Flux version

0.16.2

Flux check

flux check
► checking prerequisites
✔ kubectl 1.19.2 >=1.18.0-0
✔ Kubernetes 1.19.12 >=1.16.0-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.11.2
✔ image-automation-controller: deployment ready
► ghcr.io/fluxcd/image-automation-controller:v0.14.1
✔ image-reflector-controller: deployment ready
► ghcr.io/fluxcd/image-reflector-controller:v0.11.1
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.13.3
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.15.1
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.15.4
✔ all checks passed

Git provider

GitLab

Container Registry provider

Dockerhub

Additional context

kustomization controller log

{"level":"info","ts":"2021-08-25T13:47:24.238Z","logger":"controller.kustomization","msg":"garbage collection completed: Endpoints/production/phpmyadmin deleted\nEndpoints/production/query-exporter deleted\nEndpoints/production/ragnarok deleted\nEndpoints/production/satisfy","reconciler group":"kustomize.toolkit.fluxcd.io","reconciler kind":"Kustomization","name":"flux-system","namespace":"flux-system"}

Endpoints description

k describe endpoints ragnarok phpmyadmin query-exporter satisfy
Name:         ragnarok
Namespace:    production
Labels:       kustomize.toolkit.fluxcd.io/name=flux-system
              kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:  <none>
Subsets:
  Addresses:          10.42.3.57
  NotReadyAddresses:  <none>
  Ports:
    Name     Port  Protocol
    ----     ----  --------
    <unset>  4000  TCP

Events:  <none>


Name:         phpmyadmin
Namespace:    production
Labels:       kustomize.toolkit.fluxcd.io/name=flux-system
              kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:  <none>
Subsets:
  Addresses:          10.42.1.156
  NotReadyAddresses:  <none>
  Ports:
    Name     Port  Protocol
    ----     ----  --------
    <unset>  80    TCP

Events:  <none>


Name:         query-exporter
Namespace:    production
Labels:       kustomize.toolkit.fluxcd.io/name=flux-system
              kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:  <none>
Subsets:
  Addresses:          10.42.2.168
  NotReadyAddresses:  <none>
  Ports:
    Name     Port  Protocol
    ----     ----  --------
    <unset>  9560  TCP

Events:  <none>


Name:         satisfy
Namespace:    production
Labels:       kustomize.toolkit.fluxcd.io/name=flux-system
              kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:  <none>
Subsets:
  Addresses:          10.42.2.178
  NotReadyAddresses:  <none>
  Ports:
    Name     Port  Protocol
    ----     ----  --------
    <unset>  80    TCP

Events:  <none>
k describe svc ragnarok phpmyadmin query-exporter satisfy      
Name:              ragnarok
Namespace:         production
Labels:            kustomize.toolkit.fluxcd.io/name=flux-system
                   kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:       kustomize.toolkit.fluxcd.io/checksum: 9f47ebe6dc2770a522730c5ffdbac9f40d38f201
Selector:          app=ragnarok
Type:              ClusterIP
IP:                10.43.1.75
Port:              <unset>  4000/TCP
TargetPort:        4000/TCP
Endpoints:         10.42.3.57:4000
Session Affinity:  None
Events:            <none>


Name:              phpmyadmin
Namespace:         production
Labels:            kustomize.toolkit.fluxcd.io/name=flux-system
                   kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:       kustomize.toolkit.fluxcd.io/checksum: 9f47ebe6dc2770a522730c5ffdbac9f40d38f201
Selector:          app=phpmyadmin
Type:              ClusterIP
IP:                10.43.180.181
Port:              <unset>  80/TCP
TargetPort:        80/TCP
Endpoints:         10.42.1.156:80
Session Affinity:  None
Events:            <none>


Name:              query-exporter
Namespace:         production
Labels:            kustomize.toolkit.fluxcd.io/name=flux-system
                   kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:       kustomize.toolkit.fluxcd.io/checksum: 9f47ebe6dc2770a522730c5ffdbac9f40d38f201
Selector:          app=query-exporter
Type:              ClusterIP
IP:                10.43.81.119
Port:              <unset>  9560/TCP
TargetPort:        9560/TCP
Endpoints:         10.42.2.168:9560
Session Affinity:  None
Events:            <none>


Name:              satisfy
Namespace:         production
Labels:            kustomize.toolkit.fluxcd.io/name=flux-system
                   kustomize.toolkit.fluxcd.io/namespace=flux-system
Annotations:       kustomize.toolkit.fluxcd.io/checksum: 9f47ebe6dc2770a522730c5ffdbac9f40d38f201
Selector:          app=satisfy
Type:              ClusterIP
IP:                10.43.94.40
Port:              <unset>  80/TCP
TargetPort:        80/TCP
Endpoints:         10.42.2.178:80
Session Affinity:  None
Events:            <none>

Service resources.

apiVersion: v1
kind: Service
metadata:
  name: phpmyadmin
  namespace: production
spec:
  selector:
    app: phpmyadmin
  ports:
  - port: 80
    targetPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: ragnarok
  namespace: production
spec:
  selector:
    app: ragnarok
  ports:
  - port: 4000
    targetPort: 4000
---
apiVersion: v1
kind: Service
metadata:
  name: query-exporter
  namespace: production
spec:
  selector:
    app: query-exporter
  ports:
  - port: 9560
    targetPort: 9560
---
apiVersion: v1
kind: Service
metadata:
  name: satisfy
  namespace: production
spec:
  selector:
    app: satisfy
  ports:
  - port: 80
    targetPort: 80

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions