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

helm:Kubernetes Service object not deleted with helm uninstall #672

Open
thecosmicfrog opened this issue Jun 8, 2020 · 1 comment
Open
Labels
area/sync Related to catalog sync type/enhancement New feature or request

Comments

@thecosmicfrog
Copy link

I've noticed the Kubernetes Service object for consul is not deleted with a helm uninstall, meaning we need to go in afterwards and issue kubectl delete service consul. Is this an intentional decision or a bug?

Steps to reproduce:

  1. Create an override values.yaml file containing the following:
global:
  datacenter: sandbox

  gossipEncryption:
    secretName: "consul"
    secretKey: "CONSUL_GOSSIP_ENCRYPTION_KEY"

  tls:
    enabled: true
    httpsOnly: true
    enableAutoEncrypt: true
    serverAdditionalDNSSANs: ["'consul.service.consul'"]

server:
  replicas: 3
  bootstrapExpect: 3
  storage: 20Gi

dns:
  clusterIP: 172.20.53.53

ui:
  enabled: true
  service:
    type: 'LoadBalancer'

syncCatalog:
  enabled: true
  1. Install consul-helm using the above values.yaml file:
    $> helm upgrade --install consul hashicorp/consul --version 0.21.0 --values values-override.yaml

  2. Uninstall consul-helm:
    $> helm uninstall consul

  3. Wait a few minutes and run `kubectl get all --all-namespaces | grep consul". Output:

default    service/consul    ExternalName    <none>    consul.service.consul    <none>    10m

Conclusion: helm uninstall does not remove consul ExternalName Service object.

@lkysow
Copy link
Member

lkysow commented Jun 8, 2020

Hi @thecosmicfrog this is a known issue. We can't implement this in the sync-catalog process because we couldn't differentiate between a pod restart and a helm delete so we'd need to put this in a cleanup job of some sort. I'd say it's something we would like to do.

FYI if you're not using the consul to k8s synced externalname services you can set

syncCatalog:
  toK8S: false

@t-eckert t-eckert changed the title Kubernetes Service object not deleted with helm uninstall helm:Kubernetes Service object not deleted with helm uninstall Aug 24, 2021
@t-eckert t-eckert transferred this issue from hashicorp/consul-helm Aug 24, 2021
lawliet89 pushed a commit to lawliet89/consul-k8s that referenced this issue Sep 13, 2021
Add timestamps to logs printed out by tests
Bump terratest library to the latest version to include
Break up framework package into smaller packages
       * Move suite related code to the suite package
        * Move config-related code to the config package
        * Move test environment and test context related code to the environment package
        * Move consul cluster creation code to the consul package
        * Move flags to the flags package
        * Move the helpers package to framework/helpers
        * New logging code is all in the logger package
@lkysow lkysow added area/sync Related to catalog sync type/enhancement New feature or request labels Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync Related to catalog sync type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants