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

Garbage Collection deleting Endpoint resources created by Service resource #415

Closed
1 task done
sazo opened this issue Aug 25, 2021 · 3 comments · Fixed by #411
Closed
1 task done

Garbage Collection deleting Endpoint resources created by Service resource #415

sazo opened this issue Aug 25, 2021 · 3 comments · Fixed by #411
Labels
bug Something isn't working

Comments

@sazo
Copy link

sazo commented Aug 25, 2021

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
@stefanprodan stefanprodan transferred this issue from fluxcd/flux2 Aug 25, 2021
@stefanprodan stefanprodan added the bug Something isn't working label Aug 25, 2021
@stefanprodan
Copy link
Member

Can you please try this image and let me know if it fixes the issue for you: #411

@sazo
Copy link
Author

sazo commented Aug 25, 2021

@stefanprodan Thank you very much for the fast response. I tried rc-a49bbf9e and it seems to have fixed the problem.

@stefanprodan
Copy link
Member

Thanks @sazo for testing this, going to release flux2 this week to include this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants